can someone explain to me where the "projectileConfig" parameter is defined in standing turret? it is not defined in "/interface/turret/standingturret.config" or "/objects/wired/standingturret/standingturret.object" but it is used in "/objects/wired/standingturret/standingturret.lua". I see nothing linking the standingturret.config's itemgrid to the standingturret.lua I am currently trying to use it as a reference for making a keypad and keypad ui.
The script doesn't have "projectileConfig" anywhere within it. However it does have this line - Code: local projectileParameters = config.getParameter("projectileParameters", {}) Which in turn pulls the parameters from the JSON "projectileParameters". Except the vanilla turret doesn't have this defined, thus it defaults to an empty table. edit: This line Code: world.spawnProjectile("standardbullet", firePosition(), entity.id(), aimVector, false, projectileParameters) That would use any alternate parameters, but since the table is empty, it will use the unaltered configurations for the "standardbullet".
Yeah the second (optional) argument to config.getParameter() is a default return supposing it doesn't find what you're looking for. Otherwise it would return nil in that case.