Does anyone have a short code snipet that demonstrates a basic field army rebellion that occurs based upon the settlement order level?
Cheers
Does anyone have a short code snipet that demonstrates a basic field army rebellion that occurs based upon the settlement order level?
Cheers
Are you asking for a command to force a unit to rebel? Because I've looked in all of the command areas and through all of the console commands before and haven't found anything which seems to indicate it can make a unit rebel. There's the "provoke_rebellion" command but that seems to only work for settlements. And of course there's the workaround of killing the units and re-spawning them, though I can't say I've tried this before, there do seem to be commands which can query the units for this sort of thing.
Or do you mean just a script for increasing the chance of a field army rebelling and not literally forcing it?
Cheers.,
Augustus
House of Ward ~ Patron of Eothese, Mythic_Commodore, Wundai, & Saint Nicholas
Sorry I should of made my request clearer.
I'm actually talking about the rebel faction. I want to spawn a rebel army, in a region with a low level of order.
Cheers
Ah, well there's a few ways to do that, I haven't made any scripts for it so I'm running on my index and such, but it seems like this one is the best:
So then something like:Code:Identifier: SettlementLoyaltyLevel Trigger requirements: settlement Parameters: logic token, value (loyalty_revolting, loyalty_rioting, loyalty_disillusioned, loyalty_content, loyalty_happy) Sample use: SettlementLoyaltyLevel > loyalty_rioting Description: How loyal is the settlement? Battle or Strat: Either Class: SETTLEMENT_LOYALTY_LEVEL Implemented: Yes Author: Guy
monitor_event SettlementTurnEnd SettlementLoyaltyLevel <= loyalty_rioting
and IsRegionOneOf London_Province
and RegionIsLocal
and FactionType Parliamentarians
and I_EventCounter time_since_rebellion = 0
set_event_counter rebellion 1
if I_EventCounter rebellion = 1
spawn_army
faction slave
character Guy McGuyguy, named character, age 24, x 0, y 0
traits SuperAwesomeCool 1
unit etc. etc. etc. for army information
set_event_counter time_since_rebellion 10
end_if
monitor_event FactionTurnEnd FactionIsLocal
and I_EventCounter time_since_rebellion >= 1
inc_event_counter time_since_rebellion -1
end_monitor
----------------------------------------------
Something like that would work. Obviously you'd want to do it per province, this increases your control over the army which is spawned and where. You can also use successive rebellions with the if statements, and mess with the time_since_rebellion counter, which is essentially there to prevent it from rebelling every subsequent turn. The best method would have a counter for each region as well, so that you can have rebellions spaced 10 turns per province but not impossible in separate regions. Oh and the character info and x y are obviously just placeholders.
Is that what you were looking for?
Cheers,
Augustus
Last edited by Augustus Lucifer; September 25, 2008 at 01:53 AM.
House of Ward ~ Patron of Eothese, Mythic_Commodore, Wundai, & Saint Nicholas
In my Recruitment limitations script i have a section that spawns a few rebel units if a settlement has over drafted. (drafting is another part of the script). basically what it does is spawns a rebel army in the province based on a random number which is determined dependant on how often the player has drafted. Honestly ity is a constant work in progress as i am always updating it... but i think the general idea behind it may be what your looking for... this is just a snipet form the script...
Spoiler Alert, click show to read:
You could use a condition that simply tracks settlement order. somthing like,
Then base the spawn off of that. Using a percentage or however else you intend to spawn the army...Code:and SettlementLoyaltyLevel <= loyalty_disillusioned
Hope that was useful...
...longbows, in skilled hands, could reach further than trebuchets...
looks like i was beaten to it![]()
...longbows, in skilled hands, could reach further than trebuchets...
That's an interesting script though nonetheless. I imagine the rest of it checks for unit recruitment to increase the draft counter and such within a certain timeframe. Just out of curiosity, how is the RandomPercent condition working for you? Randomness is the ultimate equalizer, but it of course also means things are harder to test. Does the condition alone work and the condition produces a random number 1-100, or is it a command? Because I only was aware of the random number and random counter commands, unless the percent is a console command or is dictated through the condition.
Cheers,
Augustus
House of Ward ~ Patron of Eothese, Mythic_Commodore, Wundai, & Saint Nicholas
Yeah the general idea of the entire script is to limit recruitment based on population levels, reducing population in a settlement when you recruit and increasing it when you disband. there are a few factors i have thrown in, migration, draft etc. All adding to the script. The part above is tied directly to the draft script, if a player drafts too often then there is an increasing chance with each draft that the population in a given settlement will cease all unit recruiotment and a small rebel army will spawn, only peasants. And the settlement loses a small amount of population as well...
The RandomPercent seems to work fine for this situation, but i have found that depending on the situation you might be better off using the generate random number, which is alot more controlled. I use that in the garrison script for SS6 to determine the average capability of a given AI settlement at any time. I originally used the random percent for that, but it wasnt efficient enough.
If you mean how did i arrive at the random value, the script just checks for certain conditions and i manually chose the percentages that eventually take effect. as in 1 draft there is only 5% chance, 2 - 15% and 3 or more 35%. Conditions in other monitors determine which percentage has a chance of firing true
...longbows, in skilled hands, could reach further than trebuchets...
Ah, makes sense. I was actually reading the percent file as backwards. Rather than considering it a random chance over 65%, I somehow had it in my head it was rolling a number randomly which, if over 65/100 would come back as true. Makes more sense the way you explained it.
Cheers,
Augustus
House of Ward ~ Patron of Eothese, Mythic_Commodore, Wundai, & Saint Nicholas
Thanks a lot gentlemen. I'll have a crack at implementing this over the weekend.
Tsarsies,
The recruitment limitation script sounds pretty damn interesting. I also have a system of conscription implemented through a building, I wonder if you would be interested in helping to link your scripting system into For King or Country?
Cheers
I heard provoke_rebellion does not work to well maybe this where referenced by TheGrnEyedDvl or Alpaca.
Well, provoke_rebellion only works on a city, and only can give the city to the Slave faction. This is why it can be considered to not work very well, since it would be nice if it could give the city to another faction or even a shadow faction, but it can't seemingly. So it does work as CA intended, just not in place of another command they failed to provide us with for changing hands of cities.
Cheers,
Augustus
House of Ward ~ Patron of Eothese, Mythic_Commodore, Wundai, & Saint Nicholas
@AlphaDelta
I'd be happy to help out, just message me with any details and i'll do what i can![]()
...longbows, in skilled hands, could reach further than trebuchets...