*** moving to official Modding Bug Reports Topic ***
just that everything is in place because the Devs are watching this Topic

Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Thanks for looking into it j.harshaw!j.harshaw wrote:Thanks for the report, Simoom. Looks like those two weapons were overlooked. Fixed internally, but no idea when or if it'll make its way out.
you could try to start the engineer script on him after creation, Command for this:Simoom wrote:Thanks for looking into it j.harshaw!j.harshaw wrote:Thanks for the report, Simoom. Looks like those two weapons were overlooked. Fixed internally, but no idea when or if it'll make its way out.
By the way, found another bug (I think):
- The MD function <create_engineer> doesn't seem to assign the spawned engineer to the specified ship properly (the NPC is created, but reports "None" as the word order).
The functions <create_pilot> and <create_defence_officer> work fine, though, so probably a simple oversight for the engineer only.
Curiously, if the NPC is spawned with the ship itself (e.g. <create_ship><engineer/></create_ship>), the Engineer is properly assigned in this case. But not if the ship is created first, then an engineer is created afterward.
I am aware of that; I do that already in my script (I use <create_platform_actor> since my current method of spawning NPC's based on race specified in choiceparam limits me to create NPCs separately from the ship).UniTrader wrote:you could try to start the engineer script on him after creation, Command for this:
<start_script name="'engineer.ai'" object="$engineer" />
(except for player.primaryship where the Script to be started is 'engineer.player' )
Code: Select all
<set_object_hull object="event.param2.{3}" exact="0"/>
Code: Select all
<get_control_entities groupname="$Entities" object="$Station"/>
<destroy_group group="$Entities"/>
<set_owner object="$Station" faction="faction.ownerless"/>
<find_object_component groupname="$PMC_Station_Modules" object="$Station" multiple="true">
<match_parent class="class.station"/>
</find_object_component>
<destroy_group group="$PMC_Station_Modules" explosion="true"/>
<!--Destroy summarised components-->
<set_summarised_adsign_state object="$Station" state="wreck" exact="$Station.summary.numadsigns.all"/>
<set_summarised_efficiencyupgrade_state object="$Station" state="wreck" exact="$Station.summary.numefficiencyupgrades.all"/>
<set_summarised_shield_state object="$Station" state="wreck" exact="$Station.summary.numshields.all"/>
<set_summarised_surfacedestructible_state object="$Station" state="wreck" exact="$Station.summary.numsurfacedestructible.all"/>
<set_summarised_turret_state object="$Station" state="wreck" exact="$Station.summary.numturrets.all"/>
Code: Select all
Error in MD cue md.[...]: ShipGenerator: <engineer> node missing. Ship [...]macro (using group/ref/[...]).
Error in MD cue md.[...]: ShipGenerator: <defence> node missing. Ship [...]macro (using group/ref/[...]).
Code: Select all
[=ERROR=] 61.22 Invalid SoundID "hash(958769488)" on macro: "units_player_cockpit_1_macro"! No definition found in SoundLibrary.
Code: Select all
<set_value name="$BuildLocation" exact="player.zone.freebuildlocations.random"/>
Code: Select all
<connect_to_build_location object="$CV" buildlocation="$BuildLocation"/>
<set_buildanchor buildmodule="$CV.buildmodule" object="$Station"/>
Code: Select all
<do_if value="not $BuildZone.freenpcbuildlocations.{$i}.child">
Looking into the Architect dialogue issue. I think the problem may be that I used <create_platform_actor>, which does set up a dialogue tree that properly detects if the actor is on a construction vessel. However, because the CV was already connected to the station on spawning, no player build action was performed (which is necessary for triggering the cue "BuildActionPerformed" which subsequently set up the appropriate dialogue options).YorrickVander wrote:For the npc on ship nodes, iirc you just do = null to satisfy the complaints. There's examples in vanilla i'm sure.
For the build locs, this happens in the free list for player + npc locs. Appears to be either a bug or legacy code. Using this check :
however will find if a loc is in useCode: Select all
<do_if value="not $BuildZone.freenpcbuildlocations.{$i}.child">
It is looking at the location, not a cv module so will not care if a cv is present or not.
Code: Select all
<property name="buildlocations" result="List of build locations" type="list" />
<property name="freebuildlocations" result="List of free build locations" type="list" />
<property name="npcbuildlocations" result="List of NPC build locations" type="list" />
<property name="freenpcbuildlocations" result="List of free NPC build locations" type="list" />
Code: Select all
<do_all exact="player.zone.buildlocations.count" counter="$Counter">
<do_if value="not player.zone.buildlocations.{$Counter}.child">
<set_value name="$BuildLocation" exact="player.zone.freebuildlocations.{$Counter}"/>
</do_if>
</do_all>
Code: Select all
<signal_objects object="$Architect" param="'remote_passenger_arrived'"/>
Code: Select all
name="{20102, 8501}"
Code: Select all
<set_value name="$droneCount" exact="20"/>
<create_ship name="$ship" macro="units_size_xl_cargo_hauler_3_macro" zone="player.zone">
<owner exact="faction.player"/>
<pilot group="argon.pilot">
<owner exact="faction.player"/>
</pilot>
<defence group="argon.defence">
<owner exact="faction.player"/>
</defence>
<engineer group="argon.engineer">
<owner exact="faction.player"/>
</engineer>
<units>
<unit category="unitcategory.orecollector" mk="2" exact="$droneCount"/>
</units>
</create_ship>
Code: Select all
<set_value name="$droneCount" exact="20"/>
<set_value name="$droneLevel" exact="2"/>
<create_ship name="$ship" macro="units_size_xl_cargo_hauler_3_macro" zone="player.zone">
<owner exact="faction.player"/>
<pilot group="argon.pilot">
<owner exact="faction.player"/>
</pilot>
<defence group="argon.defence">
<owner exact="faction.player"/>
</defence>
<engineer group="argon.engineer">
<owner exact="faction.player"/>
</engineer>
<units>
<unit category="unitcategory.orecollector" mk="$droneLevel" exact="$droneCount"/>
</units>
</create_ship>
Code: Select all
<destroy_object object="$ship" explosion="false"/>
Code: Select all
<do_all exact="100" counter="$idx" comment="Not sure the counter is required, it's not being used">
<!-- Insert create ship block from above -->
<destroy_object object="$ship" explosion="false"/>
</do_all>
Same with actor groups (used to specify macro selection on actor spawn) - only takes literals, doesn't accept variables. :/ Several of my scripts could be a bit shorter otherwise.XGamer wrote:the mk attribute of the unit subsection for create_ship doesn't accept variables, only numeric literals.
Reported this one earlier. I don't think missing the <pilot> node generates an error message, but <defence> and <engineer> do, which is annoying since I use <create_platform_actor> to generate the crew for my scripts.XGamer wrote:pilot, engineer and defence nodes within create_ship are present to avoid nasty error messages in log.
didn't know the group attribute for actors behaved the same.Simoom wrote:Same with actor groups (used to specify macro selection on actor spawn) - only takes literals, doesn't accept variables. :/ Several of my scripts could be a bit shorter otherwise.
Yes, both (as in you reporting it and pilot not causing errors in the log) are correct (I did actually see you reporting it, as it was on this page of the thread). I just thought I'd mention it to explain the rather lengthy code exampleSimoom wrote:Reported this one earlier. I don't think missing the <pilot> node generates an error message, but <defence> and <engineer> do, which is annoying since I use <create_platform_actor> to generate the crew for my scripts.
Is it possible that you didn't disconnect your CV before telling its pilot to move.die? But even then once it self-destructs, it shouldn't matter.YorrickVander wrote:This doesn't sound correct - the buildloc.child is used in a function i made for BR + Rubini and appears to be working fine for npc built stations. The way it works is to detect the last stage completion and run move.die on the cv. I'll nudge BR to check on this however in case it is not working the way i think it is and run a test or 2 my end.
Code: Select all
<do_all exact="player.zone.buildlocations.count" counter="$Counter">
<do_if value="not player.zone.buildlocations.{$Counter}.child">
<set_value name="$BuildLocation" exact="player.zone.freebuildlocations.{$Counter}"/>
</do_if>
</do_all>
Code: Select all
<cue name="DeployToStation_Arrived">
<conditions>
<event_object_signalled object="$actor.ship" param="'move.buildership'" param2="true"/>
</conditions>
<actions>
<debug_text text="'Connecting %1 (actor %2) to station %3'.[$actor.ship, $actor, $DeployedStation]" />
<cancel_cue cue="DeployToStation_CheckStation" />
<remove_from_player_squad object="$actor.container" />
<connect_to_build_location object="$actor.container" buildlocation="$DeployedStation.buildlocation"/>
<restart_build object="$DeployedStation" buildmodule="$BuildModule" updatebuild="true"/>
<remove_value name="$location" />
<set_value name="$station" exact="$BuildModule.buildanchor" />
<do_if value="$station.isoperational">
<set_object_commander object="$actor.container" commander="$station" type="entitytype.manager"/>
</do_if>
<signal_cue cue="BuildFinished_Wait" />
</actions>
</cue>
Code: Select all
<do_else>
<debug_text text="'Build area free, building'" />
<debug_text text="'Connecting %1 (actor %2) to build location %3'.[$actor.ship, $actor, $location]" />
<remove_value name="$obstructioncheck" />
<remove_blocked_area blocker="$actor" zone="$actor.zone" />
<cancel_cue cue="ValidateDestinationFree" />
<remove_from_player_squad object="$actor.container" />
<connect_to_build_location object="$actor.container" buildlocation="$location"/>
<construct_station object="$actor.container" macro="$selectedMacro" buildlocation="$location" buildplan="$Buildplan" updatebuild="true"/>
<remove_build_location_claim buildlocation="$location" />
<remove_value name="$location" />
<set_value name="$station" exact="$BuildModule.buildanchor" />
<signal_cue cue="BuildFinished_Wait" />
</do_else>