Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 20th, 2017, 11:53 AM
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
ErinRigh is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old November 20th, 2017, 12:42 PM
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." is the location to test and "Tagis[]" is the function we are going to do and the "Hero.OffHand" is the tag we are testing.

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.
ShadowChemosh is offline   #2 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 20th, 2017, 01:17 PM
Ok, my issue must be timing, where do I put this script for timing to make it work?
ErinRigh is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old November 20th, 2017, 01:21 PM
Quote:
Originally Posted by ErinRigh View Post
Ok, my issue must be timing, where do I put this script for timing to make it work?
I have no "this is the perfect timing to use" answer. Timing is half experience and half trial and error.

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)
Start at like Pre-Level/1000 and go up from that point.

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.
ShadowChemosh is offline   #4 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 20th, 2017, 02:09 PM
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
ErinRigh is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old November 20th, 2017, 02:23 PM
Quote:
Originally Posted by ErinRigh View Post
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
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.
ShadowChemosh is offline   #6 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 20th, 2017, 02:59 PM
OK mate, thanks for all your help
ErinRigh is offline   #7 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 20th, 2017, 05:49 PM
Any luck SC?
ErinRigh is offline   #8 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old November 20th, 2017, 06:46 PM
Quote:
Originally Posted by ErinRigh View Post
Any luck SC?
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.
ShadowChemosh is offline   #9 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 20th, 2017, 07:22 PM
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
it is currently at Render/1000
ErinRigh is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:11 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.