Page 1 of 1

Question about script National moral

Posted: Fri Jan 02, 2026 7:17 pm
by welk
In my mod Ancient battles, I created this system of script with 4 scripts : At end of each turn, the program checks if National moral (Army moral in the mod) of each side increase or decrease

Below are the 4 scripts.
All is calibrated for 50%/50%

But I obtain always the same result : moral of blue side increase, and moral of red side decrease : I tried this evening during one entire hour, and I obtained always this same result.

Below are the 4 scripts. I used 2 Global variables (1 & 2), calibrated (for each) 1,50 / 51,100
Logically, each side would have 50% chance to increase and 50% chances to decrease.
But blue side always increase and red side always decrease

What did I wrong in scripts, please ? They are exactly symetrical and I should not obtain always this same result : blue increase and red decrease (during one entire hour, always same result = I tried that in a hotseat test)


I suspect that the problem, comes from #GV values : because each time I do not use them (setting dummy value => #GV = [1,100] and using only the basic trigger value (set to 50%), the system works perfect : in this case, sometime blue increases/red has no increasing, and sometime red increases/blue has no increasing

Here is the system of 4 scripts that does not work properly :
;
;BLUE SIDE ARMY MORAL INCREASE note forum : this script seems always fire
{
#NAME= BLUE SIDE ARMY MORAL INCREASE
#POPUP= BLUE SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,50]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 100
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;RED SIDE ARMY MORAL INCREASE note forum : this script seems never fire
{
#NAME= RED SIDE ARMY MORAL INCREASE
#POPUP= RED SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 2[1,50]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;BLUE SIDE ARMY MORAL REDUCED note forum : this script seems never fire
{
#NAME= BLUE SIDE ARMY MORAL REDUCED
#POPUP= BLUE SIDE GENERAL FAILED IN RALLYING HIS TROOPS... MORAL OF ARMY IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[51,100]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 100
#NM_UPDOWN= -100
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;RED SIDE ARMY MORAL REDUCED note forum : this script seems always fire
{
#NAME= RED SIDE ARMY MORAL REDUCED
#POPUP= RED SIDE GENERAL FAILED IN RALLYING HIS TROOPS... MORAL OF ARMY IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 2[51,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#NM_UPDOWN= -100
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

When I use the following more simple alternate system, with only 2 scripts using just trigger and not GV, all things work perfect :
in this case, sometime blue increases/red has no increasing, and sometime red increases/blue has no increasing : it's logical because trigger is set 50 => 50% chances for each side to increase, 50% chances for each side to not increase
But with this more simple system, I can not decrease a side : eah side increases or not increases (I would want to be able to sometime decrease a side by random result)

I think there are 2 solutions for this problem :
1/ I did something wrong in my scripts (but what ? I did not find my error :roll: )
or
2/ GV 1 and/or 2 do not work properly


;BLUE SIDE ARMY MORAL INCREASE
{
#NAME= BLUE SIDE ARMY MORAL INCREASE
#POPUP= BLUE SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 50
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;RED SIDE ARMY MORAL INCREASE
{
#NAME= RED SIDE ARMY MORAL INCREASE
#POPUP= RED SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 50
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

Re: Question about script National moral

Posted: Fri Jan 02, 2026 8:06 pm
by welk
I tried to change order of the 4 scripts, to do a test

With the following modified order of scripts, I obtain always this strange result : the 2 sides decrease always in moral.

Very curious... :roll:

;
;BLUE SIDE ARMY MORAL INCREASE
{
#NAME= BLUE SIDE ARMY MORAL INCREASE
#POPUP= BLUE SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,50]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 100
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;BLUE SIDE ARMY MORAL REDUCED
{
#NAME= BLUE SIDE ARMY MORAL REDUCED
#POPUP= BLUE SIDE GENERAL FAILED IN RALLYING HIS TROOPS... MORAL OF ARMY IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[51,100]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 100
#NM_UPDOWN= -100
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;RED SIDE ARMY MORAL INCREASE
{
#NAME= RED SIDE ARMY MORAL INCREASE
#POPUP= RED SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 2[1,50]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;RED SIDE ARMY MORAL REDUCED
{
#NAME= RED SIDE ARMY MORAL REDUCED
#POPUP= RED SIDE GENERAL FAILED IN RALLYING HIS TROOPS... MORAL OF ARMY IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 2[51,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#NM_UPDOWN= -100
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

Re: Question about script National moral

Posted: Fri Jan 02, 2026 10:36 pm
by Lothos
You are mis-nuderstanding how the GV values work

These are dice rolls that happen right at the startup of the game and they never change for the duration of the game.

When you say 1,50 that means if the GV die roll was between that it will fire, if the GV die roll is 51 or higher it will NOT fire.

So if the GV dice roll is 51 then your event will never fire ever in that specific game.

I believe the ~ key on the keyboard will show you the values of the GV dice rolls in a single player game (not PBEM)

Re: Question about script National moral

Posted: Fri Jan 02, 2026 11:01 pm
by welk
Ok, thanks. But in this case, what is the difference between GV and trigger in scripts ?
If GV works like a unic value like, it's exactly like trigger, and what is the interest to use GV in addition of trigger ? To use just trigger value (that is in all scripts) would be enough.

I based my idea of multiples values for GV on these messages, that were posted by other modders in this thread :
https://forums.matrixgames.com/viewtopi ... 0#p5239340

They seem say that they use GV like a multi-value to randomize events in different scripts
Would usefull to have official precisions of Bill about that

Here are their messages :
CITATIONS
MESSAGE OF MELVIN
rmelvin wrote: Fri Aug 29, 2025 1:34 am I use GV in many different ways. Given GV number is set at the beginning of the game.
I use GV for #Amphibious & #Amphibious_minor so the buildup can be the same, but different landing zones.
Example GV 1[1,50] land zone A and GV 1[51,100] land zone B.

Use GV for #Purchase and #Research. I have three different GV for each major country (example GV 1{1,30], GV 1[31,60], GV 1[61,100]).
With three different GV for each major country. Each major country #Purchase and #Research can product one of three different scenarios for each major country per game.
My GV are.
Infantry, Armour and Air/Naval, means #Purchase and #Research concentrate on those elements not at the exclude of the others.
One game Italy is Infantry and UK is Air/Naval.
Next game Italy is Armour and UK Armour. Tanks clash in the desert.
CITATION
welk wrote: Fri Aug 29, 2025 2:13 am Example GV 1[1,50] land zone A and GV 1[51,100] land zone B.

Use GV for #Purchase and #Research. I have three different GV for each major country (example GV 1{1,30], GV 1[31,60], GV 1[61,100]).


How can you have 3 GV with same N° ? It's curious, I do not understand. Seems there are only 10 allowed GV per campaign, each with a different n° (1 to 1O)

Or perhaps is it that : There are 1 to 10 max GV in a game (campaign), and each GV may have only one unic N°. But each GV may have different values in different scripts. Is my interpretation correct ? Things are not easy to understand in a foreign language (frenchies frogs and subtilities of english language are not friends :mrgreen: )
CITATION
MESSAGE OF MELVIN
rmelvin wrote: Fri Aug 29, 2025 11:21 am I assign a GV to each major country. Like UK is GV 1[1,100] then with #Amphibious I wrote script for land zone A using GV 1[1,50] and land zone B using GV 1[51,100]. This way there is a 50% per game the UK will land in either Landing Zone A or Landing B. Now the Axis must defend both areas or hold in reserve and wait. To see were the UK lands.

In #Purchase and #Research the UK is set to
GV 1[1,40] = Infantry -> Concentrates on Infantry type unit and research per game
GV 1[41,80] = Armour -> Concentrates on Armour type unit and research per game
GV 1[81,100] = Air/Naval -> Concentrates on Air/Naval type units and research per game.
If UK gets a GV 1[53] at the start of the game
A higher percent for #Purchase and #Research is assigned to Armour type unit and research for that game.
This way each major AI country has one of three possible ways AI conducts the game.

France is GV 2[1,100]
USA is GV 3[1,100]
USSR is GV 4[1,100]
Poland is GV 5[1,100]
Germany is GV 6[1,100]
Italy is GV 7[1,100]
not assigned GV 8..10[1,100]
CITATION
MESSAGE OF EL CONDORO
El_Condoro wrote: Mon Sep 01, 2025 8:44 am I use a similar approach in Orb & Crown for the strategic decisions of a country. GV # [1,35] attacks A; [36,75] attacks B; and [76,100] attacks C. (offensive.txt AI scripts)

Re: Question about script National moral

Posted: Fri Jan 02, 2026 11:24 pm
by welk
In addition : if the script with #GV= 1[1,50] does not work because fired value is by example 52, a script with #GV= 1[51,100] should fire.
But in my case, it does not.

If you read my 4 scripts, you may see that 2 have a GV = 1,50, and the two others have a GV = 51,100

;BLUE SIDE ARMY MORAL INCREASE note forum : this script seems always fire
{
#NAME= BLUE SIDE ARMY MORAL INCREASE
#POPUP= BLUE SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,50]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 100
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;RED SIDE ARMY MORAL INCREASE note forum : this script seems never fire
{
#NAME= RED SIDE ARMY MORAL INCREASE
#POPUP= RED SIDE GENERAL SUCCEEDED IN RALLYING AND GALVANIZING HIS TROOPS ! MORAL OF ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 2[1,50]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;BLUE SIDE ARMY MORAL REDUCED note forum : this script seems never fire
{
#NAME= BLUE SIDE ARMY MORAL REDUCED
#POPUP= BLUE SIDE GENERAL FAILED IN RALLYING HIS TROOPS... MORAL OF ARMY IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[51,100]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 100
#NM_UPDOWN= -100
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;RED SIDE ARMY MORAL REDUCED note forum : this script seems always fire
{
#NAME= RED SIDE ARMY MORAL REDUCED
#POPUP= RED SIDE GENERAL FAILED IN RALLYING HIS TROOPS... MORAL OF ARMY IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 2[51,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#NM_UPDOWN= -100
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

Bill, please : could you explain in details the system of GV, because explanations in templates scripts concerning GV are not very detailled : would be usefull

If GV may not be used like Melvin said in the above messages, what is the interest to have GV ? Trigger is in all scripts and would be enough. The only utility of GV is to envisage 2,3, 4 etc possible values for the concerned GV, to randomize the games. If GV is used only like trigger value, what is the interest to have GV in addition of trigger in a script ?

Re: Question about script National moral

Posted: Fri Jan 02, 2026 11:44 pm
by welk
Lothos wrote: Fri Jan 02, 2026 10:36 pm You are mis-nuderstanding how the GV values work
These are dice rolls that happen right at the startup of the game and they never change for the duration of the game.
Seems you are right, after reflexion : I though that values were rolled each turn, and it is not the case : they are rolled at beginning of game, just one time

Too bad... If values were rolled each turn, it would give more largely randomize possibilities. But you are right, value are rolled one unic time at start of game.

In conclusion, GV is not a so interessant tool I though : due to the fact values are rolled at start one unic time, randomize possibilities are highly limited. Hubert should have choiced to roll the values each turn

In my system, I wanted to use GV variation at each turn, it would have been very cool to have this tool. I will hve to use only 2 scripts with triggers, because I want have randomization variations for each turn.

Would be good to have in future update that sort of thing :
1/ GV like actual GV (rolled one unic time at start of game)
2/ Special additionnal GV that would be rolled each turn : lot of cool variations could be made with these special values, because trigger is not so interessant than GV with multiples possible values (Example : to give an event 45% chances to fire is not so interessant than to be able to envisage each turn more cases like that : (1,25) (26,34)(35-67) (68,100)

Re: Question about script National moral

Posted: Sat Jan 03, 2026 8:36 am
by welk
Finally, I did that (see below). It does work fine but it has not the same precision than GV that would change each turn (because in some cases, a increasing script and a decreasing script may fire at the same time, and the actual trigger system of each script does not allow to block that

I set increasing scripts with a trigger= 70% and decreasing scripts with a trigger = 25%. But the both may fire in some cases

If system of trigger would allow to envisage multiples values, would be great.
Example : (1,25) (26,100) in place of unic %

Something like that : #TRIGGER= [x,y] in place of #TRIGGER= x

;
;BLUE SIDE ARMY MORAL INCREASE
{
#NAME= BLUE SIDE ARMY MORAL INCREASE
#POPUP= BLUE SIDE GENERAL WAS SUCCESSFULL TO RALLY HIS TROOPS : MORAL OF HIS ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 70
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;RED SIDE ARMY MORAL INCREASE
{
#NAME= RED SIDE ARMY MORAL INCREASE
#POPUP= RED SIDE GENERAL WAS SUCCESSFULL TO RALLY HIS TROOPS : MORAL OF HIS ARMY DOES INCREASE !
#IMAGE= victory.png
#SOUND= success.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 70
#NM_UPDOWN= 500
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;
;BLUE SIDE ARMY MORAL REDUCED
{
#NAME= BLUE SIDE ARMY MORAL REDUCED
#POPUP= UNFORTUNATLY, SOME DESERTIONS OCCURED IN BLUE ARMY... BLUE MORAL IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 112
#TRIGGER= 25
#NM_UPDOWN= -150
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 1,24
#ALIGNMENT_POSITION= 1,24 [2]
#VARIABLE_CONDITION= 112 [2] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}
;RED SIDE ARMY MORAL REDUCED
{
#NAME= RED SIDE ARMY MORAL REDUCED
#POPUP= UNFORTUNATLY, SOME DESERTIONS OCCURED IN RED ARMY... RED MORAL IS DECREASING !
#IMAGE= failed.png
#SOUND= failed.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 25
#NM_UPDOWN= -150
#NM_TURNS= 1
#DATE= 0001/04/01
#OBJECTIVE_TEXT_POSITION= 50,23
#ALIGNMENT_POSITION= 50,23 [1]
#VARIABLE_CONDITION= 59 [1] [100] [0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

This system does allow to adapt for each battle a randomization of marginal losses (or marginal bonus) in Army moral and does avoid that Army moral of a side may decrease or increase to quickly

Re: Question about script National moral

Posted: Sat Jan 03, 2026 9:32 am
by BillRunacre
Perhaps the answers lies in tieing some or all of these scripts to dummy DECISION events, with them having a trigger of 50% to achieve the same result?

GV numbers are extremely useful for some purposes, e.g. having variety between games, while trigger %s are the way to get variety within a game.

Re: Question about script National moral

Posted: Sat Jan 03, 2026 12:12 pm
by welk
By"dummy decision", I suppose you means decision event without any popup (that fire "yes" automatically). Is it right ?

I found here an explanation here, about this kind of dummy decisions :
https://forums.matrixgames.com/viewtopi ... 4#p4725904

But I don't see how to proceed : to fire the decision event, there are 2 solutions : to use GV value (not usable in my case because GV values never change during game) or trigger of the decision, set to 50%

But what is the difference between a "dummy decision" (automatically "yes") with trigger set to 50% and a national moral script set with a trigger = 50% ?

In my opinion (but perhaps I am missing something), the only interest to use "dummy decision" would be to use the national moral trigger of event decision to set a minimum level of National Moral to conditionne the event:


Each decision script has a line #NATIONAL_MORALE_TRIGGER=

#NATIONAL_MORALE_TRIGGER= country_id [national_morale_percentage] Under what national morale situation will this event occur
Format: country_id [national_morale_percentage]
The event checks for a value less than or equal to the 'national_morale_percentage'.
More than one #NATIONAL_MORALE_TRIGGER can be set
Each #NATIONAL_MORALE_TRIGGER line will be read using AND logic.


The system could be that :
1/The event"dummy decision" (it will have the N°1 and will give automatically "yes") fires with his trigger = 50% , and only if for a determined side, #NATIONAL_MORALE_TRIGGER= has a certain determined level, low or high

2/The national moral script fires with #LINK= 1 (it fires because "yes" was automatically anwsered in dummy decision event N°1)

With this system, I would be able to increase army moral of a side if too low

But I do not see any other utility. If you have some ideas, I am interrested ;)

Re: Question about script National moral

Posted: Sat Jan 03, 2026 6:58 pm
by BillRunacre
You've understood it perfectly there.

Is all clear now?

Re: Question about script National moral

Posted: Sat Jan 03, 2026 7:09 pm
by welk
Yes, thanks a lot for infos. ;)

The mod is now finished and I will upload it soon. It's incredible to see how good works the AI of Hubert, without any secret advantage in my parameters (the both side are equals and the mod may without any pb be also played human vs human).

Re: Question about script National moral

Posted: Sun Jan 11, 2026 4:42 am
by rmelvin
I do not know how the internal GV gaming system works. If possible, to add another parameter for game start or per turn.

Now and default GVx [x,xx]
New
GVx [x,xx,0] = set at start game.

GVx [x,xx,1] = set per turn. :idea:

Re: Question about script National moral

Posted: Sun Jan 11, 2026 9:19 am
by welk
+1

It would be a cool solution 8-)

Re: Question about script National moral

Posted: Mon Jan 12, 2026 2:43 am
by rmelvin
As now GV set to default at start of game to per game.

Decision condition the GV.

example -> Set France AI to per turn at start of game. :idea:
DECISION = 001
AI = 2
COUNTRY_ID = 40
GV4 [1,100] [1] = set to per turn
DATE = 0001/01/01, important to set date prior to any script reviews.

If could reset GV in game

example -> Set UK AI to per turn in game.
DECISION = 002
AI = 2
COUNTRY_ID = 112
GV1 [1,100] [1] = set to per turn
DATE = 1941/12/07.
VARIABLE_CONDITION= 115 [2] [100] [0] :geek:

Re: Question about script National moral

Posted: Mon Jan 12, 2026 9:41 am
by welk
ok, I see what you means

But I have a problem in translation with the automatic translator (in particular, words in red) :
As now GV set to default at start of game to per game.


Translator of Google chrome and automatic translator of "Deep L" give me 2 different and contradictory significations in french

Translator of Google chrome does say me you write that value is set at start of game for a certain number of turns

But Deep L translator does say me you write that value is set at start of game for all duration of the game

These 2 translations are contradictory: a "certain number of turns" is not equal to "all duration of game".

Is what you write here (below) actual reality, or is it only what you suggest ?
rmelvin wrote: Mon Jan 12, 2026 2:43 am example -> Set France AI to per turn at start of game. :idea:
DECISION = 001
AI = 2
COUNTRY_ID = 40
GV4 [1,100] [1] = set to per turn
DATE = 0001/01/01, important to set date prior to any script reviews.

In scripts documentation (templates), I did never see this supplementary [1] in GV line,
just that : GV 1 [x,y] , and never GV 1 [x,y] [z]

So, I was in doubt about the signification of what you write (difficulty of translation)

To do a practical test, I entered GV 1 [1,100] [1] in one of my scripts : I would want to verify these 2 solution, to see what was the correct solution :

1°/ If the program would have refused this supplementary [1], it would have mean that it was not an actual acceptable value, just something what you wish (idea suggestion)

2°/ If the program would have accepted the supplementary value, it would have mean that it's a actual acceptable and usable value


I though solution N°1 would be the result, because I never seen in given templates this supplementary [1], but I was surprised that editor did not refuse the value : this value was accepted when I updated the script in editor (ordinary, when a value is not accepted, an error message is displayed in editor to refuse the no correct values)

So, I am confused about that...

And second question : if this supplementary value [1] is actually a correct value, what does mean the 1 ? Does it mean that variable is set for one unic turn ? (If 2 = 2 turns, if 3= 3 turns, etc)

Sorry, but I need absolutly work with automatic translators, and sometimes translations are not easy to understand (to commuicate with me, it's better to use an elementary, school and very simple english :mrgreen: )

Re: Question about script National moral

Posted: Wed Jan 14, 2026 1:34 am
by rmelvin
Just a suggestion. I thought about expanding the GV use that all.

As of present the script syntax default value is GV1[1,100].

Just expanding on your thought about the GV's.
Your translation problem reminds me when living in Germany as a school kid.
Our English teacher was from UK. A whole lot of same words with same meaning but different use.

Also, the examples are just that, these are not fix values. Just examples.

Re: Question about script National moral

Posted: Wed Jan 14, 2026 7:25 am
by welk
Ok, thanks for precision. The most curious thing is that the syntax GV [x,y] [z] you suggested is actually accepted by the program without error mesage when scripts are updated (I tested that). It seems have no effects but editor does not display any error message.