[Official Mod Development Bug Reports] A Thread for Mod Creators

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

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

User avatar
YorrickVander
Posts: 2702
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Wed, 9. Mar 16, 22:04

When making a new sector, would the order in which zones are entered into the zones.xml have any affect on pathing? I ask because up to HoL the order has always followed the map short naming convention, and pathing works reasonably well.

In West Gate however the order of the zones is very strange and we see some very strange pathing too. Charting a few zones in the order they appear in the xml :
district 01, district 03 district05, nirins treaty, far away, kr-12 then noble ambitions... and so on.

Would this account for odd trader orders flying to xenon owned zones way away from valid trades? Or am I seeing something in nothing?
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

User avatar
YorrickVander
Posts: 2702
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Tue, 15. Mar 16, 23:04

Would it be possible to get confirmation that

Code: Select all

$BuildZone.freenpcbuildlocations.count
is working as intended? What I see on use is a non zero return even when that location is actually in use. Tested with plot game in vapour stream with the hoa cv in place waiting for resources.

EDIT : For clarity I should add that in 4.0 there seem to be only a few npc build locs remaining in certain DV systems. In this zone there is only 1 defined.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Wed, 16. Mar 16, 12:42

I didnt check in the mission scripts but is the location claimed properly and the station built on top of it? i thinkt this may not be the case..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Clownmug
Posts: 418
Joined: Wed, 11. Dec 13, 02:39
x4

Post by Clownmug » Wed, 16. Mar 16, 13:34

I think I have some kind of idea of what my crashing problem is now. It was really a combination of problems actually. Every time I reload a save file I basically have to "rebuild" the random universe map. This means destroying multiple regions, jump gates and highways. The game obviously wasn't built to do this so crashing and/or freezing are the end results.

Anyways, here's what I've figured out so far:

Destroying Regions:
- Game freezes if done immediately after loading
- Sometimes works fine if I wait about 5 seconds after finish loading (doesn't 100% remove all asteroids and leaves time for hazard damage)
- Works fine with a short delay if player is warped to a different system

Destroying Highways:
- Game crashes after a few seconds if certain aiscripts are running (probably caused by <move_to> with usehighways="true")
- Game crashes almost instantly if I don't destroy highways that were previously destroyed in the save file
- Sometimes works fine if I warp escort ships to their commanders
- Works fine if I stop all aiscripts on small/medium ships beforehand

So it turns out the crashing I thought was caused by destroying regions was actually caused by aiscripts that broke due to destroying highways. However, destroying regions still causes the game to freeze if done too soon after starting a game or loading a save file. For now the freezing can be mitigated by warping the player back and forth, but I have no idea what to do about the ai problem. It'd be nice I had some way to pause all aiscripts.

User avatar
YorrickVander
Posts: 2702
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Wed, 16. Mar 16, 17:27

UniTrader wrote:I didnt check in the mission scripts but is the location claimed properly and the station built on top of it? i thinkt this may not be the case..
I did try with using a custom station in same place with

Code: Select all

<claim_build_location buildlocation="$BuildLocation" object="$BuilderShip"/>
but I get the same result. The loc is still listed as free even with a station created after claiming (using adapted xml from the empire builder start to spawn).

I do note though that move.buildership returns false in the case of the mistakenly listed location. I will do some debug tests with that when home later to see the point of failure.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Thu, 17. Mar 16, 12:12

YorrickVander wrote:
UniTrader wrote:I didnt check in the mission scripts but is the location claimed properly and the station built on top of it? i thinkt this may not be the case..
I did try with using a custom station in same place with

Code: Select all

<claim_build_location buildlocation="$BuildLocation" object="$BuilderShip"/>
but I get the same result. The loc is still listed as free even with a station created after claiming (using adapted xml from the empire builder start to spawn).

I do note though that move.buildership returns false in the case of the mistakenly listed location. I will do some debug tests with that when home later to see the point of failure.
The last time that I looked at that area of code I came to the conclusion that the claim_build_location call is there more to lock out the script that offers up the build location while the CV moves into position than to to actually prevent the player building on the same location. The claim is released pretty quickly once the CV is in place.

jth
PS I am not certain that it actually removes a build location from the available list until it actually sticks a station on it as opposed to having a CV waiting for materials
Last edited by jth on Thu, 17. Mar 16, 12:37, edited 1 time in total.

jth
Posts: 296
Joined: Tue, 3. Jan 06, 23:31
x3

Post by jth » Thu, 17. Mar 16, 12:28

Don't know if this will help or not but my Station Recycling script gets its building material estimate by actually building a dummy station and this is the code that it uses to find an empty spot to build on

Code: Select all

        <find_sector name="$DV_CanteranSec" macro="macro.cluster_d_sector18_macro"
                     space="md.$DeVries" required="true"/>
        <find_zone name="$CanteranZones" space="$DV_CanteranSec" multiple="true"
                   priorityzone="true" tempzone="false"/>
        <do_all exact="$CanteranZones.count" counter="$Counter">
          <do_if value="($CanteranZones.{$Counter}.freenpcbuildlocations.count ge 1)
                        and ($CanteranZones.{$Counter} != player.zone)" >
            <set_value name="$BuildIn"
                 exact="$CanteranZones.{$Counter}.name"/>
            <set_value name="$BuildLocation"
                 exact="$CanteranZones.{$Counter}.freenpcbuildlocations.random"/>
            <break/>
          </do_if>
        </do_all>
It build on npc slots but if you change freenpcbuildlocations to freebuildlocations then that will probably switch it to player spots

jth

User avatar
YorrickVander
Posts: 2702
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Thu, 17. Mar 16, 12:44

Cheers - what I'm doing currently is looking for a free npc loc, then moving on to look for a player loc if none available. Guess I need a better test system! Thanks very much for the help.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 17. Mar 16, 16:20

what is your overall plan yorrick? Asking because i am currently sitting on something similiar to get into scripting again after 1 1/2 months pause. (Rewrite the Architect to use my CAC framework)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 17. Mar 16, 22:42

sry for double-post - previous reply was too long ago.
YorrickVander wrote:Cheers - what I'm doing currently is looking for a free npc loc, then moving on to look for a player loc if none available. Guess I need a better test system! Thanks very much for the help.
you inded need something better. Player Build Spots only exist while the Player has a builder Ship in squad as i just found out. possibly even only inzone or visible, didnt test for remote zones yet...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
YorrickVander
Posts: 2702
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Thu, 17. Mar 16, 23:25

UniTrader wrote:sry for double-post - previous reply was too long ago.
YorrickVander wrote:Cheers - what I'm doing currently is looking for a free npc loc, then moving on to look for a player loc if none available. Guess I need a better test system! Thanks very much for the help.
you inded need something better. Player Build Spots only exist while the Player has a builder Ship in squad as i just found out. possibly even only inzone or visible, didnt test for remote zones yet...
No, that isn't right. I've already been testing ships that build on player spots, with no player owned cv (or indeed any other ship but the skunk) which build correctly whether in or out of the zone. These are NPC cvs btw.

I'm making a generic station spawn cue for CWIR, a plug in for npc expansion that is passed the zone object, station macro and faction to build for. I was actually about to send it on to pref to test while he works on the actual spawn triggers untill I added the choice of npc or player locs instead of grabbing the first free player loc. There's an alternate test in the ai that should be able to work around the issue.

Currently it spawns a cv in the xl cradle of a shipyard defined by the faction given, or just in zone if thats not available, with an appropriate cv and flies off to the zone to build. Once all stages have been completed the cv auto detatches and move.dies. Just needs the better error checking for invalid locs :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 17. Mar 16, 23:30

hmm, weird.. the check for a free player build location was the only one which prevented my station building dialogue from progressing after telling the Archi to build in his/my current Zone - and this was quickly resolved by adding the CV to my squad.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
YorrickVander
Posts: 2702
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Thu, 17. Mar 16, 23:52

My test mod for the script (running without other mods) i warp the player to the shipyard to check cv spawning. At this point the loc is detected in another zone (not the game start zone) and the cv undocks and sets course. I haven't tested this with player cvs though so this might be the crucial difference.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

DarthNihilus
Posts: 55
Joined: Mon, 7. Mar 16, 14:06

Post by DarthNihilus » Sat, 19. Mar 16, 09:26

idonno if this can be unbugged, but with xenon hunt 3 mod, when I sell the xenon ships to npcs they still are considered "xenon" for them. I sold a few times now a few K-s and an I along with few Titurels and they engaged a sooooooo beautiful fight with the titurels and the npc station :lol:

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

Post by j.harshaw » Sat, 19. Mar 16, 12:43

Interesting. However, boarding any Xenon capital ships isn't officially supported, so I wouldn't expect any official fixes in this regard if I were you. But, yeah, hm, interesting.

DarthNihilus
Posts: 55
Joined: Mon, 7. Mar 16, 14:06

Post by DarthNihilus » Sat, 19. Mar 16, 23:40

j.harshaw wrote:Interesting. However, boarding any Xenon capital ships isn't officially supported, so I wouldn't expect any official fixes in this regard if I were you. But, yeah, hm, interesting.
Surely I'm not :roll: Just sharing my xp

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Wed, 30. Mar 16, 04:41

just had one strange thing, given the following Code:

Code: Select all

        <do_while value="not $buildlocation.child.exists or not $buildlocation.child.buildingmodule.exists">
          <do_if value="this.$ut_cac?" comment="tell the payment script we are doing someting in this payment period.">
            <set_value name="this.$ut_cac.$isactive"/>
          </do_if>
          <wait min="40min" max="50min">
            <interrupt>
              <conditions>
                <event_object_signalled object="this.ship" param="'move.buildership'"/>
              </conditions>
              <actions>
                <set_value name="$move_sucess" exact="event.param2"/>
                <break/>
              </actions>
            </interrupt>
          </wait>
        </do_while>
the Interrupt didnt trigger at all. removing the wait time fixed this.

Background for the Code above is that the Var this.$ut_cac.$isactive shall be set at least hourly to notify the payment Script that this entity is actively Working and not on standby (which eliminates/reduces costs) - waiting till the builder Ship arrives may take longer than this, but the Archi should imo still paid in full. (also i do a rare check if the location is still free, just in case)

in short: a wait with combined time and interrupt doesnt work - time is always prefferred, interrups wont be set up. xsd still recognizes this construct as valid though.

EDIT: just checked the Vanilla Files: you have used this not working construct yourself in:
mining.ship.drone Line 32
move.park Line 204
trade.performplayertraderun Line 147 (with a LONG wait time..)
L____ also in Line 731
L____ also in Line 796 (also a long wait time)
move.unpark Line 103
engineer.player Line 104
move.nohighway Line 25
L____ also in Line 113
L____ also in Line 139
trade.station Line 164
move.collect.drone Line 40
drone.transport Line 31
move.flee.dock Line 94
fight.attack.object.drone.follower Line 52
L____ also in Line 83
move.wareexchange Line 71
L____ also in Line 80
L____ also in Line 128
L____ also in Line 208
L____ also in Line 227
L____ also in Line 275
player.interaction Line 65
masstraffic.watchdog Line 70
L____ also in Line 173
move.escort.capital Line 142
fight.attack.object.station Line 248
L____ also Line 511
move.generic Line 95


Not all of them may be affected though, possibly specifying a max time only works (was done in the most places here) - i didnt test this in detail yet. but the issue i reported with min and max times specified was present in some of the above, too.

as stopgap measure i think it may work to replace the wait times with <interrupt_after_time/> but i have not tested this method yet. looking at the amount of places where this bug may cause unintended delays it might be the easiest to just fix the underlying issue though.


PS also what is up with
move.follow.formation Line 64 to 70? this seems to exit the Script leaving Ships without Commands when OOS (also i saw a few reports about Ships without command in Space lately - possibly related?)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

Post by j.harshaw » Wed, 30. Mar 16, 09:55

Hey Uni,

Adrian did a quick test, and said that interrupts within waits with min and max time specified does still work. We were a bit worried because that not working anymore would indeed break a lot of things.

I also have something similar in a little pet project of mine, and ships do do stuff specified in the interrupt within a similar wait.

Sorry, but don't know why it wasn't working in that particular snippet you posted.

Adrian also said that move.follow.formation isn't used. Probably why it's a bit strange.
jth wrote:If you have a hot key linked to the in-game command line and you use it while a menu with a slider is on the screen then the in-game command line doesn't appear.
Stefan said to say thanks for the report, and that it's fixed internally. No idea when the fix will make its way out the door though.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Wed, 30. Mar 16, 12:16

Ok, thanks for having a look.. sorry for the confusion, i should have tested this more thouroughly perhaps....
will look over my code again today evening if i possibly made another mistake and or if there are further conditions for this to happen. I am absolutely sure that removing the time was my only change though, and that resolved the issue that my architect didnt start building when the builder ship arrived. Usually that change should make no difference in a 10 minute test run...


Regarding the follow script: good to know - i just stumbled across it when looking for core scripts using time + interrupt and it looked very odd to me.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 31. Mar 16, 03:12

sorry for double-post, just thought about it a bit:
is it possiböle that a wait min max with interrupts means that the wait waits at least the min time regardless of interrupts, at min it exits if the interrupt triggered before, between min and max the interrupts trigger and at max it exits definietly? this would also be consistent with the wording of the command but the xsd refers to it as random range, which i interpret as a random time between min and max (and then used as exact), like it seems to be the case with the other commands using a random range
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Post Reply

Return to “X Rebirth - Scripts and Modding”