Results 1 to 9 of 9

Thread: Displaying VnV Calculations

Hybrid View

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

    Default Displaying VnV Calculations

    A general question on scripting, from an utter newbie...

    I was wondering if there is any way to display a calculated total of a given VNV. Ultimately what I'm after is to find out, for example, which of my generals would raise the population growth rate of a city the most.

    I realise that it would involve multiple VNV calculations (law, health?, etc.) but at this point I'm just wondering if it's even possible...

    1. Does the scripting language even let you do calculations like that? eg. Total = sum of law + sum of health, from all of this general's traits/ancillaries
    2. Is there any way to output the results in-game? Even just a dump to the console would do.

    I've been searching and reading but haven't come across anything like either of these yet.

    Thanks.

  2. #2
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Displaying VnV Calculations

    As far as my testings go, only the visible attributes (Command, Piety etc) can be checked for by EDCT. For example, I have tried BodyguardValue, which is a valid effect of traits, to be checked for as an attribute but to no result.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

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

    Default Re: Displaying VnV Calculations

    Not very promising is it? Oh well, good of you to try... I appreciate it. +rep

  4. #4
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Displaying VnV Calculations

    Yes, I am looking for ways to give additional family members that participate in battles some traits.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

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

    Default Re: Displaying VnV Calculations

    Sounds like a good idea. Good luck.

    In further response to your response...
    Quote Originally Posted by konny View Post
    As far as my testings go, only the visible attributes (Command, Piety etc) can be checked for by EDCT.
    I would have thought that I'd be able to find out what traits/ancillaries a general has and from there work out what VnV values they currently have, given that every trait/ancillary gives Vnv pluses/minuses.

    As I said, I've done a lot of searching and reading but I haven't come across anything to explain how you would "check" the "EDTC" for example. Any chance you/someone could point me in the right direction to find out about programming in TW, as opposed to writing scripts? I've mostly been looking in "Text Editing and Scripting" as no other categories seemed to be about 'programming' as such. Or is there no such thing? i.e. Scripting is the (only) programming.

    In that case, how would you do something like loop through a list of all current generals?

    I'm not looking for a specific answer to the above question... just wondering if there's a pool of information that I haven't found yet. I've got the Docudemons file and seen lots of examples. And I'm not a newbie to programming, by the way, just TW modding.

    Any help would be very much appreciated.

  6. #6
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Displaying VnV Calculations

    I am not sure if I get what you want to do. Are you looking for a way to check, for example, how much Law cumulative a general has?

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

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

    Default Re: Displaying VnV Calculations

    Yes, for example. Or more specifically, how much each of my generals has.

    If I was doing it in a programming language it would be something like:

    Code:
    for each general in list_of_current_generals:
      
      total_law = 0
      
      for each trait in this general:
        law_in_this_trait = trait.law
        total_law = total_law + law_in_this_trait
      endfor
    
      write(general.name + " : " + total_law)
    
    endfor
    So I have a bunch of questions really, like: are such looping and arithmetic operations possible? how do I get the list of generals? how do I step through that list? can I write out results in any way?

    I can see how scripting works (triggers, events, conditions, etc.) but in terms of the language itself so far I've only seen IF statements; not loops and maths.

    I fully understand if this kind of thing is just not possible; I'm just trying to find out, well, the syntax of the language I suppose.

  8. #8
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Displaying VnV Calculations

    No, something like that is not possible (to my knowledge). Only workaround would be traits for which the characters would acquire points when having other traits that assign, say, law. This would be rather tedious to code because you need to make sure to catch all vanilla traits that give or take the respective attribute, but only if the respective trait is gained or lossed, and not every turn it is held.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

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

    Default Re: Displaying VnV Calculations

    I have since found a good scripting introduction that pretty much led me to the same conclusion: not possible to do calculations, looping etc. I see now that the only 'programming' variable available is the counter. And trying to do what I ultimately wanted to do (show total population growth bonus) would be a nightmare, as you say. Interesting workaround idea by the way. Well, thanks for your time konny.

Posting Permissions

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