Page 1 of 1
supply.txt bug I believe
Posted: Sat Jul 30, 2022 10:16 pm
by Lothos
Tried this event in supply.txt as a test because I was not having success getting it to work in Burma to suppress a resource. As a test I am trying to suppress a resource in the UK but it never fires.
{
#NAME= Burma - China - Burma Road
#POPUP= Home destroy supplies 1
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 112
#ALIGNMENT_ID= 0
#FLAG_ID= 112
#TRIGGER= 100
#SEASON_FLAG= 0
#DATE= 1939/09/01
#SOURCE_POSITION=
#DESTINATION_RESOURCE= 143,74 [10,10]
; - UK - Allies - War - Not Surrendered
#VARIABLE_CONDITION= 112 [2] [100] [0]
}
The command does not appear to ever fire. I have tried changing the ALIGHMENT_ID but no luck
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 9:43 am
by BillRunacre
The #COUNTRY_ID= needs to belong to a country on the opposite side to the UK.
Keeping the flag as the UK's means that it will appear as a UK event in game, even if it is really (say) a German event in the script.
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 9:47 am
by Lothos
BillRunacre wrote: Tue Aug 02, 2022 9:43 am
The #COUNTRY_ID= needs to belong to a country on the opposite side to the UK.
Keeping the flag as the UK's means that it will appear as a UK event in game, even if it is really (say) a German event in the script.
But I want it to be a UK script and to do damage to its own resource. It appears to not work and never execute.
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 9:50 am
by BillRunacre
A UK script cannot be used to harm the UK, which is why the #COUNTRY_ID= needs to belong to an enemy country.
No one will notice in game, just set #COUNTRY_ID= 45 and it should work.
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 9:55 am
by Lothos
BillRunacre wrote: Tue Aug 02, 2022 9:50 am
A UK script cannot be used to harm the UK, which is why the #COUNTRY_ID= needs to belong to an enemy country.
No one will notice in game, just set #COUNTRY_ID= 45 and it should work.
Would it harm doing this?
Reason I am asking is I am trying to simulate the movement of resources.
- Russian moving its resources to Siberia, I wanted to suppress two resource points in Ukraine and turn on two resource points in Siberia. The only problem is if Russia holds the territories they get double the points.
- Burma Road, wanted to suppress the oil resource and turn on an oil resource in China as a replacement.
Is it possible to allow the event to fire?
On another note I discovered (resource.txt) that if it of Type 2 and it successfully executes every turn that it will keep resetting the resource to 0 even though the event had fired successfully the previous turn(s)
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 10:35 am
by BillRunacre
Lothos wrote: Tue Aug 02, 2022 9:55 am
Would it harm doing this?
Not at all, we use this from time to time in the games already. It's always been this way, and we added the #FLAG_ID= line some years ago just for situations like this.
Lothos wrote: Tue Aug 02, 2022 9:55 am
On another note I discovered (resource.txt) that if it of Type 2 and it successfully executes every turn that it will keep resetting the resource to 0 even though the event had fired successfully the previous turn(s)
Yes, resource scripts will need to be type=1 as their only use is to get a resource to start producing at the required time.
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 10:46 am
by Lothos
BillRunacre wrote: Tue Aug 02, 2022 10:35 am
Lothos wrote: Tue Aug 02, 2022 9:55 am
Would it harm doing this?
Not at all, we use this from time to time in the games already. It's always been this way, and we added the #FLAG_ID= line some years ago just for situations like this.
Lothos wrote: Tue Aug 02, 2022 9:55 am
On another note I discovered (resource.txt) that if it of Type 2 and it successfully executes every turn that it will keep resetting the resource to 0 even though the event had fired successfully the previous turn(s)
Yes, resource scripts will need to be type=1 as their only use is to get a resource to start producing at the required time.
If you can support a Type 2 it would be helpful for an event to shut (or turn on) a resource
Example that I am trying to do
- Oil Resource in Burma (use supply.txt to suppress it)
- Oil Resource in China, along Burma Road (use resource.txt to suppress it or turn it on)
- Decision - Check alignment of all hexes on the Burma road from the two resources if they are all Allied control then the resource in Burma would be suppressed but the resource in China will get turned on
Would you consider adding this functionality? It would not only be a good feature to have (that works within the game engine mechanics) but also then allied Axis Japan to bomb the resource and harass it.
Ofcours for this to work I would need the following
- Type 2 support for resource.txt
- supply.txt to be able to execute for the country that owns the hex. Right now it only fires when the hex is occupied and the owner is COUNTRY_ID (Maybe add a new parameter?) Their is ALIGNMENT_ID but it requires a SOURCE_POSITION which means their has to be a unit in the hex (or something to that effect). Maybe remove that requirement and as long as the owner alignment = ALIGNMENT_ID then execute the event
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 12:24 pm
by BillRunacre
Lothos wrote: Tue Aug 02, 2022 10:46 am
BillRunacre wrote: Tue Aug 02, 2022 10:35 am
Lothos wrote: Tue Aug 02, 2022 9:55 am
Would it harm doing this?
Not at all, we use this from time to time in the games already. It's always been this way, and we added the #FLAG_ID= line some years ago just for situations like this.
Lothos wrote: Tue Aug 02, 2022 9:55 am
On another note I discovered (resource.txt) that if it of Type 2 and it successfully executes every turn that it will keep resetting the resource to 0 even though the event had fired successfully the previous turn(s)
Yes, resource scripts will need to be type=1 as their only use is to get a resource to start producing at the required time.
If you can support a Type 2 it would be helpful for an event to shut (or turn on) a resource
Example that I am trying to do
- Oil Resource in Burma (use supply.txt to suppress it)
- Oil Resource in China, along Burma Road (use resource.txt to suppress it or turn it on)
- Decision - Check alignment of all hexes on the Burma road from the two resources if they are all Allied control then the resource in Burma would be suppressed but the resource in China will get turned on
Would you consider adding this functionality? It would not only be a good feature to have (that works within the game engine mechanics) but also then allied Axis Japan to bomb the resource and harass it.
Ofcours for this to work I would need the following
- Type 2 support for resource.txt
- supply.txt to be able to execute for the country that owns the hex. Right now it only fires when the hex is occupied and the owner is COUNTRY_ID (Maybe add a new parameter?) Their is ALIGNMENT_ID but it requires a SOURCE_POSITION which means their has to be a unit in the hex (or something to that effect). Maybe remove that requirement and as long as the owner alignment = ALIGNMENT_ID then execute the event
Supply scripts can already be used to turn one of these routes off, and set to not fire on the other, thus allowing what you're aiming for here I think?
On the issue of changing the supply script functionality with regards to #COUNTRY_ID=, I''m very reluctant to change that as it could easily have unintended consequences, e.g. we like to keep things consistent across all our games and it would be quite a bit of work to check them all and amend the scripts as required, particularly as I don't see that such a change is needed as setting it to simply belong to the enemy works.
Unless I'm completely missing something here?
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 12:28 pm
by Lothos
BillRunacre wrote: Tue Aug 02, 2022 12:24 pm
Lothos wrote: Tue Aug 02, 2022 10:46 am
BillRunacre wrote: Tue Aug 02, 2022 10:35 am
Not at all, we use this from time to time in the games already. It's always been this way, and we added the #FLAG_ID= line some years ago just for situations like this.
Yes, resource scripts will need to be type=1 as their only use is to get a resource to start producing at the required time.
If you can support a Type 2 it would be helpful for an event to shut (or turn on) a resource
Example that I am trying to do
- Oil Resource in Burma (use supply.txt to suppress it)
- Oil Resource in China, along Burma Road (use resource.txt to suppress it or turn it on)
- Decision - Check alignment of all hexes on the Burma road from the two resources if they are all Allied control then the resource in Burma would be suppressed but the resource in China will get turned on
Would you consider adding this functionality? It would not only be a good feature to have (that works within the game engine mechanics) but also then allied Axis Japan to bomb the resource and harass it.
Ofcours for this to work I would need the following
- Type 2 support for resource.txt
- supply.txt to be able to execute for the country that owns the hex. Right now it only fires when the hex is occupied and the owner is COUNTRY_ID (Maybe add a new parameter?) Their is ALIGNMENT_ID but it requires a SOURCE_POSITION which means their has to be a unit in the hex (or something to that effect). Maybe remove that requirement and as long as the owner alignment = ALIGNMENT_ID then execute the event
Supply scripts can already be used to turn one of these routes off, and set to not fire on the other, thus allowing what you're aiming for here I think?
On the issue of changing the supply script functionality with regards to #COUNTRY_ID=, I''m very reluctant to change that as it could easily have unintended consequences, e.g. we like to keep things consistent across all our games and it would be quite a bit of work to check them all and amend the scripts as required, particularly as I don't see that such a change is needed as setting it to simply belong to the enemy works.
Unless I'm completely missing something here?
Supply scripts do not fire for the country mentioned in COUNTRY_ID. They only fire when the province is occupied by someone else but the owner is COUNTRY_ID.
Any comment on supporting Type 2 for resource.txt?
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 4:22 pm
by Hubert Cater
Hi Lothos,
We'd have to have a rethink on how and what we use the script types for, and while some changes are easy to make, others may be more involved and typically won't be changed unless we need it as a change for our end as well. Not always this way when it comes to script changes, but that's just how things usually unfold.
It's probably not the answer you are looking for exactly, but usually we can find workarounds to give us what we need, e.g. tie in DECISION events with the script types as needed as Bill has suggested.
Hopefully you'll be able to find a solution in there somewhere to get you what you are after, and if not, let us know and maybe we can at least help get you as close as possible.
Hubert
Re: supply.txt bug I believe
Posted: Tue Aug 02, 2022 4:47 pm
by Lothos
Hubert Cater wrote: Tue Aug 02, 2022 4:22 pm
Hi Lothos,
We'd have to have a rethink on how and what we use the script types for, and while some changes are easy to make, others may be more involved and typically won't be changed unless we need it as a change for our end as well. Not always this way when it comes to script changes, but that's just how things usually unfold.
It's probably not the answer you are looking for exactly, but usually we can find workarounds to give us what we need, e.g. tie in DECISION events with the script types as needed as Bill has suggested.
Hopefully you'll be able to find a solution in there somewhere to get you what you are after, and if not, let us know and maybe we can at least help get you as close as possible.
Hubert
Hi Hubert
I tried, using a combination of events. Since their are no NOT conditions their is no way to turn something on and then turn it back off. What I tried was a Decision event that checks for an alignment of hexes. Then having the resource event link back to it to turn it off or on. The problem I ran into was that if the event is marked as true then the resource event fires but resets the resource back to 0 for every turn. My understand is that a resource is turned off for as long as the resource event is false and turns on once the event is true. What is happening here is because the event is true (continuously) it keeps resetting the resource back to 0.
What I am trying to do is simulate the Burma Road and also the movement of Russian Industry to the Urals with ought giving someone free resources that should not exist. Looking at World At War it seems to me the devs ran into the same limitation and chose to do a Decision event to give China MP directly. (Yes this is a bug in the base game as well and I believe you confirmed it in regards to Russian Industry moving to the Urals).
One last note, I want you to know I really appreciate you guys at least taking the time to read my suggestions and/or things that I had found and anything you do I always consider it a gift (and not entitled).
Thank you for this great editor and game

Re: supply.txt bug I believe
Posted: Thu Aug 04, 2022 3:27 pm
by Hubert Cater
Hi Lothos,
Our pleasure and I chatted a bit more with Bill and we are with the understanding that what you are after *should* be possible with the right combination of DECISION or SUPPLY scripts, the latter possible coupled with a RESOURCE script or two.
Using what we've done in our campaigns as a guide, for similar needs, should help, I think?
Hubert
Re: supply.txt bug I believe
Posted: Thu Aug 04, 2022 3:34 pm
by Lothos
Hubert Cater wrote: Thu Aug 04, 2022 3:27 pm
Hi Lothos,
Our pleasure and I chatted a bit more with Bill and we are with the understanding that what you are after *should* be possible with the right combination of DECISION or SUPPLY scripts, the latter possible coupled with a RESOURCE script or two.
Using what we've done in our campaigns as a guide, for similar needs, should help, I think?
Hubert
I was able to to suppress the resource with supply.txt (with some trickery as I discovered the supply events only fire if the country_ID is at war with the owner of the hex)
However, have a resource turn on and off continuously is not possible because resource.txt does not support TYPE= 2. If I make it Type= 1 it will then turn on the resource the first time but it will never turn it back off if the Burma road looses one hex to Japan. I have found no combination of events that can simulate this.
Re: supply.txt bug I believe
Posted: Sat Oct 22, 2022 9:54 am
by Lothos
Hubert Cater wrote: Thu Aug 04, 2022 3:27 pm
Hi Lothos,
Our pleasure and I chatted a bit more with Bill and we are with the understanding that what you are after *should* be possible with the right combination of DECISION or SUPPLY scripts, the latter possible coupled with a RESOURCE script or two.
Using what we've done in our campaigns as a guide, for similar needs, should help, I think?
Hubert
Bringing this guy back up because I think I came up with something that although not perfect will get this working 95% of the situations
So question
The goal of the event (supply.txt) below is to supress a resource that is enemy controlled. You will notice the country that ownes the event is ID 23 (China in this case). The VARIABLE_CONDITION is a dummy country that does not exist on the map so the #VARIABLE_CONDITION= 5 [0] [0] [0] is always true. Will the event fire each turn if China has surrendered?
Code: Select all
{
#NAME= China - Burma Road - Conquered
#POPUP=
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 23
#ALIGNMENT_ID= 0
#FLAG_ID= 23
#TRIGGER= 100
#SEASON_FLAG= 0
#DATE= 1939/09/01
#SOURCE_POSITION=
#DESTINATION_RESOURCE= 323,134 [10,10]
#VARIABLE_CONDITION= 5 [0] [0] [0]
}
Re: supply.txt bug I believe
Posted: Mon Oct 24, 2022 7:53 pm
by Hubert Cater
Hi Lothos
Bill has run a test and it looks like a SUPPLY script belonging to a surrendered China will fire, but not if China is neutral.
Hope this helps,
Hubert
Re: supply.txt bug I believe
Posted: Mon Oct 24, 2022 8:20 pm
by Lothos
Hubert Cater wrote: Mon Oct 24, 2022 7:53 pm
Hi Lothos
Bill has run a test and it looks like a SUPPLY script belonging to a surrendered China will fire, but not if China is neutral.
Hope this helps,
Hubert
Perfect, my tests confirmed it to but wanted to make sure.