Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Hi folks,
Writing a script for this ability: "Grants a bonus on two of the following skills of the rogue’s choice: Fly, Handle Animal, Profession (driver), Profession (sailor), or Ride." I've got the custom expression choosing the correct skills. Now I want to apply a +2 competence bonus to the chosen skills. <post-attributes 10000> Code:
hero.childfound[usrChosen1].field[BonComp].value += 2 hero.childfound[usrChosen2].field[BonComp].value += 2 Thanks as always! Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
#1 |
Senior Member
Join Date: Feb 2015
Posts: 676
|
The reason you're getting errors is because that script is looking for picks on the hero called userChosen1 and usrChosen2, which don't exist. What you are looking for is the transition "chosen", like so:
Code:
doneif (field[usrChosen1].ischosen = 0) field[usrChosen1].chosen.field[BonComp].value += 2 The second line starts from the ability's 'usrchosen1' field, then uses the 'chosen' transition to move to the pick selected in that field (i.e. the chosen skill), and is then able to apply the value to the BonComp field. |
#2 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
That makes more sense now IG, thanks for taking the time to explain it. Works great now.
Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
#3 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
Code:
doneif (field[usrChosen1].ischosen = 0) field[usrChosen1].chosen.field[BonComp].value += 2 doneif (field[usrChosen2].ischosen = 0) field[usrChosen2].chosen.field[BonComp].value += 2 Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
|
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
In the editor, how did you set up your choosers for this? It sounds like you left one of the settings blank, so it's defaulting to thing-based selections, instead of choosing "picks on hero".
|
#5 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Yessir, that was the problem. All good now, thanks!
Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
#6 |
|
|