• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Help with custom item (Eval Script)

NeoEvaX

Well-known member
I am helping a fellow player in my game. We were granted a wish, and his was to be able to have enlarge person whenever he rages (he is a barbarian).

I was thinking I would make him a magic item for him to equip.

I know something should be something like this:
doneif (hero.tagis[Hero.Raging] = 0)

But how would I make this happen? I am slightly worried its going to be more complicated than just a one line that makes him enlarge.

I am still very new to the Editor, so talk slow :)
 
There's an adjustment for Enlarge Person. A lot of the logic you might want is already there. For that matter, couldn't you just put that Adjustment on the character and toggle it on and off as needed?

If you're approaching it from the standpoint of learning the Editor more, I would suggest looking at the various Rage Powers. I would think they would have a check in their scripts for the Raging status.
 
Thats a great idea. I didn't think about looking into Rage Powers.

The player knows he can just click the rage checkbox, then go into adjustments and do enlarge person. We are just looking for a fun way to combine those into 1 thing.

I am also using this as an opportunity to learn how it works. I have been dabbling here and there, making modifications. One thing I don't know how to do is basically assign an adjustment in eval script (code).

I was just curious if there was a 1 line thing that would, essentially, click the adjustment for me.
 
Once you're looking at the code in Enlarge person, you'll find that it all starts with:

Code:
doneif (field[pIsOn].value = 0)
That means, "we're done if the on/off checkbox is equal to zero (not checked)"

So you want to change that to:

Code:
doneif (field[pIsOn].value + hero.tagis[Hero.Raging] = 0)
So, it'll be more than one line of code to get all the effects of enlarge, but once you've copied the existing enlarge, you only need to change one of those lines in order to get the effect you're looking for.
 
Great! Thanks! I will spend a bit more time with the Editor and see if I can make it happen. I love learning new scripting/coding languages.

I will comment back if I am unable to get it working.
 
Would you do the following to allow the adjustment to be kept "on" and toggle with raging?

Code:
doneif (field[pIsOn].value + hero.tagis[Hero.Raging] <= 1)

So it would only apply if the character is raging AND the adjustment is on, but not otherwise. So you could let the adjustment be on at all times, but it would only apply when raging is toggled on.
 
Lord Magus - doesn't that script mean " do this if either of these is active, but not if both are turned on, and not if both are turned off?

For "if the character is raging, and the adjustment is on":
Code:
doneif (field[pIsOn].value + hero.tagis[Hero.Raging] = 2)
 
Lord Magus - doesn't that script mean " do this if either of these is active, but not if both are turned on, and not if both are turned off?

"Not if both are turned off"? Wouldn't "<=1" mean "less than or equal to 1", which would mean "if either or both are turned off"? Sorry if I sound obtuse, just making sure I really understand this (I am not a programmer at all).
 
Yeah, he had that wrong. If both are turned off, the IF expression would evaluate to TRUE.

"I'm sure you think you know what you thought he said, but I'm not sure you realize what he meant was not what you heard." :D
 
Back
Top