Results 1 to 12 of 12

Thread: Idea for a trait addition: VnV Overview

  1. #1
    Member Member Jabberdau's Avatar
    Join Date
    Sep 2003
    Location
    Denmark
    Posts
    3

    Default Idea for a trait addition: VnV Overview

    When I played RTW and was going to select from 5 - 6 different family members to select one for governor, it always was a tedious process to note down on paper what bonuses to trade, squalor and law each member had as these "traits" was not included with command, influence and loyalty.

    Question:
    Is it possible to add a trait that occurs on all family members that summaries the trade, law and squalor bonuses/negatives for MTW2?
    If a family member has 2 traits fx, one that gives +20% to trade and a ancillary that gives -10% this trait would then change accordingly to provide the number "+10% Trade" when hovering the mouse over the "VnV overview" trait.

    I don´t have MTW2 yet, so I am just watching from the sideline for now, don´t know anything about modding.
    Last edited by Jabberdau; 01-04-2007 at 17:54.

  2. #2
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Idea for a trait addition: VnV Overview

    Moved to modding questions.

    As to the question: That would be too much fuss for such a relatively small feature.

  3. #3

    Default Re: Idea for a trait addition: VnV Overview

    Possibly, with a lot of work.

    You'd have to make a trait and an anti-trait for each bonus (positive command and negative command, for example), then adjust those with triggers.
    To include ancillaries, you'd have to remove all abilities from the ancillaries themselves, then create trait triggers to add points in the skills tied to a particular bonus if a character has the ancillary.

    However, I don't know if it'll work. There might be a limit to the number of levels you can have of each trait (you'd need 10 for the command traits), if ancillaries can be part of conditions in trait triggers, and you'd really have to know what you're doing to avoid bugs. For example, what would happen if you move an ancillary from one character to another? You'd need triggers to handle that as well, which might require even more traits.

    I'd like to test it some time, but quite frankly, it's a lot of work to spend on a test that may not even work.

  4. #4
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Idea for a trait addition: VnV Overview

    This is a feature that is infinitely easier to implement when designing a game than it is once the game is finished. Theoretically, it could be done, at least as far as tracking traits is concerned. I'll sum up what would be required:

    - Traits and antitraits for each thing you want to track. That'd be SqualorBonus, LawBonus, TaxBonus, and things of that nature... probably opposed by a -Penalty series of traits. This would be a lot easier if we could actually mess with character attributes and create/display the right ones, but I haven't seen that anywhere and it would make sense if it's in the hardcode.

    - New triggers that modify the new traits any time a trait that affects the particular governor stats is modified. This would be done by making at least one new trigger for each old one that could affect governor-type bonuses, and increasing your new trait or decreasing it every time a corresponding trait leveled up or down. The trouble is, I don't think it's possible to do this in the traits file. There's no event I know of that happens when a trait gains or loses points, or hits a new level, so WhenToTest conditions can't be used for this purpose. Furthermore there's no way to tell with mathematical testing (>, <, or =) whether a trait has changed unless you already know what value it was, and no way to store its value in a variable at our disposal... so AFAIK there is no way to construct a trigger that would fire under the conditions we need it to do so.

    There are some possible alternatives though. One would be a quick tweak, the other a little more in depth modification that also has side effects.

    The easy one would be to give the "hidden" attribute to any traits that you do not really care to see on a character sheet ever. Characters would still get them, but you just wouldn't see the description. If you don't care about anything that doesn't directly relate to governing, you can clean it up to a point where only the governing traits stay shown on your guys' traits screens, which I'm guessing would largely accomplish what you want to. This allows a great deal of customization, and possibly is worth not seeing all the trait details in order to have governor info available at-a-glance. At the least most people don't really need to see piety traits and probably some others I can't think of at the moment, so hiding some for the sake of brevity is quite possibly a good idea.

    The harder (and weirder) option would be to convert some of the built-in character attributes to something other than what they are intended to be. You could modify less critical stats like loyalty and piety. Let's suppose we wanted to make those instead show trade bonus and tax bonus now. Attributes are altered by traits via "Effect" lines in the file, like:

    Effect Piety 1

    These then sum up to determine the total shown for a given attribute. So if we want Piety to show tax bonus instead, we should do the following:

    1. Search the whole file, removing any Effect Piety lines from it. This keeps any Piety-related traits from influencing the stat. This may leave levels with no Effect whatsoever, which I'm not sure is legal...
    2. Any Level of a trait that gives a bonus/deduction to tax now gets an added Effect Piety in the correct amount. Tax would be in percentages, so we'd have to improvise and say 10% equals 1 point on the Piety scale... meaning a trait Level that gives:

    Effect TaxCollection -10

    Would have added to it the following on a new line: Effect Piety -1

    The upshot is that you can assign any of the already-displayed attributes to your own purpose and remove its old one in order to display exactly what you want. However, there are kinks in this plan. The primary one is that the hardcode of the game will be using Piety and Loyalty as if they are still those things. One potential workaround would be to leave the Piety- and Loyalty- starters' Effects lines intact, and then base your new attribute on that point of the starter being neutral on the scale. IIRC it is 5 for both the attributes in question. Then you'd have 6-10 as positive values, 5 for neutral, and 1-4 for detrimental values. In this particular case the modification has the hilarious side effect of making your bad taxmen more susceptible to being inquidated, while shielding good taxmen a bit. Everyone knows the good tax collectors are always the most pious!

    Similar quirkiness would exist for any other situation, depending of course on what the original attribute was used for in-game in the first place. I'd personally find it absolutely hilarious if command skill was entirely based on something like personal security. It's always those paranoid dictator types that make the best commanders...

    In the end though, I wouldn't really recommend doing this myself, as it does mess with the game mechanics in a very odd way. I'd probably just hide any traits that I felt were pointlessly cluttering up the character sheet... but since I thought of it, I had to share it in case you're that fanatical about having those governor traits quickly at hand


    See my Sig+ below! (Don't see it? Get info here)

  5. #5
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Idea for a trait addition: VnV Overview

    Actually the way to do it would be creating a new trait that is set anew every turn and holds the attribute value using the Attribute condition. But it's still a lot of work and it triggers each turn which means somewhat of a slow-down.

  6. #6
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Idea for a trait addition: VnV Overview

    Ahh, had not considered doing that. Nice one.

    The triggers are of no concern, as the game doesn't spend any significant amount of time whatsoever dealing with them. I wrote a workaround for the dysfunctional antitrait mechanic, and it involves 17,000 new triggers, several hundred going off every time an event of any sort happens, including begin and end turn... and the game didn't flinch at all. So whatever does take time in the game, it sure isn't the trigger checking.

    As for how to accomplish this per your suggestion Alpaca... any idea if we're allowed to do this?:

    Condition Trait TradeBonus > Attribute Trading

    -1 TradeBonus

    You'd repeat that same trigger a few times to make sure any difference is accounted for, then more triggers for TradeBonus < Trading that would +1 TradeBonus. It's in doubt because I don't think traits are ever directly compared to attributes in the file, but it's certainly possible it's supported even if it's never needed. It'd be really handy here, as a direct comparison allows for a relatively simple trigger setup to change it correctly. That would avoid the mess of trying to reset the trait every turn and run a bunch of triggers to set it again, which makes less sense when you read through it, and probably takes more triggers too.


    See my Sig+ below! (Don't see it? Get info here)

  7. #7
    Member Member Jabberdau's Avatar
    Join Date
    Sep 2003
    Location
    Denmark
    Posts
    3

    Default Re: Idea for a trait addition: VnV Overview

    A LOT of feedback. Wow . It DOES sound very complicated for such a small addition.
    Perhaps it is just easier to keep pen and paper nearby. I like all the traits and their descriptions as well, its just annoying that those abilities affecting governor skills dosn´t have their own display summary like Command fx.
    Any chance of modifying the help/ask helper button in the cityoverview to instead of giving advice, give a summary of the Trade/law/Squalor bonus?
    The "titles" mod in the works seems to be using this for some custom messages, maybe it could be used for this?
    Anyway, if its mucho difficult it ain´t a big deal. There are other parts of the UI that I would love to redesign..if it was possible - especially the whole city/army list overview screens.
    A very fine feedback indeed, thanks for the insightful posts .
    Last edited by Jabberdau; 01-05-2007 at 17:43.

  8. #8
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Idea for a trait addition: VnV Overview

    Quote Originally Posted by the_foz_4
    Ahh, had not considered doing that. Nice one.

    The triggers are of no concern, as the game doesn't spend any significant amount of time whatsoever dealing with them. I wrote a workaround for the dysfunctional antitrait mechanic, and it involves 17,000 new triggers, several hundred going off every time an event of any sort happens, including begin and end turn... and the game didn't flinch at all. So whatever does take time in the game, it sure isn't the trigger checking.

    As for how to accomplish this per your suggestion Alpaca... any idea if we're allowed to do this?:

    Condition Trait TradeBonus > Attribute Trading

    -1 TradeBonus

    You'd repeat that same trigger a few times to make sure any difference is accounted for, then more triggers for TradeBonus < Trading that would +1 TradeBonus. It's in doubt because I don't think traits are ever directly compared to attributes in the file, but it's certainly possible it's supported even if it's never needed. It'd be really handy here, as a direct comparison allows for a relatively simple trigger setup to change it correctly. That would avoid the mess of trying to reset the trait every turn and run a bunch of triggers to set it again, which makes less sense when you read through it, and probably takes more triggers too.
    Well that depends on the conditions. It's often safe to use events that are triggered often, if you use conditions that are not likely to change too often I think (well deriving from a theory about the event system I made up).
    Anyways, you can only check constants in conditions, so what you'd have to do is using

    Condition Attribute Trade = 0
    Condition Attribute Trade = 1

    etc.

    Could you run a test for me to see if when assigning a trait negative values if it goes to 0 or it actually accepts negative?
    I.e. trying this:

    Affects GoodCommander -99 Chance 100
    Affects GoodCommander 1 Chance 100

    And see if you get the GoodCommander trait? I don't have access to my modding envi for a day or so, so I can't test that myself right now ;)

    If it would only set it to 0 you can do stuff like

    WhenToTest CharacterTurnStart

    Condition Attribute Trade (<-- insert actual name here) = 0

    Affects TradeBonus -99 chance 100


    WhenToTest CharacterTurnStart

    Condition Attribute Trade = 1

    Affects TradeBonus -99 chance 100
    Affects TradeBonus 1 chance 100

    Do this for each attribute level (possibly including second level traits after you reached the maximum number of levels), you could do this.

  9. #9
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Idea for a trait addition: VnV Overview

    Looks like we hijacked Jabberdau's thread. You are no longer in control... resistance is futile!

    As far as what I've encountered so far, traits do not accept negative values. I tested this initially by giving spies -32 GoodSpy upon creation, and shortly thereafter 32 GoodSpy. They all came out as +5 due to GoodSpy, meaning they didn't take any negative value of GoodSpy at all. What I'm hazy on is whether or not the game will actually apply as much minus as possible: i.e. if you have 5 points and try to remove 8, I think the game will remove 5 and ignore the rest, though it's possible it ignores the attempt entirely and leaves it at 5. I'll fiddle with it more if I get the chance, in order to figure this out.

    Outside of that though, what you just suggested is probably the best way to get this particular job done. Maybe it's slightly optimized to zero the trait every turn and then bump it up based on triggers? Like this:

    Affects TradeBonus -99 Chance 100


    WhenToTest CharacterTurnStart

    Condition Attribute Trading >= 1

    Affects TradeBonus 1 Chance 100


    WhenToTest CharacterTurnStart

    Condition Attribute Trading >= 2

    Affects TradeBonus 1 chance 100


    ...and so on until the condition meets the max value of trading. It does almost the same thing as your code, just removes the need to zero the trait in each of the triggers which should presumably save time.


    See my Sig+ below! (Don't see it? Get info here)

  10. #10
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Idea for a trait addition: VnV Overview

    Quote Originally Posted by the_foz_4
    Looks like we hijacked Jabberdau's thread. You are no longer in control... resistance is futile!

    As far as what I've encountered so far, traits do not accept negative values. I tested this initially by giving spies -32 GoodSpy upon creation, and shortly thereafter 32 GoodSpy. They all came out as +5 due to GoodSpy, meaning they didn't take any negative value of GoodSpy at all. What I'm hazy on is whether or not the game will actually apply as much minus as possible: i.e. if you have 5 points and try to remove 8, I think the game will remove 5 and ignore the rest, though it's possible it ignores the attempt entirely and leaves it at 5. I'll fiddle with it more if I get the chance, in order to figure this out.

    Outside of that though, what you just suggested is probably the best way to get this particular job done. Maybe it's slightly optimized to zero the trait every turn and then bump it up based on triggers? Like this:

    Affects TradeBonus -99 Chance 100


    WhenToTest CharacterTurnStart

    Condition Attribute Trading >= 1

    Affects TradeBonus 1 Chance 100


    WhenToTest CharacterTurnStart

    Condition Attribute Trading >= 2

    Affects TradeBonus 1 chance 100


    ...and so on until the condition meets the max value of trading. It does almost the same thing as your code, just removes the need to zero the trait in each of the triggers which should presumably save time.
    No, I don't think that'd save time. Using my system, the game will execute exactly one trigger per attribute, using yours it will execute all.
    Anyways, it probably doesn't really matter, we're talking about microseconds here.

    Anyways, the trait is capped at 9 I think (well in R:TW the max number of levels per trait was 9), does anybody have an idea which values the Trading attribute takes?

  11. #11
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Idea for a trait addition: VnV Overview

    Quote Originally Posted by alpaca
    No, I don't think that'd save time. Using my system, the game will execute exactly one trigger per attribute, using yours it will execute all.
    Anyways, it probably doesn't really matter, we're talking about microseconds here.

    Anyways, the trait is capped at 9 I think (well in R:TW the max number of levels per trait was 9), does anybody have an idea which values the Trading attribute takes?
    True, executing a bunch of triggers is clearly worse, don't know what I was thinking, I'm supposed to know better than that. Maybe that was a bad day.

    Trading attribute takes on the actual percent value of the guy's bonus to trade. If the game says it's a 10% bonus, that trait affects Trading by +10. Usually a guy gets an amount from a trait that's divisible by 5, but I know I just saw some 2s in there, meaning you're probably talking about a range of possible values [-95, 95]. Some may in fact not be possible totals, but I'm not about to go find that out. If I just checked correctly then 95 is the upper bound (i.e. max possible from all traits that can give bonus to Trading).

    Based on those values, the most natural system to me would be to implement 9 levels of TradePenalty and 9 levels of TradeBonus. You'd threshold the levels at 1 point intervals, so the 9 levels are Threshold 1 - 9. Then simply divide the Trading attribute by 10 and truncate to get the right number of trait points to give (just a fancy way of saying we'll just use the tens digit of Trading). Since we can't do math, even simple integer division, it's easiest to partition the Trading range to simulate said math, since we easily know the results:

    I'll notate as [Trading range] -> (TradePenalty, TradeBonus).

    ...
    [-29, -20] -> (2, 0)
    [-19, -10] -> (1, 0)
    [-9, 9] -> (0, 0)
    [10, 19] -> (0, 1)
    [20, 29] -> (0, 2)
    ...

    I'm sure you can easily extrapolate to the needed range. This corresponds to triggers with conditions like "Condition Attribute Trading >= -29 and Attribute Trading <= -20" which would then award TradePenalty 2 points.

    One could of course instead opt to let TradeBonus and TradePenalty take on the actual value of Trading, and then Threshold at 10/20/30/40... in order to achieve the same effect. However since there seems to be no way to directly assign that value to the trait, it would involve ~10 times as many triggers for no good reason I can see (1 trigger per Trading value, instead of 1 per 10 values that I proposed above).

    With an appropriate amount of time to spend, similar logical partitions can be applied to all of the attributes we're interested in.

    As for crunching out code based on this, I have to say I'm not exactly chomping at the bit. Even if you automate all those triggers you still also have to write the corresponding descriptions to make the trait levels have text in-game, and it just doesn't seem worth it to me for the minor benefit it provides. I'm much more captivated by actively shooting down persistent and annoying game bugs at the moment, at least as best we can with our limited tools. So while I'm gonna say I won't champion this particular project, I'll certainly help as much as I can if someone else has a mind to take it on. And even if not, I'll certainly keep talking about it, as I'm enjoying the discussion


    See my Sig+ below! (Don't see it? Get info here)

  12. #12
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Idea for a trait addition: VnV Overview

    Quote Originally Posted by the_foz_4
    As for crunching out code based on this, I have to say I'm not exactly chomping at the bit. Even if you automate all those triggers you still also have to write the corresponding descriptions to make the trait levels have text in-game, and it just doesn't seem worth it to me for the minor benefit it provides. I'm much more captivated by actively shooting down persistent and annoying game bugs at the moment, at least as best we can with our limited tools. So while I'm gonna say I won't champion this particular project, I'll certainly help as much as I can if someone else has a mind to take it on. And even if not, I'll certainly keep talking about it, as I'm enjoying the discussion
    Yup, that's pretty much my own opinion about it.

    By the way, you should probably use four traits for this, with a resolution of 5%, 10% isn't good enough imo.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO