[Question] Dynamic station commanded job factions.

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
ravayen
Posts: 37
Joined: Mon, 25. Jan 16, 03:02

[Question] Dynamic station commanded job factions.

Post by ravayen » Thu, 20. Jul 17, 13:15

Is there a way to easily change a job entry that has a station as its commander to use the 'current' station owner as its faction to clarify i mean....

<--mining ship spawned with stationx as its commander-->
job id=blahblah
commander=stationx
owner= whoever currently owns stationx

<---instead of the currently used--->
job id= blahblah
commander=stationx
owner=faction
<--hopefully you get the idea-->

basically i want to allow jobs with stations as commanders to change faction if the owner of the station changes but in the shortest way possible.
They dont have to change faction immediately just the next time they spawn after being destroyed they will be spawned as the station owners faction.

User avatar
Marvin Martian
Posts: 2614
Joined: Sun, 8. Apr 12, 09:40

Post by Marvin Martian » Thu, 20. Jul 17, 13:42

don't know if you can assign a ship to a station by JOBS, because you can't define a Object ID that not exists before the game starts and the object get created

this works on escort jobs for other jobships where the escort is defined in the mainjob, but not based on stations, i think

thats the reason why CWIR use the MD-creation of escorts and (job-)fight-ships
---

you can create jobs for a zone and the modded AI that start first time can search for his new commander, in case you can then also change ownership


i suspect also to use the faction parameter at a cluster/sector/zone won't work very well, i see some debug-logs about "missing" area in case the job can't find a startarea (for the defined faction) at the designated space -- only for the point you come to the idea to create multiple jobs for each faction at the same space

ravayen
Posts: 37
Joined: Mon, 25. Jan 16, 03:02

Post by ravayen » Thu, 20. Jul 17, 14:03

@Marvin Martion

<job id="xen_miner_mineral_medium_a03111" name="{20204,1901}" ignorecommanderwares="true">
<expirationtime min="86400" max="259200"/>
<time interval="800" start="0"/>
<task task="mining.ship.station"/>
<basket basket="xenon_minerals"/>
<quota zone="1"/>
<location class="zone" macro="tzoneCluster_A_Sector03_Zone111_macro"/>
<commander macro="xenon_asteroid_shipyard_macro" entitytype="manager"/>
<ship ref="xen_miner_mineral_medium"/>
<subordinates>
<subordinate job="xen_lfighter_escort"/>
</subordinates>
</job>

A job from cwir jobs.xml denoting a station as its commander by using the manager.

Either way my question isn't related to cwir it's about weather the owner can be changed to the owner of the station instead of a static owner in 'any' jobs file vanilla or other wise by having owner=$stationowner in the job description even if it means adding $stationowner=commander.getfaction at the top of the page.
I'm aware that prob isn't a real command btw :P

User avatar
Marvin Martian
Posts: 2614
Joined: Sun, 8. Apr 12, 09:40

Post by Marvin Martian » Thu, 20. Jul 17, 14:34

that <commander macro /> -thing i didn't expected right now

so in case you could modify the mining.ship.station AI

write an MD CUE that runs by a signal and update owner of ship and crew (and followers)

this can done by a single line <signal_objects objects> at init or first line of AI, maybe you can check first this.ship.job == 'myjob'

ravayen
Posts: 37
Joined: Mon, 25. Jan 16, 03:02

Post by ravayen » Thu, 20. Jul 17, 14:52

Sadly my modding skills are extremely lacking and i would have no idea how to start writing that, i generally only edit small variables that seem obvious when i'm looking at them which is why i was hoping i could simply change owner= to something else
If it really is just a simple one liner could you by any chance provide a copy paste version and tell me where to paste it lol :0 thanks for replying btw i've noticed you help people alot on here. :)

Post Reply

Return to “X Rebirth - Scripts and Modding”