Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Savage Worlds (http://forums.wolflair.com/forumdisplay.php?f=59)
-   -   Swim speed = Pace (http://forums.wolflair.com/showthread.php?t=67957)

Gumbytie August 16th, 2023 02:30 PM

Swim speed = Pace
 
So I want to track Swim Speed to Pace.

Traits/5000

Code:

var swim as number
swim = hero.child[trPace].value
if (#resmax[resLoadLim] < hero.child[resEncumb].field[resSpent].value) then
swim -= 2
endif
hero.child[trPace].field[trtSpecial].value = swim

If I assign a number to the swim variable works just fine. But I want the swim speed to equal the character's current Pace. The above gives me an error regarding the [trPace], so I am obviously calling that with the wrong syntax. Any suggestions?

CapedCrusader August 17th, 2023 01:14 AM

I think it's that top one. Try:

swim = #trait[trPace]

Gumbytie August 17th, 2023 03:45 AM

Hmm, I used the Debug trick you used me to double-check. Simplified code a bit to tes.

Code:

if (tagis[Equipped.Equipped] <> 0) then
var swim as number
swim = #trait[trPace]

debug #trait[trPace]

hero.child[trPace].field[trtSpecial].value = swim
endif

The Debug shows the value for #trait[trPace] is 0. So it that code doesn't pull any value. Any other ideas?

CapedCrusader August 17th, 2023 07:45 AM

Is the timing still set at Traits/5000?

Gumbytie August 17th, 2023 10:00 AM

Yes, I was wondering if it might be the timing. But didn't want to randomly guess at something new.

CapedCrusader August 17th, 2023 11:28 AM

There are several places in the code that reference trPace like that. I don't see why it's not working.

CapedCrusader August 17th, 2023 11:35 AM

Try hero.child[trPace].field[trtBonus].value

Gumbytie August 17th, 2023 12:02 PM

That worked. Strange, I really thought I tried that option. Sigh, getting old.


All times are GMT -8. The time now is 07:34 AM.

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