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.
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.
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.
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).Originally Posted by the_foz_4
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.
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.Originally Posted by the_foz_4
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.Originally Posted by alpaca
![]()
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![]()
Bookmarks