script help pls

Post » Tue May 17, 2011 2:32 pm

why isnt this working? i modified a script i got from another. im not going to release it, itss just for my own use. its supposed to heal my unbroken limbs and health by an amount equal to my END for every hour of sleep.thanx

scn aLimbRegen; limb regen IF not brokenfloat HealValuefloat HealRatefloat SleepTimeshort PerkBonus;Int EnduValueInt OncePerBegin MenuMode	If GetPCSleepHours != 0 && OncePer == 0		Set SleepTime to GetPCSleepHours		Set PerkBonus to 1		         		 if (player.HasPerk FastMetabolism) == 1               Set PerkBonus to 2		Endif		Set HealRate to (Player.GetAV Endurance * PerkBonus)			Set HealValue to HealRate * SleepTime		if player.GetActorValue PerceptionCondition > 0			Player.RestoreActorValue PerceptionCondition HealValue		Endif		if player.GetActorValue EnduranceCondition > 0			Player.RestoreActorValue EnduranceCondition HealValue		Endif		if player.GetActorValue LeftAttackCondition > 0			Player.RestoreActorValue LeftAttackCondition HealValue		Endif		if player.GetActorValue RightAttackCondition > 0			Player.RestoreActorValue RightAttackCondition HealValue		Endif		if player.GetActorValue LeftMobilityCondition > 0			Player.RestoreActorValue LeftMobilityCondition HealValue		Endif		if player.GetActorValue RightMobilityCondition > 0			Player.RestoreActorValue RightMobilityCondition HealValue		Endif		Player.RestoreAV Health HealValue	Endif	Set OncePer to 1EndBegin GameMode	If OncePer == 1		Set OncePer to 0	EndifEnd

User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am

Post » Tue May 17, 2011 2:28 pm

It looks like it should work if you move "Set OncePer to 1" somewhere between the If and Endif.
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Tue May 17, 2011 3:47 pm

                if player.GetActorValue PerceptionCondition > 0                        Player.RestoreActorValue PerceptionCondition HealValue                Endif


I don't think this is the problem, but if the perception condition is above 0, then you heal? Shouldn't it heal if below 100 (i.e. damaged)?
User avatar
clelia vega
 
Posts: 3433
Joined: Wed Mar 21, 2007 6:04 pm

Post » Tue May 17, 2011 3:54 pm

He has it as if > 0 because he wants it only to restore unbroken body parts.
User avatar
Ryan Lutz
 
Posts: 3465
Joined: Sun Sep 09, 2007 12:39 pm

Post » Tue May 17, 2011 3:53 am

yes, like pelinor said. <100 would make it heal even broken limbs right? ill try the suggestion later. thanks!
User avatar
Angela
 
Posts: 3492
Joined: Mon Mar 05, 2007 8:33 am

Post » Tue May 17, 2011 10:27 am

yes, like pelinor said. <100 would make it heal even broken limbs right? ill try the suggestion later. thanks!


Well, unless you added an && in the condition, then it would ignore both completely broken and completely healed limbs.

I missed the part of your post that mentioned healing only unbroken limbs on my first read. My bad.
User avatar
Add Me
 
Posts: 3486
Joined: Thu Jul 05, 2007 8:21 am

Post » Tue May 17, 2011 8:00 am

Hey Pelinor, it seems to be working now. thanks a lot! :tops:
User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm


Return to Fallout: New Vegas