Noob with questions (tracking stamina)
by Caine Fowler · in Technical Issues · 09/24/2008 (7:56 pm) · 0 replies
OK - I'm totally new at Torque, but have been muddling my way around for a few weeks now. I've jumped into programming and expected it to be easier for me (as I'm a programmer by profession) but seem to be having troubles with gaming programming. My issue at the moment is that I followed the instructions to add a "generichealthbar" control to my playgui and have it looking very nice, but it is supposed to track stamina (or energy) changes. I have put:
function Player::UpdateStaminaOrb(%this)
{
//StaminaOrb.FillTo(99);
StaminaOrb.FillTo(1.0 - %this.GetEnergylevel());
if (%this.getState() $= "Dead")
return;
%this.schedule(100, "UpdateStaminaOrb");
}
in my player.cs file, and I've tried putting code in other .cs files (including in the client >> default.bind.cs file) but none of it seems to work. My question is - where do I put a setenergylevel update snippet when my character moves so my stamina is lowered??
Thanks.
GH
---and in case it's thought to be mentioned, I've poured over the forums already and can't seem to find the solution so if you have a suggestion on finding such noob solutions I'm all about "learning to fish rather than being fed the fish"
function Player::UpdateStaminaOrb(%this)
{
//StaminaOrb.FillTo(99);
StaminaOrb.FillTo(1.0 - %this.GetEnergylevel());
if (%this.getState() $= "Dead")
return;
%this.schedule(100, "UpdateStaminaOrb");
}
in my player.cs file, and I've tried putting code in other .cs files (including in the client >> default.bind.cs file) but none of it seems to work. My question is - where do I put a setenergylevel update snippet when my character moves so my stamina is lowered??
Thanks.
GH
---and in case it's thought to be mentioned, I've poured over the forums already and can't seem to find the solution so if you have a suggestion on finding such noob solutions I'm all about "learning to fish rather than being fed the fish"
About the author