Page 1 of 1

Trying to get territory event to fire

Posted: Tue Jan 02, 2024 12:48 am
by cheverenguerras
Hi everyone, first post here. I'm trying to set up an alternative history scenario and am having trouble getting a territory event to fire in the first turn. It's basically a restoration of the Czech Republic. Here's my code:

;REMOVE1942 - REPLACE WITH ANOTHER IN 1942 & 1943?
;
{
#NAME= Guess who's back!
#POPUP= Czechia's back, call a friend!
#IMAGE=
#SOUND=
#FLAG= 1
#TYPE= 1
#AI= 0
#LEVEL= 0
#GV= 1[1,100]
#LINK= 0[0]
#TRIGGER= 100
#COUNTRY_ID= 45
#RECIPIENT_ID= 30
#REMOVE= 0
#DATE= 1939/09/01
#VARIABLE_CONDITION= 45 [1] [100] [0]
#MAP_POSITION= 101,41
#MAP_POSITION= 101,42
#MAP_POSITION= 102,41
#MAP_POSITION= 102,42
#MAP_POSITION= 102,43
#MAP_POSITION= 103,40
#MAP_POSITION= 103,41
#MAP_POSITION= 103,42
#MAP_POSITION= 103,43
#MAP_POSITION= 104,41
#MAP_POSITION= 104,42
#MAP_POSITION= 104,43
#MAP_POSITION= 105,41
#MAP_POSITION= 105,42
#MAP_POSITION= 105,43
#MAP_POSITION= 106,42
#MAP_POSITION= 106,43
#MAP_POSITION= 107,42
}


Any insight into what the issue is? Thanks in advance!

Re: Trying to get territory event to fire

Posted: Tue Jan 02, 2024 1:56 am
by El_Condoro
Did you create a custom campaign (a save-as of the original) and then update the scripts with your edited one/s? This script looks OK. You might also need to mobilize #COUNTRY_ID= 30, too.

[Edit]: Just ran a test and your script runs as intended. I followed the procedure above (Open original campaign, Save As, , Menu: Campaign, Event Scripts, open territory.txt, insert script, Update, save campaign).

Just noticed it is your first forum post - Welcome!

Re: Trying to get territory event to fire

Posted: Tue Jan 02, 2024 3:17 am
by cheverenguerras
Thank you for your reply! Indeed, I had created a custom campaign and updated the scripts, but it didn't fire. I tried doing it again from scratch (following your procedure), just to see if something I had done on my edited campaign had somehow botched the firing of this event, but it still didn't fire. When you were able to make it work, did you do anything else, like also mobilize #COUNTRY_ID= 30 as well? Or somehow create a capital for the Czech Republic (I've been trying to figure this out, with no success thus far)?

Thanks again!

Re: Trying to get territory event to fire

Posted: Tue Jan 02, 2024 4:44 am
by El_Condoro
Actually, I didn't do anything other than add your script to the end of the territory.txt and update it. No need to mobilize Czechs to make it work. I can't think of why it hasn't fired for you, sorry.

The capital is set by making the first #MAP_POSITION a city (can't be a capital already). So, Prague (103,41) would be the first one. See the look after the first Axis turn here. No other scripts have been used, so there are no units (unit.txt) and the country remains neutral (war_entry.txt).

Re: Trying to get territory event to fire

Posted: Tue Jan 02, 2024 10:16 am
by BillRunacre
Yes, I think changing the first hex to 103,41 should fix it, as otherwise the script is attempting to form a country without a capital (because the first hex was not an urban resource) and this it could not do.

Re: Trying to get territory event to fire

Posted: Tue Jan 02, 2024 11:14 am
by El_Condoro
Hey, that's right. But the script did work before I changed that, so I'm not sure why.

Re: Trying to get territory event to fire

Posted: Tue Jan 02, 2024 5:38 pm
by cheverenguerras
Hi all, thanks for the replies! I finally realized that the script worked, but only after the first turn. I wanted it to fire before play even began. There probably isn't a way to do that, right?

Re: Trying to get territory event to fire

Posted: Tue Jan 02, 2024 10:22 pm
by El_Condoro
In that case, there is no need for a script:
- Change the ownership of the Czech hexes to Czechoslovakia (Hex layer)
- Change Prague from a city to a capital (Resource layer) - Czech flag should appear
- Menu: Campaign\Edit Country Data. Change alignment and mobilization level
- Edit Unit Build Data to add any units you want to place. Cz. doesn't have any HQs by default, so you might want to add them.
- Add the units you want to use on the map.
- To make this event more 'special', I would include a popup with graphic.
- Update scripts (you can delete the territory one above) as the change of hexes and resources will require it.
- Save

Re: Trying to get territory event to fire

Posted: Wed Jan 03, 2024 2:12 am
by cheverenguerras
Ah, that makes a lot of sense, thank you so much!