How can I refer to agent level in scripting?
if Attribute subterfuge = 6
'Subterfuge' doesn't work so what do I call it instead?
How can I refer to agent level in scripting?
if Attribute subterfuge = 6
'Subterfuge' doesn't work so what do I call it instead?
Entry from the docudemons:
As you can see in the excerpt, Attribute requires a character record to be exported by the current event and is not an independent condition. (A condition that begins with an I_ prefix, generally.) Only independent conditions can be used in if statements. This is the correct usage:---------------------------------------------------
Identifier: Attribute
Trigger requirements: character_record
Parameters: attribute description, logic token, level
Sample use: Attribute Management >= 2
Description: Test a character's attributes or hidden attributes
Battle or Strat: Either
Class: CHARACTER_ATTRIBUTE_TEST
Implemented: Yes
Author: Lee
---------------------------------------------------
Code:monitor_event CharacterTurnEnd AgentType spy and Attribute Subterfuge = 6 ;do something here end_monitor
Dominion of the Sword, a Medieval II: Total War Supermod
Under the patronage of Archaon. Proud member of the House of Siblesz
My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!
Thankyou very much that was very informative+rep
edit:
Would something like this work?
I want it to check the agent level and mission difficulty when a spy has a successful mission against a specific faction. This is so that I can have increased gains for more dangerous missions.Code:monitor_event CharacterTurnEnd AgentType spy FactionIsLocal and SpyMission and TargetFactionType england and Attribute Subterfuge = 6 and ProbabilitySuccess < 5 inc_counter england_points 5 end_monitor
I get the feeling there is a lot I am missing about this scripting stuff and I know of no tutorials or guides. If you could show me how you would implement this idea I would be very grateful.
Last edited by Taiji; August 18, 2009 at 11:44 AM.
No problem Taiji. I like to help new scripters.
Your code has a few errors in it. Firstly, you forgot to put an "and" before the FactionIsLocal condition. Only one condition can go on the first line. The rest must come on sucessive lines with "and" in front of them. (You probably already knew that. I'm guessing this was just a typo.)
Also, don't forget to declare counters before you use them. You can sometimes get away with using event counters (as opposed to normal counters) without declaring them, but it is still best to declare them in descr_events.txt just in case.
You also seem to be using the wrong event for your situation. You don't want to test this monitor each time the turn ends, only when a spy has a successful mission. A better event to use would be MissionFinished. To ensure that the mission was a success, you would also have to use the condition MissionSuccessLevel.
TargetFactionType is also incorrect. TargetFaction conditions apply to the faction that is at the receiving end of the event, but a faction cannot "receive" a CharacterEndTurn event. A good example of a receivable event would be CitySacked, in which one faction does the sacking and one is target of the sacking. The faction doing the sacking would be represented by FactionType and the fation that is the victim of the sacking would be represented by TargetFactionType. You can also use TargotFactionType with the MissionFinished event since every mission is performed by one faction and directed at another.
Like TargetFactionType, ProbabilitySuccess soesn't owkr with CharacterTurnEnd, but it does work with MissionFinished.
Cleaned up code:
There are a couple of good places to learn the basics of scripting. I would start with alpaca's Script-O-Rama. You should also download a copy of the Kingdoms Docudemons, which is the CA released index of all scripting commands, events, and conditions. there is also a Scripting class in progress in the TWC University forums. They're already a few weeks into the course, but they would probably let you start anyway. There isn't too much material about more advanced scripting, though. I think the best way to learn is to read through some of the specialized tutorial threads out there, scan through the codes for some mods, and also to experiment for yourself. I learned most of what I know through experimenting and discovered a couple of scripting tricks that were completely new to the TWC community in the process.Code:declare_counter england_points monitor_event MissionFinished AgentType spy and MissionSuccessLevel > slightly_successful and FactionIsLocal and SpyMission and TargetFactionType england and Attribute Subterfuge = 6 and ProbabilitySuccess < 5 inc_counter england_points 5 end_monitor
Last edited by Azim; August 18, 2009 at 03:21 PM.
Dominion of the Sword, a Medieval II: Total War Supermod
Under the patronage of Archaon. Proud member of the House of Siblesz
My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!
Azim, you've helped me a great deal there, thankyou very much.
I know virtually nothing about what I am doing and so your example and advice is very valuable and very much appreciated.
I'll look into the info you've suggested and think some more on this, thanks again!![]()
So it goes 1 - 5 instead of 1 - 10? Interesting, it must round odds up to evens then I suppose. Thanks for that, Mork![]()
Oh I see what you mean, in the script it's just checking the level of the agent it's not adding anything. But thanks anyway
edit:
If anyone is interested, I've had more awesome advice and the state of the monitor/script is now:
As you can see it awards more 'england_points' for higher level spies on more dangerous missions... I'm very happyCode:monitor_event MissionFinished AgentType spy and FactionIsLocal and SpyMission and TargetFactionType england and MissionSuccessLevel > partly_successful if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 4 and ProbabilitySuccess =< 15 and ProbabilitySuccess > 5 inc_counter england_points 1 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 4 and ProbabilitySuccess =< 5 inc_counter england_points 2 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 5 and ProbabilitySuccess =< 15 and ProbabilitySuccess > 5 inc_counter england_points 1 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 5 and ProbabilitySuccess =< 5 inc_counter england_points 2 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 6 and ProbabilitySuccess =< 25 and ProbabilitySuccess > 15 inc_counter england_points 1 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 6 and ProbabilitySuccess =< 15 and ProbabilitySuccess > 5 inc_counter england_points 2 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 6 and ProbabilitySuccess =< 5 inc_counter england_points 3 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 7 and ProbabilitySuccess =< 25 and ProbabilitySuccess > 15 inc_counter england_points 1 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 7 and ProbabilitySuccess =< 15 and ProbabilitySuccess > 5 inc_counter england_points 2 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 7 and ProbabilitySuccess =< 5 inc_counter england_points 3 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 8 and ProbabilitySuccess =< 30 and ProbabilitySuccess > 20 inc_counter england_points 1 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 8 and ProbabilitySuccess =< 20 and ProbabilitySuccess > 10 inc_counter england_points 2 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 8 and ProbabilitySuccess =< 10 and ProbabilitySuccess > 5 inc_counter england_points 3 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 8 and ProbabilitySuccess =< 5 inc_counter england_points 4 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 9 and ProbabilitySuccess =< 30 and ProbabilitySuccess > 20 inc_counter england_points 1 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 9 and ProbabilitySuccess =< 20 and ProbabilitySuccess > 10 inc_counter england_points 2 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 9 and ProbabilitySuccess =< 10 and ProbabilitySuccess > 5 inc_counter england_points 3 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 9 and ProbabilitySuccess =< 5 inc_counter england_points 4 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 10 and ProbabilitySuccess =< 35 and ProbabilitySuccess > 25 inc_counter england_points 1 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 10 and ProbabilitySuccess =< 25 and ProbabilitySuccess > 15 inc_counter england_points 2 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 10 and ProbabilitySuccess =< 15 and ProbabilitySuccess > 10 inc_counter england_points 3 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 10 and ProbabilitySuccess =< 10 and ProbabilitySuccess > 5 inc_counter england_points 4 end_if if I_EventCounter research_accepted = 1 and Attribute Subterfuge = 10 and ProbabilitySuccess =< 5 inc_counter england_points 5 end_if end_monitor
It's part of a system to make researching another faction's units possible... but it seems a nice way to trigger a new trait line for spys succesful on dangerous missions perhaps...![]()
Last edited by Taiji; August 19, 2009 at 10:42 AM.
I would simplify the script just to see that it works, and if so, continually add the subsequent If segments one by one.
Good luck with the interesting script!
Thankyou Mr SignifierOne sir! (to whom I owe my easy entry into the wonderful world of animation tweaking, and for which I still have very much gratitude)
I do tend to get carried away once I think I see what needs doing, but you are right and I should test small chunks first!
It certainly doesn't cause any error in launching a campaign but I need to establish that it is working properly.
You're right and I will do as you suggest, thankyou
edit: Through testing I discover that it doesn't work... I will try a load of stuff
edit:
I did try a load of stuff and found that I get stuck here:
That works but I cannot see a way to put an 'if' statement in there. Every line down to 'and ProbabilitySuccess > 5' will not accept another event being between it and SpyMission. Conditions only. I think I tried an if statement a couple of times on these conditions to no avail... I'll try again to make sure...Code:monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge = 2 and ProbabilitySuccess =< 95 and ProbabilitySuccess > 5 inc_counter england_points 4 end_monitor
Last edited by Taiji; August 19, 2009 at 08:17 PM.
You can't run any of those in if statements, but I'd consider ways to reduce the need to specify faction or subterfuge level. If you did it for every target and every subterfuge and furthermore a large # of success probabilities, it would be a massive script for a relatively minor purpose I'd say.
What are the points intended to do exactly?
House of Ward ~ Patron of Eothese, Mythic_Commodore, Wundai, & Saint Nicholas
OK, this is part of a script that provides the player with a method of researching another faction's technology (units). So I have a counter per faction and different ways to raise points. Eventually the counters fire an event which is used to enable production of new units.
This part is a chunk of the espionage side of things. I want increasingly hard spy missions to give increasingly great rewards. So it has to track agent level, diffculty and faction.
Agent level needs tracking from 4 onwards and I'm happy with chunks like 4-5, 6-7, 8-9, 10. Added to that 'difficulty' needs tracking, to enable a greater spread of reward for higher level agents on more difficult missions. So where I may be happy with 2 difficulty leves at level 4-5, I want 5 at level 10. Or roughly '4-5(2), 6-7(3), 8-9(4) and 10(5)' where the number in brackets denotes spread of difficulty.
It then needs duplicating for each of the 30 factions. Maybe my maths is off but that looks like 420 monitors if I can't find a better way to organise things. I hear event monitors don't impact performance like condition monitors but I'm concerned with this many. Will it actually be a problem?
But if it's just a problem of increased work for me... I don't mind
edit:
I can do something less detailed like 4-6(1), 7-9(2) and 10(3), I suppose (180 monitors...). I could also reduce the amount of factions for which research will be available... but that would be sad
edit:
Another thing I could do with some help on is this:
It's supposed to give points for being at war with england but instead it just gives points regardless. Plus it does the same dumb thing when an alliance should be the trigger. It's as if the line 'and DiplomaticStanceFromFaction england atwar' is ignored and I can't see why.Code:monitor_event PreFactionTurnStart FactionIsLocal and DiplomaticStanceFromFaction england atwar inc_counter england_points 1 end_monitor
Perhaps it was silly but I tried that way round also, to no avail - it still gives points and apparently ignores the diplomatic stance.Code:monitor_event PreFactionTurnStart DiplomaticStanceFromFaction england atwar and FactionIsLocal inc_counter england_points 1 end_monitor
PS. this part of the script should (eventually) also vary the amount of points based on another factor: factionstanding. Ideally the player wants an alliance and good relations with the target of their research, a gameplay factor which is then offset by a desire to carry out spy missions that get you into trouble with the faction. This then leads to war being the next logical research step.
Then in war we can have some different mechanics, killing generals with different levels of 'important documents' ancillaries to yeild different research gains. Fighting enemies in the players own land yielding better results. Winning the battle helps of course. Executing prisoners implies a willingness to torture in order to extract more research points... etc. etc.
I can see it's feasible to drop the whole spying side of things or simplify it to great degree, there is still much left that is able to provide the general mechanics I want.
Last edited by Taiji; August 20, 2009 at 08:16 AM.
How are you checking the points in that last bit? log_counter? It might be an error in your logging code that is causing the strange output.
Dominion of the Sword, a Medieval II: Total War Supermod
Under the patronage of Archaon. Proud member of the House of Siblesz
My friend died from chain letters. If you don't post this again 100 times, he will come and kill you in your sleep!
I'm not sure I understand the question but I see lines in my log like this:
13:16:18.468 [game.script.exec] [trace] exec <inc_counter> at line 54386 in mods/DLV_ext/data/world/maps/campaign/imperial_campaign/campaign_script.txt
13:16:18.468 [game.script.counter] [trace] counter <england_points> = 1
And that tells me what's giving me the points.
edit:
I would be happy to use this if the amount of monitors is not likely to be a problem (bearing in mind it's this x30 with all factions included).
Can someone give me an indication of how many event_monitors I can comfortably get away with using?Code:monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 4 and Attribute Subterfuge < 6 and ProbabilitySuccess =< 40 and ProbabilitySuccess > 20 inc_counter england_points 1 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 4 and Attribute Subterfuge < 6 and ProbabilitySuccess =< 20 inc_counter england_points 2 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 6 and Attribute Subterfuge < 8 and ProbabilitySuccess =< 40 and ProbabilitySuccess > 20 inc_counter england_points 1 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 6 and Attribute Subterfuge < 8 and ProbabilitySuccess =< 20 and ProbabilitySuccess > 10 inc_counter england_points 2 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 6 and Attribute Subterfuge < 8 and ProbabilitySuccess =< 10 inc_counter england_points 3 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 8 and Attribute Subterfuge < 10 and ProbabilitySuccess =< 40 and ProbabilitySuccess > 25 inc_counter england_points 1 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 8 and Attribute Subterfuge < 10 and ProbabilitySuccess =< 25 and ProbabilitySuccess > 10 inc_counter england_points 2 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 8 and Attribute Subterfuge < 10 and ProbabilitySuccess =< 20 and ProbabilitySuccess > 15 inc_counter england_points 3 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 8 and Attribute Subterfuge < 10 and ProbabilitySuccess =< 5 inc_counter england_points 4 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge = 10 and ProbabilitySuccess =< 40 and ProbabilitySuccess > 30 inc_counter england_points 1 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge = 10 and ProbabilitySuccess =< 30 and ProbabilitySuccess > 20 inc_counter england_points 2 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge = 10 and ProbabilitySuccess =< 20 and ProbabilitySuccess > 10 inc_counter england_points 3 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge = 10 and ProbabilitySuccess =< 10 and ProbabilitySuccess > 5 inc_counter england_points 4 end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded and Attribute Subterfuge => 10 and ProbabilitySuccess < 5 inc_counter england_points 5 end_monitor
Like "you can use X amount of this kind of monitor without performance problems beyond a delay when a player's spy mission takes place".
If a delay is the only problem then it's not one I care about. But if there are end-turn-time increase issues or a reduction in framerate on the strat map, then I have to pay attention.
edit:
Nope that doesn't even work.
and ProbabilitySuccess =< 10
That line isn't happy with =< which is not a problem.
The problem is that this line:
and Attribute Subterfuge < 10
Will only accept '= n' and won't be happy with '<' or '>'
So not only am I possibly unable to add things I want but the thing is getting bigger anyway!(420 is now 690!!!)
edit:
OK, so new tack (which spawns new questions...).
I decide to vary not on agent level, etc. it was a nice idea, but to much code to check through to be as fun as 'my first scripting adventure' should be
In that bit of code I'm trying to specify that the spy should gain points by spying on a settlement with a certain building.Code:monitor_event SpyMission FactionIsLocal and TargetFactionType england and SettlementBuildingExists barracks and FactionBuildingExists military_academy inc_counter england_points 1 end_monitor
I see that SpyMission exports a settlement and I wonder whether that means I do not need to specify one in order for SettlementBuildingExists to work.
And then FactionBuildingExists should refer to the spy's faction but not the target.
Is it just wishful scripting?
Last edited by Taiji; August 20, 2009 at 05:01 PM.
Code:declare_counter local_military_academy monitor_event FactionTurnStart FactionIsLocal and FactionBuildingExists >= military_academy and I_CompareCounter local_military_academy = 0 set_counter local_military_academy 1 end_monitor monitor_event FactionTurnStart FactionIsLocal and not FactionBuildingExists >= military_academy and I_CompareCounter local_military_academy = 1 set_counter local_military_academy 0 end_monitor monitor_event SpyMission FactionIsLocal and MissionSuccessLevel >= slightly_successful and SettlementBuildingExists >= town_watch and I_CompareCounter local_military_academy = 1 and TargetFactionType england inc_counter england_points 1 end_monitor monitor_event CharacterTurnEnd EndedInSettlement and SettlementBuildingExists >= town_watch and I_CompareCounter local_military_academy = 1 and AgentType = spy and CharacterIsLocal and InEnemyLands inc_counter england_points 1 end_monitor
Very interesting and helpful TNZ!+Rep
I particularly like this
Where you are giving points for remaining in the settlement with the correct building, that's awesome. I'd need some way to stop a player from stacking spys in a settlement though, it would unbalance my mechanics...Code:monitor_event CharacterTurnEnd EndedInSettlement and SettlementBuildingExists >= town_watch and I_CompareCounter local_military_academy = 1 and AgentType = spy and CharacterIsLocal and InEnemyLands inc_counter england_points 1 end_monitor
But anyway, thankyou! Very useful input!
edit:
For anyone that's interested in what happens with the if statement:
I tried this to see if i_comparecounter might work where i_eventcounter failed:
But it said this:Code:monitor_event PreFactionTurnStart FactionIsLocal if I_EventCounter research_accepted = 1 set_counter research 1 end_if end_monitor monitor_event SpyMission FactionIsLocal and TargetFactionType england and MissionSucceeded if I_CompareCounter research = 1 and Attribute Subterfuge = 2 and ProbabilitySuccess < 99 inc_counter england_points 5 end_if end_monitor
16:27:52.906 [game.script] [error] Script execution error for <if>, at line 54384, in mods/DLV_ext/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
<character_record> is unavailable from event <>
when testing <Attribute> condition
So i_comparecounter makes no difference, same issue as i_eventcounter, with no report provided for attribute to work with....
(the script works without the if statement and counter where it is, I can stick the counter before the inc_counter line no probs but with lost functionality)
edit:
I really hope someone can give me an idea of how many event_monitors I can get away with without causing problems!
I might get carried away and set up 500 event_monitors, which would be a complete waste of time if someone knows it will fail... on the other hand it would be useful to find out if noone knows.
edit:
Also I would like to know why people are suggesting I use 'and MissionSuccessLevel >= slightly_successful' when 'and MissionSucceeded' works... I wonder what I am missing here.
edit:
I've had a chance to test TNZ's script now and it works very well - thanks again!
edit:
This is where I'm up to at the moment..
Balancing the exact values, etc. still needs doing but thisCode:;enabling spying bonuses accrued through building a mil acadamey monitor_event FactionTurnStart FactionIsLocal and I_EventCounter research_accepted = 1 and FactionBuildingExists >= town_watch and I_CompareCounter local_military_academy = 0 set_counter local_military_academy 1 end_monitor monitor_event FactionTurnStart FactionIsLocal and I_EventCounter research_accepted = 1 and not FactionBuildingExists >= town_watch and I_CompareCounter local_military_academy = 1 set_counter local_military_academy 0 end_monitor ;enabling spying bonuses accrued through building a thieves_guild monitor_event FactionTurnStart FactionIsLocal and I_EventCounter research_accepted = 1 and FactionBuildingExists >= thieves_guild and I_CompareCounter local_thieves = 1 set_counter local_thieves 1 end_monitor monitor_event FactionTurnStart FactionIsLocal and I_EventCounter research_accepted = 1 and not FactionBuildingExists >= thieves_guild and I_CompareCounter local_thieves = 0 set_counter local_thieves 0 end_monitor ;spy mission to enter a settlement with the correct building or better monitor_event SpyMission FactionIsLocal and I_EventCounter research_accepted = 1 and MissionSucceeded and SettlementBuildingExists >= mustering_hall and TargetFactionType england if I_CompareCounter local_thieves = 1 inc_counter england_points 4 end_if if I_CompareCounter local_thieves = 0 inc_counter england_points 2 end_if end_monitor ;spying on a settlement with correct building - DOES NOT WORK needs target faction monitor_event CharacterTurnEnd EndedInSettlement and I_EventCounter research_accepted = 1 and SettlementBuildingExists >= town_watch and AgentType = spy and CharacterIsLocal and InEnemyLands if I_CompareCounter local_thieves = 1 inc_counter england_points 2 end_if if I_CompareCounter local_thieves = 0 inc_counter england_points 1 end_if end_monitor ;capturing a settlement of with correct building or better monitor_event GeneralCaptureSettlement FactionIsLocal and I_EventCounter research_accepted = 1 and TargetFactionType england and SettlementBuildingExists >= town_watch if I_CompareCounter local_military_academy = 1 inc_counter england_points 15 end_if if I_CompareCounter local_military_academy = 0 inc_counter england_points 10 end_if end_monitor ;attacking an AI general monitor_event GeneralAssaultsGeneral FactionIsLocal and I_EventCounter research_accepted = 1 and TargetFactionType england and MissionSucceeded if I_CompareCounter local_military_academy = 1 inc_counter england_points 5 end_if if I_CompareCounter local_military_academy = 0 inc_counter england_points 2 end_if end_monitor ;making a trade agreement monitor_event FactionTradeAgreementMade FactionIsLocal and I_EventCounter research_accepted = 1 and TargetFactionType england if I_CompareCounter local_thieves = 1 inc_counter england_points 3 end_if if I_CompareCounter local_thieves = 0 inc_counter england_points 1 end_if inc_counter england_points 3 end_monitor ;initial declaration of an alliance monitor_event FactionAllianceDeclared FactionIsLocal and I_EventCounter research_accepted = 1 and TargetFactionType england inc_counter england_points 10 end_monitor ;breaking the alliance more than nullifying the making monitor_event FactionBreakAlliance FactionIsLocal and I_EventCounter research_accepted = 1 and TargetFactionType england inc_counter england_points -15 end_monitor ;an alliance with good standing monitor_event FactionTurnStart FactionIsLocal and I_EventCounter research_accepted = 1 and DiplomaticStanceFromFaction england > AtWar and FactionStanding > -0.9 inc_counter england_points 1 end_monitor ;firing the events needed for recruitment of researched units in the EDB monitor_event PreFactionTurnStart FactionIsLocal and I_EventCounter research_accepted = 1 if I_CompareCounter england_points >= 3 and I_EventCounter england_level_1 = 0 historic_event england_level_1 end_if if I_CompareCounter england_points >= 200 and I_EventCounter england_level_2 = 0 historic_event england_level_2 end_if end_monitor
script, that TNZ has suggested (and that I really like), requires a way to specify the owner of the settlement. I can't be giving england_points for doing it in a french settlement, for example.;spying on a settlement with correct building - DOES NOT WORK needs target faction
Nothing I have tried has worked, any ideas?
Oh, and is it a known fact that reports, target factions, etc. can't be moved through IF statements in general or is it just a special case I'm experiencing?
Last edited by Taiji; August 21, 2009 at 05:31 PM.
Taiji: I don’t believe there is a limit to the number of event_monitors you can use. I think it’s more how many event_monitors you can use before it starts to effect the game’s performance.![]()
Yes! That's exactly what I'm asking; how many can I have before it affects performance?
I do wonder if it's even possible to get a definite answer on that, since which events are being monitored and which conditions checked probably affects the performance impact. But if anyone has ever had a performance problem due to using a large amount of event monitors it might help me to know about it...
I like the idea about having the building but I can't see how to get it working.
I'd need to force the AI to build it, destroy it when another faction takes the settlement, etc.
I'd need some new building trees/lines in EDB and I'm not sure there is space. EDB is still largely a mystery
But I like the idea, thanks TNZ![]()
Last edited by Taiji; August 22, 2009 at 08:43 AM.
Taiji: if all English settlements had a building unique to their faction, you could just do this:
Code:monitor_event CharacterTurnEnd EndedInSettlement and SettlementBuildingExists >= uniquely_english and SettlementBuildingExists >= town_watch and I_CompareCounter local_military_academy = 1 and AgentType = spy and CharacterIsLocal and InEnemyLands inc_counter england_points 1 end_monitor