the question about <set_owner> Label usage problems

The place to discuss scripting and game modifications for X4: Foundations.

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

Post Reply
hxsgame
Posts: 210
Joined: Thu, 4. Oct 18, 16:54
x4

the question about <set_owner> Label usage problems

Post by hxsgame » Tue, 17. Jan 23, 17:29

when I was used the label of <set_owner object faction> to change the station's faction, there are some strange situation, that bothers me a lot. So I hope to get help.

The target station's faction has changed, Production and shipbuilding can also proceed normally.

But the station no more attacks, when attacked also only once warning , no counterattack, no release of defense drones, no response at all...

Also, some right-click menu commands are ineffective for these stations.

I don't know what the problem is. Do the station's defenses need to be set up separately?

Please help :|

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: the question about <set_owner> Label usage problems

Post by euclid » Tue, 17. Jan 23, 18:31

There are scripts running on entities (NPCs and/or computers) accociated with a station. Those scripts manage the trade and defense. I think this is what causes the problems you have.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

hxsgame
Posts: 210
Joined: Thu, 4. Oct 18, 16:54
x4

Re: the question about <set_owner> Label usage problems

Post by hxsgame » Fri, 20. Jan 23, 05:57

euclid wrote:
Tue, 17. Jan 23, 18:31
…… I think this is what causes the problems you have.

Cheers Euclid
Thank you so much for your advice, The problem was really about entitys.

The mod code I used removed all of the default control_entitys of the the station. And then added new ones, but the added ones have no effect on defense.

This change seems irreversible, and I have yet to figure out how to restore the defensive behavior by adding entities.

But I have been able to avoid the occurrence more of such problems. thanks for your help again :wink:

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: the question about <set_owner> Label usage problems

Post by euclid » Fri, 20. Jan 23, 14:45

hxsgame wrote:
Fri, 20. Jan 23, 05:57
Thank you so much for your advice, The problem was really about entitys.

The mod code I used removed all of the default control_entitys of the the station. And then added new ones, but the added ones have no effect on defense.

This change seems irreversible, and I have yet to figure out how to restore the defensive behavior by adding entities.
......
If the station is your own then just hire new manager, engineer and defense officer . Otherwise I know of two ways to run the corresponding scripts on them: Either via

Code: Select all

<assign_control_entity object="insert station here" actor="insert npc here" post="controlpost.X" transfer="true" />
where X is manager, engineer or defense, or via

Code: Select all

 <start_script object="insert NPC here"" name="'insert script here'"/>
where the corresponding scripts are trade.station, engineer_ai and fight.attack.object.station.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Post Reply

Return to “X4: Foundations - Scripts and Modding”