Results 1 to 16 of 16

Thread: Movement range adjustment: Questions for the pros

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Movement range adjustment: Questions for the pros

    I am aware of 3 ways in which to adjust the movement ranges of units, by way of the descr_character.txt file under Starting Action Points, in the descr_campaign_db.xml file by adding movement factors for infantry, siege, and cavalry troops seperately, and by way of movement bonuses afforded through traits and/or ancillaries...

    My question is this: Is it possible to give movement bonuses to 'named characters', ie generals and governors, without those bonuses being applied to troop units grouped with the character at the beginning of a round?

    My goal in this is to afford bonuses, significant ones, to generals moving alone, accompanied only by their bodyguard units, for the purpose of, say, transferring to another city in which to govern...it seems logical that a general with his entourage would be able to move much farther than if he is organizing the movement of an entire army, and adding bonuses by any of the above methods has the unfortunate result of affecting the troops he is grouped with as well...

    If anyone knows of a way to accomplish this, or just has further insight on this subject, I would very much appreciate your input!

    Thanks

  2. #2
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Movement range adjustment: Questions for the pros

    Firstly there is no infantry movement modifier in descr_campaign_db.xml.

    Now to answer your question, perhaps you can use this:

    PercentageUnitAttribute general_unit < 100

    As condition to apply a trait that gives a movement bonus.

  3. #3

    Default Re: Movement range adjustment: Questions for the pros

    Thanks for the tip, actually you're right, there isn't an infantry movement modifier in descr_campaign_db.xml, but if you desire you can put one in, it looks like this:

    <infantry_movement_points_modifier float="0.95"/> <!-- movement points modifier for infantry units -->

    you put that in the 'misc' section, and also you can replace infantry with 'cavalry' and 'siege', and it works for them also...

  4. #4
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Movement range adjustment: Questions for the pros

    Quote Originally Posted by Alaskanite View Post
    Thanks for the tip, actually you're right, there isn't an infantry movement modifier in descr_campaign_db.xml, but if you desire you can put one in, it looks like this:

    <infantry_movement_points_modifier float="0.95"/> <!-- movement points modifier for infantry units -->
    I'm telling you that's total crap.

    If you think about it then it's also pretty stupid crap. The base movement is for everyone, then there are cav and siege modifiers, which leaves infantry as base. So there would never be a need for an infantry modifier.

    Quote Originally Posted by Alaskanite View Post
    If you could explain/define the condition you referred to: 'PercentageUnitAttribute general_unit < 100' i would appreciate it-I've looked through Docudemons but a lot of the conditions, and the commands, for that matter, are a mystery to me, of course looking around here at a lot of exmples provides has helped...
    OK, you can do it in different ways but here is an example of what the triggers may look like:

    Code:
    WhenTotest CharacterTurnStart
    
    Condition PercentageUnitAttribute general_unit = 100
    and not Trait GeneralsOnly = 1
    
    Affects GeneralsOnly 1 Chance 100
    
    WhenTotest CharacterTurnStart
    
    Condition Trait GeneralsOnly = 1 
    and not PercentageUnitAttribute general_unit = 100
    
    Affects GeneralsOnly -1 Chance 100
    At the start of the character's turn that trigger will check to make sure that only a leader with an army consisting of general's bodyguards is assigned the trait.
    Last edited by Taiji; September 13, 2011 at 08:40 AM.

  5. #5

    Default Re: Movement range adjustment: Questions for the pros

    Thaks VERY much, I hadn't thoroughly tested that feature, obviosly, right? After your first comment I started digging to see what you were talking about and came upon the fact that, as you said, infantry is the base on which all other mocifiers are based, so it is always a factor of 1.0 and nothing you put indescr_campaign_db.xml will ever change that...I wasn't sure if you were saying that the modifiers for cavalry and siege were also bogus or what, but your response got me digging in the right direction and I came up with a definitive solution that tests accurately.

    Anyway, I was able to come to the same conclusion on my own, so that made me feel a little less stupid. I was, after all, basing my info on what I had learned through other posts on this site, but as it turn out they were not 100% accurate. i put together a tutorial for newbies like myself and am going to post it after I finish with this response...feel free of course to tear it to shreds if it is not accurate, but i'm confident it is, and also am sure that other dummies and newcomers will probably find it a much clearer demonstration of what the two most common movement adjustment methods can and cannot accomplish.

    And thanks very much for the explanation and demonstration you provided-that would work perfectly from the looks of it!(not that I know what proper scripting should look like, but if it works as you explained that is exactly what I am looking for!)

    I know it must be frustrating answering stupid questions from guys like me, this site is full of dumb questions isn't it? But your patience and expertise has surely helped many a budding modder to get moving in the right direction, and is much appreciated!!!

  6. #6

    Default Re: Movement range adjustment: Questions for the pros

    If you could explain/define the condition you referred to: 'PercentageUnitAttribute general_unit < 100' i would appreciate it-I've looked through Docudemons but a lot of the conditions, and the commands, for that matter, are a mystery to me, of course looking around here at a lot of exmples provides has helped...

    I'm also still a little baffled by your comment as to descr_campaign_db.xml, the info I got on that was off of this site, in several threads, heres a link to one of them:

    http://www.twcenter.net/forums/showthread.php?t=272509

    and I have tried it and it seems to work..are you ssaying that the infantry modifier isn't valid or what?

  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Movement range adjustment: Questions for the pros

    Quote Originally Posted by Alaskanite View Post
    If you could explain/define the condition you referred to: 'PercentageUnitAttribute general_unit < 100'
    The descriptions in the demons can be vague sometimes. There is this but it doesn't really tell you anything beyond what the demons say.

    In this case, though, the demons are quite clear: "Test to see what percentage of the army have a particular attribute". Assuming you know what an attribute is.

    All units have attributes (see export_descr_unit). Bodyguards have the general_unit attribute. So this is saying "if this character's army is made up of less than 100% general_units then...".

    Although perhaps it should be =100 in this case. i.e. If the army is 100% general_units (bodyguards) then give the character a movement point bonus trait. And another trigger to remove the trait if it's <100.

    However, any unit could be given the general_unit attribute. e.g. It prevents the game from spawning them for missions rewards (I think).

  8. #8
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Movement range adjustment: Questions for the pros

    I noticed this coding a while ago. So I tried it out, and then when I realised what was going on I felt pretty stupid myself. Shoulda been able to work out that cav and siege and inf is everything... lol

    As for the trigger thing, I made a little mistake. I'll do the whole trait for you so you can see everything:

    Code:
    ;;;Stick this at the start of the file:
    
    Trait GeneralsOnly
    	Characters family
    	Hidden
    
    	Level GeneralsOnly
    	Description GeneralsOnly_desc
    	EffectsDescription GeneralsOnly_effects_desc
    	Threshold  1 
    
    	Effect MovementPoints  5 
    
    ;;;;;;Stick this at the end of the file:
    
    Trigger GeneralsOnlyOn
    WhenTotest CharacterTurnStart
    
    Condition PercentageUnitAttribute general_unit = 100
    and not Trait GeneralsOnly = 1
    
    Affects GeneralsOnly 1 Chance 100
    
    Trigger GeneralsOnlyOff
    WhenTotest CharacterTurnStart
    
    Condition Trait GeneralsOnly = 1 
    and not PercentageUnitAttribute general_unit = 100
    
    Affects GeneralsOnly -1 Chance 100
    That stuff in blue tells you what to name your description text - The stuff that pops up when you mouseover the trait.

    Not sure if you need to do it for hidden traits, like I made that one, but you'll find where in text\export_VnVs.txt.


    I didn't test it so... It probably works... But don't trust it!
    Last edited by Taiji; September 13, 2011 at 05:57 PM.

  9. #9

    Default Re: Movement range adjustment: Questions for the pros

    That looks great, and I am going to try it right now, I'm sure it's going to work, it looks perfect!!! Thank you sooo much!!!

  10. #10

    Default Re: Movement range adjustment: Questions for the pros

    Well I've put it in and tested it, and initially of course it crashed on startup, but after correcting a few spacing errors and capitalizing the 'T's' and such (thank god for Logging-and such specific logging, too!)

    It WORKS PERFECTLY! EXACTLY AS ADVERTISED and precisely what I was trying to accomplish!!! And I suppose you just thought that up off the cuff ,huh?

    Well thank you profusely, that was my first experience with adding a trait, and I couldn't have done it if you hadn't invented it. Really, that was a most excellent experience for me, all I've delved into so far is mapping, creating some basic Units (nothing great or unique, just to see if I could and if I could make it work); modified the EDB quite a bit, and that was all really neat, to think of some changes you wanted to make, edit files and then actually observe that the game is acting the way you told it to, that's just the coolest thing, but i can see that the real power is in scripting and I really, REALLY want to learn it, so anyway, I'm having a lot of fun and I really appreciate it!

  11. #11
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Movement range adjustment: Questions for the pros

    You're welcome

    I agree CA did a fine job with the logging for scripting.

    If you're interested you can edit the kingdoms.exe with Notepad++ and find the text for the error logging stuff. It might give you some insights about the definitions of script commands and conditions, that I saw you were interested in, to see the kinds of errors they can produce.

    Also, along those lines, it's worth checking out the scripts for the historic battles.

    Basically once you know what any script is doing ingame then you can adjust it and see whether the difference in behaviour meets your expectations. It's a pretty straightforward way to learn. You can add conditions, adjust conditions, add commands, etc. and if you get something wrong then it will usually produce an error message.

    When it doesn't produce an error message you can set up historic events (pop up scrolls the player has to OK) to fire at different stages of the script. So you'll know when it failed to work as you'd planned and that way narrow down the suspects without even looking at the log.

    And you can also use counters or the 'log' command to present the same confirmations but in the log.
    Last edited by Taiji; September 14, 2011 at 05:05 PM.

  12. #12

    Default Re: Movement range adjustment: Questions for the pros

    Oh and thanks for your latest tips, I just saw that, very cool that'll be my next round of studying!

    I posted a tutorial for movement rate for fellow beginners, my initial post was terrible and way too long winded, but I just finished cleaning it up a bit and reposting

    http://www.twcenter.net/forums/showthread.php?t=481864

    it's probably still way too long winded, but I divided into sections so only those who need to can try out the example I used to prove to myself what was REALLY going down

    and how come there's not a plus sign next to your report button? You've helped me out immensely

  13. #13

    Default Re: Movement range adjustment: Questions for the pros

    I added the following lines in export_VnVs.txt:

    {GeneralsOnly} Travelling Light
    {GeneralsOnly_desc} Your general's range is greatly increased while he is not leading any troops, but will be limited according to the troop type once he heads an army again

    and I am LOVING the results..it's definitely going in my personal mod, although I haven't decided on a final bonus rate-is it true that it is in increments of 5% and that 20 is maximum?

    Thanks again

  14. #14
    SpyrosM91's Avatar Despotes
    Join Date
    Aug 2010
    Location
    Patras, Greece
    Posts
    3,675

    Default Re: Movement range adjustment: Questions for the pros

    i wanted to ask... aren't the effects of the "increased movement points trait" applied in the next turn????
    Proud Tsardoms Total War: Historian - Coder - Scripter - Mapper

  15. #15

    Default Re: Movement range adjustment: Questions for the pros

    the way he wrote the trigger it checks for the condition at the beginning of the turn and applies the bonus that turn..

  16. #16
    divyanthj's Avatar Laetus
    Join Date
    May 2008
    Location
    Bangalore
    Posts
    19

    Default Re: Movement range adjustment: Questions for the pros

    Is it possible to add something like

    <naval_movement_points_modifier float="1.5"/>
    or
    <fleet_movement_points_modifier float="1.5"/>??

    I want to increase ships' movement points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •