ID:139203
 
Code:
mob
icon = 'General.dmi'
icon_state = "base"
var
Hel = 100
En = 100
Str = 100
Endur = 100
Forc = 100
Res = 100
Off = 100
Def = 100
Cen = En
Chel = Hel


Problem description:

I am trying to get Cen, (Current Energy) to equal En. (Base Energy). The same thing goes for Chel. (Current Health) and Hel (Base Health). I want them so that I can have my train verb take away from a Current Energy that recovers, instead of a player's base energy.
Look up, "=", "-=", "<", ">", "<=", ">=".
Afterschaaf wrote:
Code:
>
> mob
> icon = 'General.dmi'
> icon_state = "base"
> var
> Hel = 100
> En = 100
> Str = 100
> Endur = 100
> Forc = 100
> Res = 100
> Off = 100
> Def = 100
> Cen = En
> Chel = Hel
>
>

Problem description:

I am trying to get Cen, (Current Energy) to equal En. (Base Energy). The same thing goes for Chel. (Current Health) and Hel (Base Health). I want them so that I can have my train verb take away from a Current Energy that recovers, instead of a player's base energy.


Ok, I am not sure if your question has been fully answered or what not, but if I read and understood what you wrote, then I assume your "Train" verb right now is taking away from the base energy which is what current energy is suppose to equal, right? If so, it seems to me like you have your vars defined right, but you may need to make sure that in your "Train" verb you have it actually taking away way from cen there and not your base energy. Its a simple enough concept really, I hope this helps.
Use New(). I think the problem is, since its a mob/var, at compile time it doesn't have any mob to actually pull the value of Cen or En from since none have been created yet. So you can't predefine a var by pulling information from something that hasn't been created yet, I think.

You can define the vars without a parent and do what you did, that also works but that means everything from obj's to turfs will have those vars which is probably unnecessary.

        New() // everytime a New() ___[whatever this is being defined under] is created, do the stuff below
Cen = En // set Cen to En
Chel = Hel // set Chel to Hel
..() // do the rest of the normal things New() does