Is it possible to grant + experience for troops or randon retinues/traits to generals just by placing them somewhere in the sratmap? (could be in a settlement)
Yes. You create a new trait or retinue and put in the trigger conditions that the General neeeds to be in the settlement you want or (I'm not sure about this one) near a certain title.
Ok thanks for the answer.
Now I need some help to develop new features Im creating. The questions are only the ones in the red text, the blue text is only for explaining what Im trying to create.
FEATURE 1
FEATURE 2
By the way, I searched for a list of traits/retinues and found this, can I use it to choose the bonus I want?
1) That would be your regular 'EndedInSettlement' condition together with a building present test.
2) You can't kill a character without knowing his name, so that's out.Code:Trigger [trait name]_trigger WhenToTest CharacterTurnEndInSettlement Condition SettlementBuildingExists >= [lowest level of building] and FactionType [faction] and not Trait [trait name] > 0 Affects [trait name] 1 Chance 100
Adding units to an army requires the name of the general, same.
I have no idea how you can make use of the custom tile in your case, isn't it that a battle needs to be triggered on that tile? It would require the spawn of an immobile army that the player can the attack as you can only script an attack if you know the name of both attacked and target.
You say I can only kill a general using his name, but what about using his location?
As for adding units to an army, Im quite sure it can be done simply via spawn army command. Using the fort location coordinates in the map. Once the attacking general wins the battle and take place inside the fort, the units are spawn in this location. No need to identify the general by its name.
Yes, rebel army inside the fort will cause the battle to happen when the general attacks it.
I decided to use forts after all. And added some new bonuses. Check the original comment with the concept. I edited it.
See my tutorial. This is the basic command: kill_character [name\label]. His location is only a condition.
There is no problem to spawn a separate army with those bonus units, directly adding units to an army however requires the general's name - that's what I took you meant.
The fort should keep the target army in place, I would however suggest to think about a removal of that spawn (like garrison units) via a yes\no event in case the general cannot\doesn't want to attack.
OK no way then.
U talk about some kind of command like "add unit to that army"? Or are u talking about simply spawing units OVER an army, like in the same location. Because if spawing units over an army can do the trick and merge both armies together, then its enough for me.
To keep the rebel army in place I could simply use the "LOCKED" trait.
What do you mean with the general cannot/does not want to attack? I dont get this part.
I want The rebel army to stay inside the fort until someone attacks and destroys it.
-----------------------------------------------------------------------------------------------------------------------------------------------------
Can be forts created directly via script? If not, is it possible then to spawn an rebel general and make him create a fort via script?
Spawning an army on top of another does not merge them - it simply 'slides' off into one of the available spots next to the other army.
Adding units to an army is done via the 'create_unit' command which, like the killing command, requires a label\name. Can also be used to add a garrison to a settlement.
The 'locked' trait reduces movement points to a minimum but does not totally stop movement, approximately one movement point per 4 rounds I think. Sticking rebels\slaves into a fort however in most cases stops them from wandering around.
Forts cannot be created via script, either directly or indirectly.
As to the last bit: what I had in mind is a vicinity check of a general (let's say two steps) from the fort. This then triggers a historic yes\no event with the question if he wants to explore\join battle. If yes then the rebels get spawned and a battle can take place and if won a reward gets granted. If no, then nothing happens. Should the battle get lost or no attack takes place (existence check of the rebel general) then the rebel army gets disbanded.
If memory serves then spawning the rebels directly into the fort is not possible, they will 'slide' off and need to be 'moved' into the fort after the spawn.
seems good enough for me.
thats also good enough since I dont want them enywhere out of the fort.
I guess you consider this method better because you cant spawn armies directly inside forts. But you actually can. I just did it via descr_strat.txt
Oh, now I get it. Thats a problem since I would need the army to be respawn from time to time inside the settlement and this can only be made via script.
But I guess that spawing the army in a tile right beside the fort is enough, being a rebel army, they will conquer the fort in the next turn if there is no one inside it. And I can make the script to spawn the rebel army only if there is no one inside the fort.
You can't spawn into a fort/settlement but you can spawn nearby and walk them in: use "move" command with his name/label and the fort/settlement coordinates as the target location.
Usual limitations apply: labels can't be re-used and names are generally unsafe because somebody else might have that name so he moves instead of the proper guy; the Unique Names method solves that. You might need to spawn two tiles away - spawning adjacent sometimes fails to move them inside, no idea why, but only AI has this problem.
Like this in export_descr_ancillaries.txt?
This way I will block ancillaries from being acquired after battles elsewhere and set them to be acquited only in the locations I want, right?Code:Trigger chop_block2 WhenToTest PostBattle Condition WonBattle and IsGeneral and CultureType middle_eastern and PercentageEnemyKilled >= 90 and IsPositionInRect x y coordinates to make sure the ancillaries will be only give for a general who won a battle in this exat location AcquireAncillary chop_block chance 5
I would like to make them exclusively acquired in my forts via the script Im trying to develop here.
The problem is that I want the ancillary to be given not only in 1 coordinate but in many because I have many different locations in my stratmap where this should happen. (By the way they are all forts, any problem with this?)
So is it possible to use something like:
IsPositionInRect x y coordinates
or IsPositionInRect x y coordinates
or IsPositionInRect x y coordinates...
?
Or would I need to repeat every ancillary entry with new coordinate for every location I want?
Here's what I made.
.Code:Trigger PublicFaith_trigger WhenToTest CharacterTurnEndInSettlement Condition SettlementBuildingExists >= evil_temple and FactionType portugal and not Trait PublicFaith > 0 Affects PublicFaith 1 Chance 100
Not working.
The trait is given, but not the one I wrote in the script. Actually, the game gives 2 traits to the characters, and none of them are the one I chose.
Besides, the game gets messes, the turns pass fast, the next turn I get izarre recruitment reports, and normal scripts are not being read.
Weird.
The general can only be in the square after he won the battle. The trigger however will remain active so you may have to use an event_counter condition as well. Switch it on with your event preceeding the battle and switch it off at the faction's turnend.
------
You cannot use or - you will need to write a trigger each.
Is evil_temple the first level of the building tree? You need to use a level name, not the tree name.
Inactive script (the reason for fast processing) - certainly an error in the script or descr_strat. The latter prevents the script from being called.
------
For testing purposes use a clean EDCT with only your trait and triggers. The trait should appear at the start of the next round, provided the character remained in the qualifying settlement at the end of his turn.
IsPositionInRect needs sm_position which only three events export. PostBattle isn't one of them. The log would surely be saying so.
Maybe if the fort was on a resource then the OnResource condition could be used. I don't know if that still works when the resource is underneath settlements/forts. And you'd need to ensure that no other resources in that region can be stood upon or are underneath other settlement/forts, to avoid your trigger happening in the wrong locations.
A fort on top of a resource is actually the old resource fort exploit
And you are right, IsPositionInRect is unsuitable as it will only define in which area a tile can be when it is seen, I must have thought of I_CharacterTypeNearTile which again is too ambiguous and has it's own pitfalls.
GeneralCaptureResidence could work as it exports a region and together with a event counter set at start of the battle could work. Rough doodle:
What character event might be suitable....
I_CharacterTypeNearTile (next to fort)
AgentType named character (no low generals, please...)
historic_event ruin_battle true
while I_EventCounter ruin_battle_accepted = 0
and I_EventCounter ruin_battle_declined = 0
end_while
if accepted > 0
do stuff
end_if
if declined > 0
do nothing?
reset event counters
end_if
end_monitor
event GeneralCaptureResidence
and I_event_counter ruin_battle > 0
do the trait or whatever stuff
reset event counters
end_monitor
In case the guy looses you also need a counter reset (all three) at the faction's turn end. A cool down is also advisable else the guys will have the event the next turn again.
OK.
What about a even more simple solution?
I could create a new rebel faction, make script spawn its armies in the coordinates I want, and then use a condition for the ancillaries to be given every time a general win a battle against this faction.
What do you think?
I've checked the docudemons for the conditions and I see some possibilities, though I'm not sure which one is the best.
Another rebel faction will create problems because of the special faction entry in descr_sm_faction. Using a 'regular' faction however should not be a problem. In fact you could use as 'script' faction which has a number nifty uses, withnwar has a number of tutorials regarding the use of a faction like that (non playable, only used for script purposes), eg unique character names.