Page 1 of 1

Why my popup script does not fire ?

Posted: Sun Dec 07, 2025 3:39 pm
by welk
I am trying to implement a popup message script in my mod.
The function of the popup is to ask player to verify victory conditions (These conditions are special, and explained in the readme : they are external of the game, because in battles, victory conditions depend of moral + losses)

I have written this script :
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; POPUP EVENTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;VICTORY CONDITIONS VERIFICATION
;
{
#NAME= VICTORY CONDITIONS VERIFICATION
#POPUP= <<TAG_1>>
#MESSAGE= VERIFY IF VICTORY CONDITIONS OF CURRENT ARE SATISFIED (See readme of the mod)
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0 ; Level game has to be at least "green"
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 59 ; Italy is Roman army
#TRIGGER= 100
#PRIVATE= 0
#DISPLAY_ORDER= 1
#DISPLAY_TURN= 1
#DISPLAY_STYLE= 0
#MESSAGE_STYLE= 0
#TEXT_RGB= 0,0,0
#SHADOW_RGB= 0,0,0
#MAP_POSITION=25,25 ; center of screen
#DATE= 0001/05/1
#ALIGNMENT_POSITION= 50,10 [1] ; coordinates of the army roman camp, that is Italy (Axis)
#VARIABLE_CONDITION= 59 [1] [100] [0] ; Italy in Axis side and not surrended
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0] ; dummy condition, always satisfied
}

But it does not "fire". What is wrong in my text script ? (I suspect that my date is wrong : I should have set the date of beginning and not the date of end battle. But when I change the date and set 1 in place of 3, I have same result : script does not "fire", and it should, I think)
I have verified thet the box of the script was checked in scripts window : it's not the origin of pb
I tried to change the type of the script (3 in place of 2, but same result : script does not fire

The script appears ok in the editor when I use the button "View"
CAPTURE_SCRIPTS.png
CAPTURE_SCRIPTS.png (2.04 MiB) Viewed 372 times

Re: Why my popup script does not fire ?

Posted: Sun Dec 07, 2025 6:18 pm
by BillRunacre
Does it work if you change this:

#COUNTRY_ID= 59 ; Italy is Roman army

to this:

#COUNTRY_ID= 59
; Italy is Roman army

Same with the alignment, variable and condition positions one (this may not make any difference, but just in case...).

#DISPLAY_TURN= 1 means it will only appear on the Axis turn.

For testing purposes I would definitely have the date as the first turn of the campaign.

TYPE= 2 means it will pop up every turn that its conditions are met, once you've got it working you may wish to change this to TYPE= 1.

Re: Why my popup script does not fire ?

Posted: Sun Dec 07, 2025 7:21 pm
by welk
It's curious : I tried that and the script does not fire
50,10 is the position of Roman camp (Italy, under Axis control)
ID 59 is ITALY (Roman army)
#DATE= 0001/05/01 is the beginning of the campaign (first turn)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; POPUP EVENTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;VICTORY CONDITIONS VERIFICATION
;
{
#NAME= VICTORY CONDITIONS VERIFICATION
#POPUP= <<TAG_1>>
#MESSAGE= VERIFY IF VICTORY CONDITIONS OF CURRENT ARE SATISFIED
#IMAGE= yamamoto.png
#SOUND= victory_march.ogg
#FLAG= 0
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#PRIVATE= 0
#DISPLAY_ORDER= 1
#DISPLAY_TURN= 0
#DISPLAY_STYLE= 0
#MESSAGE_STYLE= 0
#TEXT_RGB= 0,0,0
#SHADOW_RGB= 0,0,0
#MAP_POSITION= 25,25
#DATE= 0001/05/01
#ALIGNMENT_POSITION= 50,10 [1]
#VARIABLE_CONDITION= 59 [1] [100][0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

Re: Why my popup script does not fire ?

Posted: Sun Dec 07, 2025 8:44 pm
by BillRunacre
welk wrote: Sun Dec 07, 2025 7:21 pm
#FLAG= 0
This needs to be #FLAG= 1 to fire, or you can manually turn it on in the Options -> Advanced -> Scripts, but for testing purposes I would definitely have it set to #FLAG= 1.

Re: Why my popup script does not fire ?

Posted: Sun Dec 07, 2025 9:10 pm
by welk
The script is now that (#FLAG= 1), but it does not work. Very curious, I verified all parameters, and this script is very simple and clear : in logic, it should normally fire at the first turn (the first turn is for red side and the campaign begin 1 may of year 1) :shock:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; POPUP EVENTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;VICTORY CONDITIONS VERIFICATION
;
{
#NAME= VICTORY CONDITIONS VERIFICATION
#POPUP= <<TAG_1>>
#MESSAGE= VERIFY IF VICTORY CONDITIONS OF CURRENT ARE SATISFIED
#IMAGE= yamamoto.png
#SOUND= victory_march.ogg
#FLAG= 1
#TYPE= 2
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#COUNTRY_ID= 59
#TRIGGER= 100
#PRIVATE= 0
#DISPLAY_ORDER= 1
#DISPLAY_TURN= 0
#DISPLAY_STYLE= 0
#MESSAGE_STYLE= 0
#TEXT_RGB= 0,0,0
#SHADOW_RGB= 0,0,0
#MAP_POSITION= 25,25
#DATE= 0001/05/01
#ALIGNMENT_POSITION= 50,10 [1]
#VARIABLE_CONDITION= 59 [1] [100][0]
#CONDITION_POSITION= 0,0 [0,0] [0,0] [0] [0]
}

Re: Why my popup script does not fire ?

Posted: Sun Dec 07, 2025 10:02 pm
by BillRunacre
Email me the campaign and I'll have a look. It might not be for another 24 hours though.

bill.runacre@furysoftware.com

Re: Why my popup script does not fire ?

Posted: Mon Dec 08, 2025 8:07 am
by welk
Ok, thanks a lot, I will do that (I will use dropbox because the file is too heavy for my mail : More than 200 mo)

Sounds and music will be joined in the directory of campaign : you will discover "Ancient Battlefield" in prime time ;) (some parameters have nore to be adjusted in details but mod is almost in the final way)

Re: Why my popup script does not fire ?

Posted: Mon Dec 08, 2025 8:37 am
by welk
Links is here : I suppressed the link (no more utility now), mod will soon be finalized

Re: Why my popup script does not fire ?

Posted: Mon Dec 08, 2025 9:46 am
by BillRunacre
I ran the campaign without making any changes, and the POP UP has appeared at the start of the first turn.

Could it be that you had "Messages" disabled in the Options screen within the game?

PS I laughed on seeing the designer's names in the credits! :D

And the battle itself looks marvellous. 8-)

Re: Why my popup script does not fire ?

Posted: Mon Dec 08, 2025 6:05 pm
by welk
You are right :lol: I am the most dummy modder I never seen :mrgreen: : I had unchecked "messages" option in options, all thnigs work perfect now

The battle otself (and following battles) will be improved to be more interessant in terms of tactic/strategy, at this time it's just a quick test battle to verify if all functions work correctly

Re: Why my popup script does not fire ?

Posted: Mon Dec 08, 2025 6:41 pm
by BillRunacre
Excellent, I would have been really confused if it hadn't been that! :D

Sometimes the simplest solutions are the best, for after the frustration, they put a smile on our faces.