Log in

View Full Version : I_MapName condition: does it work?



Monkwarrior
05-13-2006, 09:06
I'm trying to implement different scripts depending on the campaign to be played.
I found in docudemon_conditions one that could be useful:

Identifier: I_MapName
Trigger requirements:
Parameters: map file name
Sample use: not I_MapName world\maps\campaign\sons_of_mars\descr_strat.txt
Description: The qualified file name of the current map relative to the data directory
Battle or Strat: Either
Class: MAP_NAME
Implemented: Yes
Author: Guy

I tried this in this way (export_descr_advice):

;------------------------------------------ ITW Campaign

Trigger ITW_Campaign_Thread_Trigger
WhenToTest SettlementSelected

Condition I_LocalFaction carthage
and I_MapName world\maps\campaign\Hispania_Cartago\descr_strat.txt

AdviceThread ITW_Carthage_Campaign_Thread 0

Result: the advice didn't appear and, or course, the script was not launched.

Then, I tried the negative way:

;------------------------------------------ ITW Campaign

Trigger ITW_Campaign_Thread_Trigger
WhenToTest SettlementSelected

Condition I_LocalFaction carthage
and not I_MapName world\maps\campaign\imperial_campaign\descr_strat.txt

AdviceThread ITW_Carthage_Campaign_Thread 0

Result: the advice appeared in all the campaigns, when carthage faction was selected.
I tried also using the full path (data\world\etc), but the result was the same.

Did anybody use this condition successfully?
Any other method to launch scripts selectively depending on the campaign?

Myrddraal
05-13-2006, 22:42
I believe it is used in the export descr advice file for some of the prologue advice (to make sure it doesn't appear in the normal game). Look there for syntax. :smile:

Monkwarrior
05-14-2006, 09:03
I believe it is used in the export descr advice file for some of the prologue advice (to make sure it doesn't appear in the normal game). Look there for syntax. :smile:
Thanks for the tip, Myrddraal.
You were right and it is used. The correct syntax is:

and I_MapName data/world/maps/campaign/Hispania_Cartago/descr_strat.txt

Notice the two differences with docudemon: the need for "data" in the path and the use of / instead of \.
Now it works in my campaigns.
:2thumbsup:

Epistolary Richard
05-14-2006, 15:24
ooooh that's what I was doing wrong...

Myrddraal
05-15-2006, 01:49
Those little things you take for granted when it might actually be useful to other people... If only all modders had psychic (sp?) links :wink:

HouseOfHam
04-24-2009, 17:04
If it's a mod-foldered mod, it's supposed to be


I_MapName <modfolder>/data/world/maps/campaign/Hispania_Cartago/descr_strat.txt


IMPORTANT: The /data/world/maps/campaign/ must be in all lower-case. It's hard-coded that way in the exe and won't work otherwise. You must put it that way even if the actual path is DaTa/WoRlD/MaPs/CamPAign/

ps: Sorry for topping this ancient thread. :)