no longer interested in participating
no longer interested in participating
Last edited by RubiconDecision; November 13, 2011 at 04:09 PM.
Scripted events in the campaign script:
It all depends how the script is written. And it is not that someone makes use of it - it gets given (forcefully most of the time) to whoever has been specified. When it comes to yes\no events the AI can get a random change for the event to fire as 'yes'.
Money script for the AI:
Welcome to the search for the holy grail of scripting. To put it bluntly - you could give the AI 30.000 a round and he would still go bankrupt, the balancing is extremely difficult.
Effects for ancillaries:
There is a limited number of effects that can be used, unfortunately the explanation for my list is in German, but you might be able to use as a guideline.
Code:LineOfSight Sichtlinie (erhöht den Feinderkennungsradius) LocalPopularity Beliebtheit (verbessert die öffentliche Ordnung) Looting % Bonus auf Beutegeld Loyalty Loyalität Magic Magie (Hexe) Mining % Bonus auf Minenerträge MovementPoints Bewegungspunkte (reduziert die Entfernung, die Armeen marschieren können) 1= 5% NavalCommand Kommando auf See (Admiral) PersonalSecurity persönliche Sicherheit (erhöht die Wahrscheinlichkeit, einen Anschlag frühzeitig zu bemerken und zu vereiteln) Piety Frömmigkeit PublicSecurity öffentliche Sicherheit (erhöht die Wahrscheinlichkeit, feindliche Agenten zu entdecken und zu ergreifen) Purity Reinheit (Priest) Sabotage Sabotage (Attentaeter) SiegeAttack Kommando beim Angriff von Mauern SiegeDefence Kommando bei der Verteidigung von Mauern SiegeEngineering Baupunkte (erforderlich für den Bau von Belagerungsausrüstung)50=50 Punkte Squalor Verschmutzung (erhöht öffentliche Ordnung und Bevölkerungswachstum) Subterfuge Agententalent (Spion\Spion) TaxCollection % Bonus auf Steuereinnahmen Trading % Bonus auf alle Handelserträge TrainingAgents % Nachlass auf Kosten der Agentenausbildung 1=5% TrainingUnits % Nachlass auf Kosten der Einheitenausbildung 1=5% TroopMorale Kampfgeist für alle Truppen auf dem Schlachtfeld Unorthodoxy Unorthodoxheit (Priest) Unrest Unruhe (hat negative Auswirkungen auf die öffentliche Ordnung) Violence Gewalt (??)
Then you make the script 30 times bigger (assuming 30 factions) so it can cause problems for your AI... Your AI really needs more problems?
Plus technically that would make it an 'AI money script', but in reverse since it tries to bankrupt the AI. I would have thought perhaps that would make it seem even worse to you.
Yes, Repman wrote a script for inflation which multiplies the effects of the costs scripts depending on the faction's treasury level.
Last edited by Taiji; January 26, 2011 at 03:21 PM.
RubiconDecision, interesting idea
If I understand correctly then you'll have to do it in campaign_script.txt because you can't use script commands in EDCT or EDA.
For unique ancillaries this would do:
monitor_event FactionTurnEnd FactionIsLocal
and FactionwideAncillaryExists blah
add_money -500
end_monitor
Or for non-unique this:
monitor_event CharacterTurnEnd CharacterIsLocal
and AgentType family
and HasAncType blah
add_money -500
end_monitor
You might want to track these extra costs for the player though, money cheats aren't registered on the financial scroll. Probably best to use traits to track and represent it, or you can use popup events tied to a gui function. Hah or even just list the cost in the description for the ancillary, got a bit ahead of myself there...![]()
Last edited by Taiji; January 26, 2011 at 12:32 PM.
If you're determined to do it then you could do it like this:
monitor_event CharacterTurnEnd HasAncType academic_advisor
add_money -50
end_monitor
BTW it's no surprise that settlement mechanics strongly affects a settlement's financial output.
Last edited by Taiji; January 26, 2011 at 04:54 PM.
The problem with the AI always going bankrupt is upkeep. The AI has no concept of upkeep to begin with and adding a script to increase upkeep will just make the problem worse. Best results would be to add in a check for human player and adjust upkeep there, for AI simply a single cost or free would be best.
Yes it works that way.
Pleasure
Q: could we use:
monitor_event CharacterTurnEnd HasAncType academic_advisor
if CharFactionType england
add_money england -50
end_if
if CharFactionType france
add_money france 100
end_if
end_monitor
can we even test to see if a char is part of a faction that is AI controlled?
monitor_event CharacterTurnEnd HasAncType academic_advisor
and CharFactionType england
and IsFactionAIControlled
add_money england -50
end_monitor
Cheers Gig - opens up some interesting possibilities.
It wouldn't work the way you have scripted it, Rozanov. Exports are not available in if statements. You need to find other 'I_' conditions, or make separate scripts.
Last edited by Taiji; February 27, 2011 at 10:44 AM.
Thanks for pointing that out Taiji.
(my understanding of exporting things in this context is minimal - and that's probably an overstatement)
so these would work?
monitor_event CharacterTurnEnd HasAncType academic_advisor
CharFactionType england
add_money england -50
end_monitor
plus
monitor_event CharacterTurnEnd HasAncType academic_advisor
CharFactionType france
add_money france 50
end_monitor
---------------------------
monitor_event CharacterTurnEnd HasAncType academic_advisor
and I_IsFactionAIControlled england
and CharFactionType england
add_money england -50
end_monitor
---------------------------------------
Has anyone done a simple guide to how "exports" things works in coding?
And how to know when to use:
and I_IsFactionAIControlled england
and when to use
and IsFactionAIControlled england
for example?
I just did, there's nothing more to it.
In bold is the entire simple guide. You can use 'I_' conditions anywhere but you have to use them in if statements, it's really that simple.
If you are testing your ideas before asking questions then you can have the joy (plus other benefits) of discovering this stuff for yourself. The error message will tell you that the condition does not have the export it needs, it's obvious from there.
BTW it's going to be a lot faster to test the script and read the log, rather than post here and wait for a response. And especially when that response comes from someone who doesn't know and is also not bothering to test, as so often happens.
Last edited by Taiji; February 28, 2011 at 04:31 AM.
Well yes, but I was talking more generally. The main point being that asking questions here is often an obstacle to learning when testing is so quick and easy to do (put script in campaign_script, see script failed to load, check log, learn lesson.). Also personally I am far more likely to retain the important information if I test things. And of course information retained allows for better planning, creates opportunity for good ideas, etc.
I didn't mean to passive-aggressively single you out, Gigantus. Apologees if it came across that way. I think we're all inclined to offer our best guess, and you did show you were guessing by putting 'should', so you can't be blamed for anything IMO.
Last edited by Taiji; February 28, 2011 at 04:33 AM.
No offense taken, no apologies necessary.And you hit the nail on the head - testing and learning from the log is the way to go (that's how I got into it about a year ago). And taking some time to look through the docu demons gives some ideas as well. Not to forget the tutorials here.
Interesting points Taiji, although as someone who can spend an entire evening trying to get something very simple to work, the idea it it easier and quicker to put in a script and test isn't always true.
Although I have learned things through that method, questions such as the difference between I_ statements and others isn't likely to emerge quickly from trial and error.
(And the docudemon entries are identical for I_IsFactionAIControlled and IsFactionAIControlled)
Whereas a simple heuristic: use I_ statement if inside an if / end_if condition loop is one I (and anyone else reading this) can grasp.
Thank you though for explaining it simply, it is sometimes what people need.