void HungerLoop(object oPC, int iHCount)
{
int iTime = 15; //How often?
object oFood = GetItemPossessedBy(oPC, "LMA_Food");
if ( GetIsObjectValid(oFood))
{
DestroyObject(oFood, 0.0);
iHCount = 0;
}
else
{
iHCount +1;
SendMessageToPC(oPC,"You are hungry!");
}
int iHunger = (2 * iHCount);
effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, iHunger);
ApplyEffectToObject(1, eCon, oPC, IntToFloat(iTime));
if ( GetAbilityScore(oPC, 2, 0) < 4 )
{
ApplyEffectToObject(0, EffectDeath(0, 1), oPC);
}
DelayCommand(IntToFloat(iTime), HungerLoop(oPC, iHCount));
}
void main()
{
object oPC = GetEnteringObject();
int iHCount = 0;
if ( GetAge(oPC) > 0 )
{
DelayCommand(10.0, AssignCommand(oPC, HungerLoop(oPC, iHCount)));
}
}
Need help with a food script
Débuté par
Leoamros1
, août 25 2010 04:35
#1
Posté 25 août 2010 - 04:35
I'm just about ready to pull my hair out with this one, everything seems to work up to the part where it needs to apply an effect. Can any of you please help?
#2
Posté 25 août 2010 - 05:39
lol, I cant believe how much testing I had to do to find this myself.
iHCount +1;
Is an expression only, You need an asingment.
iHCount = iHCount+1 ;
or
++iHCount ;
iHCount +1;
Is an expression only, You need an asingment.
iHCount = iHCount+1 ;
or
++iHCount ;
#3
Posté 25 août 2010 - 06:22
I'm a fool, thanks sometimes you just need an extra set of eyes for the smallest of things.





Retour en haut






