FactionGoal_Invade_Space.xml Why it stops working - Now with dev input

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

Moderator: Moderators for English X Forum

I(kzorn101
Posts: 18
Joined: Sat, 9. Sep 17, 20:26

FactionGoal_Invade_Space.xml Why it stops working - Now with dev input

Post by I(kzorn101 »

Hello,

after a weekend of studing xml codes, I found the reason why the invade faction logic not working correctly.

In line 852 and 1057 of the FactionGoal_Invade_Space.xml the function call "get_module_set_macro" doesn't return the desired result.
( the entire "<do_elseif value="$DesiredSubgoalsKeys.{$i} == '$SUBGOAL_BuildStation'">" block is twice! )

Code: Select all

<get_module_set_macro result="$StationMacro" race="$Faction.primaryrace" type="$StationType"/>
                                                                                 ^^^^^^^^^
As I debuged the Script it turned out that the function can not find the correct Station Macro given by the $StationType variable.

Result from Debugging:
[Scripts] 609434.54 *** Context:md.FactionGoal_Invade_Space.Start<inst:91149>: (antigone) Invade: True Sight(holyorder) -
[Scripts] 609434.54 (antigone) Invade: True Sight(holyorder) - weight 0.121174
[Scripts] 609434.99 ############
(antigone) Invade: True Sight(holyorder) - Phase changed from (null) to (prepare_for_invasion)
############
[Scripts] 609436.02 *** Context:md.FactionGoal_Invade_Space.EvaluateState<inst:91157>: (antigone) Invade: True Sight(holyorder) - desires 1
[Scripts] 609436.02 (antigone) Invade: True Sight(holyorder) - Unable to find suitable station macro for Argon defence
The last line is where the faction war script stops working. It prevents the event from going further.

At first it looks like the defence base macro is not defined, which i can confime going through the station macros, but implement the required macro doesn't have the desired effect.
It could be a bug in the function itself, maybe the string evaluation doesn't work correctly. ( See below )

I can not do much from here because the "get_module_set_macro" function is part of xml engine. So the devs have to take a closer look at it.

Interesting fact:
I was able to get the script working by giving the function a NULL value, which is very interesting and it could be a following error of the incorrect string evaluation.
But it keeps the script working and results that the function returns any consturction plan (with an administration module inside).
The result was that antigone starts to build a tradestation in True Sight to conquer the sector which leeds in a massive war between both factions. Really impressive what the script can do if its working correctly. :D
[=ERROR=] 609436.50 Error in MD cue md.FactionGoal_Invade_Space.EvaluateState<inst:92d15>: Evaluated value 'null' is not a string
* Expression: $StationType
[General] 609436.50 ======================================
[Scripts] 609436.50 *** Context:md.FactionSubgoal_BuildStation.Start<inst:9303a>: triggering (antigone) Build station<inst:9303a>: station_arg_tradestation_base_01_macro in True Sight 0x8851 -
Hope it can be fixed!
Tilen
Posts: 359
Joined: Sun, 9. Dec 18, 19:37
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Tilen »

You, sir, might be a legend. Waiting for confirmation.

In fact, no. I'm calling it early. You are a goddamn legend!

People will whisper your name long after your post will be deleted. They'll sing songs at campfires about the valiant hero who defied the odds and instead solved problems. The One, who cracked the code. He who provides.

I bow to you.
Praise Bernd!
Donkeypancho
Posts: 14
Joined: Sun, 23. Dec 18, 18:21
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Donkeypancho »

:mrgreen: Very impressive observations! Thanks for going into detective mode! You may have just saved the Dev's bacon :lol: Keep up the good work. You are amazing!
Donkeypancho
Posts: 14
Joined: Sun, 23. Dec 18, 18:21
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Donkeypancho »

I wish there was a way to sticky note this to Bernd's screen so he could pop out a hotfix for this! Seems rather important :rant:
Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Berserk Knight »

Looking at modulesets.xml, it could be failing simply because they haven't defined it.
The only module set with the type "defence" belongs to the Xenon.
I(kzorn101
Posts: 18
Joined: Sat, 9. Sep 17, 20:26

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by I(kzorn101 »

Berserk Knight wrote: Tue, 8. Jan 19, 06:45 Looking at modulesets.xml, it could be failing simply because they haven't defined it.
The only module set with the type "defence" belongs to the Xenon.
Thanks! Didn't see the file first time going through. :roll:
Now I was able to finish the script and implement the required macros. But the behavior that a null value return something is still strange. In fact it looks like the devs didn't finished their work. It seems as if the faction war is nearly untested, so it will take some days to verifiy if there is some more work to do. If everything fine, I will bring a mod that implemts the faction war next weekend! :)
( Please be patient with me, I also have some other projects to do )
Donkeypancho
Posts: 14
Joined: Sun, 23. Dec 18, 18:21
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Donkeypancho »

I(kzorn101 wrote: Tue, 8. Jan 19, 15:00
Berserk Knight wrote: Tue, 8. Jan 19, 06:45 Looking at modulesets.xml, it could be failing simply because they haven't defined it.
The only module set with the type "defence" belongs to the Xenon.
Thanks! Didn't see the file first time going through. :roll:
Now I was able to finish the script and implement the required macros. But the behavior that a null value return something is still strange. In fact it looks like the devs didn't finished their work. It seems as if the faction war is nearly untested, so it will take some days to verifiy if there is some more work to do. If everything fine, I will bring a mod that implemts the faction war next weekend! :)
( Please be patient with me, I also have some other projects to do )

Hopefully the Dev's fix it before you make a mod! :oops: Seriously though, great job!
Raevyan
Posts: 1463
Joined: Sat, 4. Oct 08, 17:35
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Raevyan »

Really sad that modders were able to fix so many problems while dev's seemingly are not able to and instead implementing a pretty much pointless, also half finished, online feature.
Donkeypancho
Posts: 14
Joined: Sun, 23. Dec 18, 18:21
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Donkeypancho »

rene6740 wrote: Tue, 8. Jan 19, 23:56 Really sad that modders were able to fix so many problems while dev's seemingly are not able to and instead implementing a pretty much pointless, also half finished, online feature.
They aren't a huge team. This one may have just slipped past them or it may have been 3 a.m. and the coder was exhausted from trying to meet a deadline :lol:
I think the Venture thing was to get everyone to register at Egosoft's website :lol:
Raevyan
Posts: 1463
Joined: Sat, 4. Oct 08, 17:35
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Raevyan »

In my opinion the "small team" argument doesn't count. This game has some really obvious bugs and problems that everyone would encounter by playing the game for an hour or two. As much as I would like to see new features added, they should focus on the existing bugs and half implemented features that are not working. Fix the game first, then add new content.

In the end it was a full priced release and not an early access. There are good examples of games out there programmed by less or even a single guy that are way more polished.
badbane
Posts: 127
Joined: Tue, 29. Oct 13, 07:27
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by badbane »

rene6740 wrote: Wed, 9. Jan 19, 00:28 In my opinion the "small team" argument doesn't count. This game has some really obvious bugs and problems that everyone would encounter by playing the game for an hour or two. As much as I would like to see new features added, they should focus on the existing bugs and half implemented features that are not working. Fix the game first, then add new content.

In the end it was a full priced release and not an early access. There are good examples of games out there programmed by less or even a single guy that are way more polished.
Time vs output no there are not games at x4 scale programmed by individuals that are better. Show me one example. IF you have ever written code especially large projects you have targets to hit. That means you are writing code and sometimes the things you are working on just doesn't work and rather than missing your goal you put in a fix that "works". No it isn't perfect yes you plan on coming back to it. But of course you have 5 more tasks tossed at you and then that clean up gets pushed aside. Now a young modder comes in and then has unlimited time, no pressure, and is not buried in work and finds a bug. Kudos does that mean the devs suck no. It just means a competent person found an error. I work in tech and it is frustrating to see this type of assumption. The additional content coming is likely already developed stuff that didn't make it into the final release of the game but is ready to be put into the game. Adding models and ships is not going to affect the bugs in the base game. No doubt there are people chasing bugs and people polishing content and getting it ready for the game.
TheMandalorian
Posts: 49
Joined: Wed, 5. Dec 18, 07:07
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by TheMandalorian »

I(kzorn101 wrote: Mon, 7. Jan 19, 19:39 Hello,

after a weekend of studing xml codes, I found the reason why the invade faction logic not working correctly.

In line 852 and 1057 of the FactionGoal_Invade_Space.xml the function call "get_module_set_macro" doesn't return the desired result.
( the entire "<do_elseif value="$DesiredSubgoalsKeys.{$i} == '$SUBGOAL_BuildStation'">" block is twice! )

Code: Select all

<get_module_set_macro result="$StationMacro" race="$Faction.primaryrace" type="$StationType"/>
                                                                                 ^^^^^^^^^
As I debuged the Script it turned out that the function can not find the correct Station Macro given by the $StationType variable.

Result from Debugging:
[Scripts] 609434.54 *** Context:md.FactionGoal_Invade_Space.Start<inst:91149>: (antigone) Invade: True Sight(holyorder) -
[Scripts] 609434.54 (antigone) Invade: True Sight(holyorder) - weight 0.121174
[Scripts] 609434.99 ############
(antigone) Invade: True Sight(holyorder) - Phase changed from (null) to (prepare_for_invasion)
############
[Scripts] 609436.02 *** Context:md.FactionGoal_Invade_Space.EvaluateState<inst:91157>: (antigone) Invade: True Sight(holyorder) - desires 1
[Scripts] 609436.02 (antigone) Invade: True Sight(holyorder) - Unable to find suitable station macro for Argon defence
The last line is where the faction war script stops working. It prevents the event from going further.

At first it looks like the defence base macro is not defined, which i can confime going through the station macros, but implement the required macro doesn't have the desired effect.
It could be a bug in the function itself, maybe the string evaluation doesn't work correctly. ( See below )

I can not do much from here because the "get_module_set_macro" function is part of xml engine. So the devs have to take a closer look at it.

Interesting fact:
I was able to get the script working by giving the function a NULL value, which is very interesting and it could be a following error of the incorrect string evaluation.
But it keeps the script working and results that the function returns any consturction plan (with an administration module inside).
The result was that antigone starts to build a tradestation in True Sight to conquer the sector which leeds in a massive war between both factions. Really impressive what the script can do if its working correctly. :D
[=ERROR=] 609436.50 Error in MD cue md.FactionGoal_Invade_Space.EvaluateState<inst:92d15>: Evaluated value 'null' is not a string
* Expression: $StationType
[General] 609436.50 ======================================
[Scripts] 609436.50 *** Context:md.FactionSubgoal_BuildStation.Start<inst:9303a>: triggering (antigone) Build station<inst:9303a>: station_arg_tradestation_base_01_macro in True Sight 0x8851 -
Hope it can be fixed!
Is it possible to provide a mod containing your workaround? Even if it doesn't fix the problem, it still seems to improve it.
I(kzorn101
Posts: 18
Joined: Sat, 9. Sep 17, 20:26

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by I(kzorn101 »

Sooo, Good morning everyone!

The good news first: I have run a test over night and the script is working as intended!
The bad news: there are still some minor bugs, caused by the vanilla script.
It is possible that the consturction vessel of opposite forces build the defence station. It's a bug in the build script that is still not fixed and causes the ship to be shot down up by the station.

However i will try to upload the missing files today, so everyone is free to use and test by himself and naturally ego can implement them if they want to.

And for badbane, I'm a 34 years old software technologist. So no, I'm not that young boy with "unlimited time, no pressure, and is not buried in work". :D :D
TheMandalorian
Posts: 49
Joined: Wed, 5. Dec 18, 07:07
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by TheMandalorian »

I(kzorn101 wrote: Wed, 9. Jan 19, 06:24 Sooo, Good morning everyone!

The good news first: I have run a test over night and the script is working as intended!
The bad news: there are still some minor bugs, caused by the vanilla script.
It is possible that the consturction vessel of opposite forces build the defence station. It's a bug in the build script that is still not fixed and causes the ship to be shot down up by the station.

However i will try to upload the missing files today, so everyone is free to use and test by himself and naturally ego can implement them if they want to.

And for badbane, I'm a 34 years old software technologist. So no, I'm not that young boy with "unlimited time, no pressure, and is not buried in work". :D :D
Thanks a lot. Looking forward to your upload.
User avatar
Tanvaras
Posts: 170
Joined: Thu, 27. Nov 03, 10:45
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Tanvaras »

Bravo, that's an excellent bug find indeed. And as others have said for sure saving Egosoft a lot of time on this issue with now knowing about it. Credit hopefully will be made to you :)
“We don't make mistakes, just happy little accidents.”
“Talent is a pursued interest"
“Let's get crazy.”
“There's nothing wrong with having a tree as a friend.”

Bob Ross, 29 October 1942 - 4 July 1995
I(kzorn101
Posts: 18
Joined: Sat, 9. Sep 17, 20:26

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by I(kzorn101 »

It's uploaded as Faction war hotfix in the scripts and modding section.
XTC0R
Posts: 401
Joined: Sat, 1. Dec 18, 19:58
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by XTC0R »

I(kzorn101 wrote: Wed, 9. Jan 19, 06:24 Sooo, Good morning everyone!

The good news first: I have run a test over night and the script is working as intended!
The bad news: there are still some minor bugs, caused by the vanilla script.
It is possible that the consturction vessel of opposite forces build the defence station. It's a bug in the build script that is still not fixed and causes the ship to be shot down up by the station.

However i will try to upload the missing files today, so everyone is free to use and test by himself and naturally ego can implement them if they want to.

And for badbane, I'm a 34 years old software technologist. So no, I'm not that young boy with "unlimited time, no pressure, and is not buried in work". :D :D
Since when is 34 not young anymore? Damn **** me! :mrgreen:
Kudos to you! Excellent finding.
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13126
Joined: Sat, 9. Nov 02, 11:45
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Xenon_Slayer »

Holiday mode deactivate

Thanks to all involved in finding this. I'll take a closer look at the best way to properly solve it. As it has been pointed out, the Xenon are the only ones in modulesets.xml with specific defence station macros defined. It wasn't always this way but it was changed for other reasons. Obviously it had some unintended side-effects.

As this will require quite a bit of testing to be sure that the factions behave themselves, I don't expect this to make it into the next patch seeing as that is probably focusing on more immediate issues.

Cheers,
Owen
Come watch me on Twitch where I occasionally play several of the X games
Tilen
Posts: 359
Joined: Sun, 9. Dec 18, 19:37
x4

Re: FactionGoal_Invade_Space.xml Why it stops working

Post by Tilen »

Xenon_Slayer wrote: Wed, 9. Jan 19, 14:51 Holiday mode deactivate

Thanks to all involved in finding this. I'll take a closer look at the best way to properly solve it. As it has been pointed out, the Xenon are the only ones in modulesets.xml with specific defence station macros defined. It wasn't always this way but it was changed for other reasons. Obviously it had some unintended side-effects.

As this will require quite a bit of testing to be sure that the factions behave themselves, I don't expect this to make it into the next patch seeing as that is probably focusing on more immediate issues.

Cheers,
Owen
Thanks for the update! I hope that you had a great holiday. :)

I will risk sounding entitled to some by saying that I would ask of you to patch this sooner rather than later. Maybe a beta thing, if possible. I, and many others have been waiting for this for a long time. Thanks again.
Praise Bernd!

Return to “X4: Foundations - Technical Support”