Senior Member
Join Date: May 2013
Posts: 1,458
|
Is there any way to increment a field inside of a bootstrap block?
For example, in this block, a field is being assigned a value of 42: Code:
<bootstrap thing="AttrIncr"> <containerreq phase="Setup" priority="500"> val:Level.? >= 4 </container> <autotag group="TheGroup" tag="TheTag"/> <assignval field="MyField" value="42"/> </bootstrap> |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
You'd need to set up a separate "bonus" field, and then have scripts that will total the bonus and whatever's already there. Then your bootstrap would assign a value to the bonus, and your scripts will add it in.
As a reminder, if you actually describe the game rule you're trying to implement, as well as asking the technical question that you're currently focused on, there may be different, possibly better ways to accomplish your goal, but here, I don't know what context this is being used in, so I can't offer any other advice. |
#2 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
Quote:
For example, there are traits called "Effort" and "Edge". Advancing in Tiers allows a player higher values in these traits. The problem with the bonus field is that if it has been incremented by other things, I'll be completely overwriting it instead of incrementing it. I can do it with abilities. Bootstrap an ability that increments the bonus field. Or in the "Type" thing itself (which is the component that advances in tiers), I can add an if-then block. If Tier >= 6, elseif Tier >= 5, etc ... |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
I definitely would not bootstrap effort and edge picks to the tiers, if you're adding a separate tier pick for each time the tier increases. Put a field on those tiers that stores the amount of effort or edge to add, and then use a script to look up that field's value and add it to the correct place.
|
#4 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
Quote:
|
|
#5 |
|
|