Code wrong in this part? - Explained.

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

Post Reply
siath70
Posts: 459
Joined: Sun, 11. Jan 04, 03:03
x4

Code wrong in this part? - Explained.

Post by siath70 » Tue, 17. May 22, 23:58

I am not saying I 100% understand the code, still learning. However, I ran across something that just doesn't look right, maybe someone can shed some light on it for me and explain it if I am wrong.

Thanks.
In notifications.xml, this line struck me as wrong, the part about the capital.
<!-- Dismiss ship if it has shields which above 20%, hull above 75%, or is a capital ship with no service personnel on board. -->
<do_if value="if not $testcheat? then (((not $target.maxshield) or ($target.shieldpercentage lt 20)) and ($target.hullpercentage lt 75) and not $target.assigneddock and (not $target.iscapitalship or $target.people.count)) else true">

Should it not be this way:
<do_if value="if not $testcheat? then (((not $target.maxshield) or ($target.shieldpercentage lt 20)) and ($target.hullpercentage lt 75) and not $target.assigneddock and (not $target.people.count and $target.iscapitalship)) else true">

I say this because we're looking at no people and if it's a capital.

Anyway thanks.

j.harshaw
EGOSOFT
EGOSOFT
Posts: 1872
Joined: Mon, 23. Nov 15, 18:02

Re: Code wrong in this part?

Post by j.harshaw » Wed, 18. May 22, 14:10

No. These are conditions for crew considering to bail from ships. With current implementation, crew consider bailing from capital ships but the captain never does. From non-capital ships, the captain considers bailing in addition to the crew.

With your proposed change, crew will never bail from non-capital ships and the captain will never do so. Since later logic in that block has the crew bailing before the captain even considers it, the change would effectively disable bailing at all from ships that have at least one crewmember.

siath70
Posts: 459
Joined: Sun, 11. Jan 04, 03:03
x4

Re: Code wrong in this part? - Explained.

Post by siath70 » Wed, 18. May 22, 15:35

Thanks for the explanation, I'm still learning and every little thing helps :)

Post Reply

Return to “X4: Foundations - Technical Support”