Senior Member
Join Date: Oct 2016
Posts: 621
|
Well if someone could point me in the right direction, I am trying to code
~ If there is something in your offhand, get out now I can't find any examples of this script to base what i need but I believe it has to do with the Hero.OffHand tag, I just don't know what I am doing with it to tell the script that if Hero.OffHand <> 0, get out |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
If you want to test for a "tag is present" you use tagis[] which returns 0 for false and 1 for true.
Then your "transition" tells you where you are going to test for the tag. See Mathia's Location Location Location article for full details. In this case we want to test the "HERO" container (ie our transition) or the top most level of the character for this tag. Combined together you get: Code:
~ If there is something in your offhand, get out now doneif (hero.tagis[Hero.OffHand] = 1) Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#2 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Ok, my issue must be timing, where do I put this script for timing to make it work?
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
The later you can test the better is the only "default" answer. So if you can do stuff at Final/10000 you are pretty guaranteed that all values/tags are set. But trying to make any OTHER changes to the hero at that timing is going to be hard. What I would do is add debug statements to the script to see if I can figure out what is wrong and if the tag is present yet: Code:
debug "Off Hand is " & hero.tagis[Hero.OffHand] ~ If there is something in your offhand, get out now doneif (hero.tagis[Hero.OffHand] = 1) Remember to do "Develop->Floating Info Windows->Show Debug Output" to be able to see the above debug statements. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
|
#4 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Well I made it all the way to Render/1000 and I can't get it to display Off hand is 1 it always displays offhand is 0 and before you ask, yes I made sure something was in his offhand
|
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Hmmm strange. I will take a look once I get back later. Going out for a bit.
Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#6 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
OK mate, thanks for all your help
|
#7 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Any luck SC?
|
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
When looking at the tags on the hero did you notice anything? Like you equip a dagger in the off-hand and when you searched the Hero for the tag Hero.OffHand you didn't see it?
Meaning how could a script find it if you yourself don't actually see it? So please equip weapon in the off hand. Then go Develop->Floating Info Windows->Show Hero Tags. Then look to see which "TAG" is on the actual hero that tells you a weapon is in the off-hand. Once you know this you can then change your script to look for the correct tag. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#9 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Well the only tag that changes is Hero.OffHand, so I don't know what I am doing wrong. Here is the whole script I am working with
Code:
debug "Off Hand is " & hero.tagis[Hero.OffHand] ~If there is something in the offhand, get out now doneif (Hero.tagis[Hero.OffHand] = 1) ~ If we're disabled, do nothing doneif (tagis[Helper.FtDisable] <> 0) ~ If we fail the test for being speedy, get out if (hero.tagis[Encumbered.Light] = 0) then perform assign[Helper.SpcDisable] done elseif (hero.tagis[Hero.MedArmor] + hero.tagis[Hero.HeavyArmor] <> 0) then perform assign[Helper.SpcDisable] done endif ~Get abValue if (#levelcount[Gladiator] >= 18) then field[abValue].value += 4 elseif (#levelcount[Gladiator] >= 14) then field[abValue].value += 3 elseif (#levelcount[Gladiator] >= 10) then field[abValue].value += 2 elseif (#levelcount[Gladiator] >= 6) then field[abValue].value += 1 else field[abValue].value += 0 endif ~ We passed, so add to our dodge AC. hero.child[ArmorClass].field[tACDodge].value += field[abValue].value |
#10 |
|
|