Debug errors (AI Script) that don't identify the source

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

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

Post Reply
user1679
Posts: 761
Joined: Fri, 20. Jul 18, 23:20

Debug errors (AI Script) that don't identify the source

Post by user1679 » Fri, 29. Jul 22, 04:23

Recently I thought I'd look at incompatibilities between two mods (FOCW Corporations Revised and Ship Variation Expansion). I've worked out tentatively what the problem is and
shared my findings with the SVE mod author. The game now loads without any SVE errors in the log, and also without getting stuck on 99%.

But, now that everything is "working" and the game loads, I noticed errors in the log that don't indicate which mod they're coming from. What's interesting is none of the mods in
question have any AI scripts included in them. My fixes are simply changing a couple CUE triggers to use event_cue_signalled and signaling the CUE from the appropriate CUE
elsewhere. Since there is no mod identified, is this an error in the base game?

Log:

Spoiler
Show
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cc90: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cc90: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cc90: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cc90: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cce2: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cce2: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cce2: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cce2: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cd49: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cd49: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cd49: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cd49: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cdf1: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cdf1: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cdf1: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cdf1: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5ce43: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5ce43: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5ce43: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5ce43: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cf15: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cf15: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cf15: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cf15: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cfd0: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5cfd0: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cfd0: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5cfd0: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5d037: Invalid space
* Expression: $targetspace
* Action: <find_zone>, line 542
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script order.move.recon on entity 0x5d037: Property lookup failed: this.hascontext.{null}
* Expression: not this.hascontext.{$targetspace}
* Action: <do_if>, line 575
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5d037: Error evaluating <event_object_destroyed> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================
[General] 0.00 ======================================
[=ERROR=] 0.00 Error in AI script move.generic on entity 0x5d037: Error evaluating <event_object_changed_zone> event object: Value 'null' is not of type component
* Expression: $destination
* Action: <run_script>, line 577
[General] 0.00 ======================================

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Debug errors (AI Script) that don't identify the source

Post by DeadAirRT » Fri, 29. Jul 22, 13:00

The problem is not with the AI script, it is what SVE is making use said order.

Jobs.xml - line 91 - Wrong location filter for police order

Edit - if that doesn't fix it, then it has something to do with the spawned ships.

user1679
Posts: 761
Joined: Fri, 20. Jul 18, 23:20

Re: Debug errors (AI Script) that don't identify the source

Post by user1679 » Fri, 29. Jul 22, 21:08

DeadAirRT wrote:
Fri, 29. Jul 22, 13:00
The problem is not with the AI script, it is what SVE is making use said order.

Jobs.xml - line 91 - Wrong location filter for police order

Edit - if that doesn't fix it, then it has something to do with the spawned ships.
Interesting but the edits I made to SVE don't spawn any ships until a CUE is activated after 15 minutes. These errors
are literally right after I spawn into a new game.

For example:

Code: Select all

                <cue name="SVE_ActivateFallenSplitJobs" instantiate="true" namespace="this" checktime="player.age + 900s" checkinterval="120min"> <!-- Start jobs after 15 minutes, check every 2 hours -->
                    <actions>

                        <!-- user2046 - Station is a Shipyard if it can build at least L ships -->
                        <find_station name="$Shipyard" space="player.galaxy" owner="faction.fallensplit" canbuildclass="class.ship_l" functional="true" multiple="false">	
                            <match canbuildships="true"/>  
                        </find_station>	
                
                        <!-- user2046 - Station is a Wharf if it can build at least S ships -->
                        
                        <!-- unused
                        
                        <find_station name="$Wharf" space="player.galaxy" owner="faction.fallensplit" canbuildclass="class.ship_s" functional="true" multiple="false">	
                            <match canbuildships="true"/>  
                        </find_station>	
                        
                        -->
                
                        <do_if value="$Shipyard">
                        
                            <find_ship name="$FoundShips" job="'fallensplit_caiman_mixed_cluster'" space="player.galaxy" multiple="true"/>
                            
                            <do_if value="$FoundShips? and $FoundShips.count lt 4">
                                <request_job_ship job="'fallensplit_caiman_mixed_cluster'" name="this.$Requested_Job_Ship" requester="player.galaxy" zone="$Shipyard.zone"/>   
                            </do_if>
                            
                            <find_ship name="$FoundShips" job="'fallensplit_scorpion_mixed_cluster'" space="player.galaxy" multiple="true"/>
                            
                            <do_if value="$FoundShips? and $FoundShips.count lt 11">
                                <request_job_ship job="'fallensplit_scorpion_mixed_cluster'" name="this.$Requested_Job_Ship" requester="player.galaxy" zone="$Shipyard.zone"/>   
                            </do_if>
                            
                            <find_ship name="$FoundShips" job="'fallensplit_taipan_mixed_cluster'" space="player.galaxy" multiple="true"/>
                            
                            <do_if value="$FoundShips? and $FoundShips.count lt 5">
                                <request_job_ship job="'fallensplit_taipan_mixed_cluster'" name="this.$Requested_Job_Ship" requester="player.galaxy" zone="$Shipyard.zone"/>   
                            </do_if>

                        </do_if>
                        
                        <remove_value name="$Shipyard" />
                        <remove_value name="$FoundShips" />
                        
                    </actions>
                </cue>

Also, I checked several other mods that add ships and they use
similar location information:

From XRShip_Pack
<location class="galaxy" macro="xu_ep2_universe_macro" faction="argon" relation="self" comparison="exact" matchextension="false"/>
From line 91 of SVE
<location class="galaxy" macro="xu_ep2_universe_macro" faction="[teladi, ministry]" relation="member" comparison="ge" matchextension="false"/>

PS, thanks for your input. The SVE author didn't officially ask for my help but I like some of the ships in the mod and wanted to help get it working again.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Debug errors (AI Script) that don't identify the source

Post by DeadAirRT » Fri, 29. Jul 22, 22:30

I would never use code from XRship pack to determine if something is correct or good but that's just me.

Ministry should not be policing space that is just member relation. It should be relation self or even better use police faction.

user1679
Posts: 761
Joined: Fri, 20. Jul 18, 23:20

Re: Debug errors (AI Script) that don't identify the source

Post by user1679 » Fri, 29. Jul 22, 22:39

DeadAirRT wrote:
Fri, 29. Jul 22, 22:30
I would never use code from XRship pack to determine if something is correct or good but that's just me.

Ministry should not be policing space that is just member relation. It should be relation self or even better use police faction.
Thanks, I'll adjust those.

Question: How do you know what these parameters are supposed to be. I can see from the base game files what can go there but not necessarily what should go there.

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Debug errors (AI Script) that don't identify the source

Post by DeadAirRT » Sat, 30. Jul 22, 00:14

user1679 wrote:
Fri, 29. Jul 22, 22:39
DeadAirRT wrote:
Fri, 29. Jul 22, 22:30
I would never use code from XRship pack to determine if something is correct or good but that's just me.

Ministry should not be policing space that is just member relation. It should be relation self or even better use police faction.
Thanks, I'll adjust those.

Question: How do you know what these parameters are supposed to be. I can see from the base game files what can go there but not necessarily what should go there.
You basically have to get an understanding of what each thing is. For example, police order is only allowed in sectors that the ships owner has police authority. Then you look at the relation ranges and can clearly see that member is definitely not the relation that should be used.

user1679
Posts: 761
Joined: Fri, 20. Jul 18, 23:20

Re: Debug errors (AI Script) that don't identify the source

Post by user1679 » Sat, 30. Jul 22, 22:55

DeadAirRT wrote:
Sat, 30. Jul 22, 00:14
user1679 wrote:
Fri, 29. Jul 22, 22:39
DeadAirRT wrote:
Fri, 29. Jul 22, 22:30
I would never use code from XRship pack to determine if something is correct or good but that's just me.

Ministry should not be policing space that is just member relation. It should be relation self or even better use police faction.
Thanks, I'll adjust those.

Question: How do you know what these parameters are supposed to be. I can see from the base game files what can go there but not necessarily what should go there.
You basically have to get an understanding of what each thing is. For example, police order is only allowed in sectors that the ships owner has police authority. Then you look at the relation ranges and can clearly see that member is definitely not the relation that should be used.
Thanks, so there is no actual documentation for this? You just have to dig through the extracted base game files? I know about the MD documentation but it doesn't describe this kind of scenario or detail.

Also, I replaced "police" with "patrol" and added relation="[friend, ally]", hopefully that gets rid of some of the issues. I mean I can "patrol" any sector I want with my AI pilot.

Post Reply

Return to “X4: Foundations - Scripts and Modding”