Trying to get territory event to fire

Post Reply
cheverenguerras
Posts: 4
Joined: Tue Jan 02, 2024 12:35 am

Trying to get territory event to fire

Post 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!
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: Trying to get territory event to fire

Post 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!
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
cheverenguerras
Posts: 4
Joined: Tue Jan 02, 2024 12:35 am

Re: Trying to get territory event to fire

Post 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!
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: Trying to get territory event to fire

Post 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).
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
User avatar
BillRunacre
Posts: 6650
Joined: Mon Jul 22, 2013 2:57 pm
Contact:

Re: Trying to get territory event to fire

Post 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.
Follow us on Twitter: https://twitter.com/FurySoftware

We're also on Facebook! https://www.facebook.com/FurySoftware/
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: Trying to get territory event to fire

Post by El_Condoro »

Hey, that's right. But the script did work before I changed that, so I'm not sure why.
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
cheverenguerras
Posts: 4
Joined: Tue Jan 02, 2024 12:35 am

Re: Trying to get territory event to fire

Post 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?
El_Condoro
Posts: 599
Joined: Sat Aug 03, 2019 4:35 am

Re: Trying to get territory event to fire

Post 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
ORB & CROWN Fantasy Warfare Mod for Strategic Command
Download for War in Europe or World at War - YouTube - Discord
cheverenguerras
Posts: 4
Joined: Tue Jan 02, 2024 12:35 am

Re: Trying to get territory event to fire

Post by cheverenguerras »

Ah, that makes a lot of sense, thank you so much!
Post Reply

Return to “MODS and Scenarios”