View Full Version : Creating a money script
fallen851
02-13-2006, 22:02
Similar to EB, I created a script that gives the AI money because the AI is lacking (to put it nicely).
Now to activate the script in the game, I want to make it so the advisor pops up (it is a show me script) everytime I click on a city or an army. How do I create these triggers?
This unforunately isn't in the guides to scripting.
Thanks for any and all help.
Monkwarrior
02-13-2006, 22:37
Similar to EB, I created a script that gives the AI money because the AI is lacking (to put it nicely).
Now to activate the script in the game, I want to make it so the advisor pops up (it is a show me script) everytime I click on a city or an army. How do I create these triggers?
I don't understand how do you want to launch the script.
Do you want to give money to the AI each time you click on a city?
That would be really annoying for the player, as the advisor would appear lots of times each turn (at least that annoys me:dizzy2: ).
It would be better to have a background script that would check the money of the AI at the beginning (or end) of the turn, and would give money in case the AI resources were very low.
fallen851
02-14-2006, 01:36
"script
declare_counter loop
set_counter loop 0
monitor_event FactionTurnStart Treasury < 10000
and FactionType romans_julii
and not I_LocalFaction romans_julii
console_command add_money romans_julii, 10000
end_moniwhile
I_CompareCounter loop = 0
end_while
end_script"
Ok so there is my script (if there are any problems tell me!), with one of those for each faction. Now I want to create a trigger, so that this script will be activated once and only once after I click on an army or a city (sorry for the confusion, the advisor only appears once, similar to what you outlined above).
So how do I create the trigger in the advice text for this?
Monkwarrior
02-14-2006, 02:05
Now I want to create a trigger, so that this script will be activated once and only once after I click on an army or a city (sorry for the confusion, the advisor only appears once, similar to what you outlined above).
So how do I create the trigger in the advice text for this?
I tried to do the same, but the advisor appeared each time I clicked in each settlement.
In view of that, I used the F1 key to launch the script in the way explained in this thread:
https://forums.totalwar.org/vb/showthread.php?t=59729
Epistolary Richard
02-14-2006, 09:10
You need to use the suspend_unscripted_advice command to prevent it being triggered twice.
The_Mark
02-14-2006, 17:15
You need to use the suspend_unscripted_advice command to prevent it being triggered twice.
Preferably within that last loop, there are some events that cancel the suspend command.
Myrddraal
02-15-2006, 15:18
And you could put
suspend_during_battle on
at the top, so that you don't need to re-launch after each battle...
fallen851
02-15-2006, 19:49
So come someone outline or explain what this trigger should look like, incorporating what was said above?
Thanks.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.