I_MapName condition: does it work?
I'm trying to implement different scripts depending on the campaign to be played.
I found in docudemon_conditions one that could be useful:
Code:
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):
Code:
;------------------------------------------ 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:
Code:
;------------------------------------------ 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?
Re: I_MapName condition: does it work?
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:
Re: I_MapName condition: does it work?
Quote:
Originally Posted by Myrddraal
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:
Code:
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:
Re: I_MapName condition: does it work?
ooooh that's what I was doing wrong...
Re: I_MapName condition: does it work?
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:
Re: I_MapName condition: does it work?
If it's a mod-foldered mod, it's supposed to be
Code:
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. :)