Jump to content

Need Help with Fallout 3 Script Syntax


MrGoostoff

Recommended Posts

Hey everyone, lately I decided to try my hand at scripting. I decided to go with something that would be challenging, but not too complex. I ended up deciding to modify the script for the Medic Power Armor so that when your health drops below 50%, the armor will slowly heal you up to 50%.

I wrote what I thought would make the script work, saved with no problems, but testing showed that health would not regenerate, even when I 0.05% of my total health.

Now, I am a noob, so bare with me as this script is probably no where near what it should be:

 

 

("..." indicates part of the script that was there before and doesn't have to do with my script)

 

...
Float HealthRegen
...
If Player.GetEquipped MS14PowerArmorMorphine == 1
  If Player.GetHealthPercentage > 0.50 && Player.GetAV Health > 0
  Set HealthRegen to ScriptEffectElapsedSeconds / 1
	 RestoreAV Health HealthRegen
  ElseIf Player.GetHealthPercentage >= 0.50
	 Set HealthRegen to ScriptEffectElapsedSeconds / 0
  EndIf
  EndIF
End

 

As I said, this is probably not even close to being right, but it's my first script! :)

Any help would be appreciated!

 

-MrGoostoff

Link to comment
Share on other sites

Hi :) Here's a bit of food for thought for you. I haven't actually tested this script in GECK, but here we go, maybe someone else can point if there's something wrong :D

 

scn ArmorRegen

Begin OnEquip

short healthRegen;Not actually needed, you can set the value without a variable.
float fTimer
set fTimer to 1;1=1 second, raise this if needed for bigger interval between ticks.
set healthRegen to 5;Amount of health to raise. Variable is not really needed for this.
end

Begin GameMode
if Player.GetEquipped MS14PowerArmorMorphine == 1;No idea what this item is and why is it checked here?
	if Player.GetHealthPercentage < 0.50 && Player.GetAV Health > 0
		if fTimer > 0;I think using a timer here gives you better control over the effect.
			set fTimer to fTimer - GetSecondsPassed
		else
			RestoreAV Health healthRegen;You can set this to the amount to heal instead of using the variable.
			set fTimer to 1
		endif
	endif
endif
End

Link to comment
Share on other sites

-snip-

The MS14PowerArmorMorphine is the Medic Power Armor. I put the line there because I really made this script by observing other scripts, and I guess it's there to make sure that the Armor is equipped, so you don't get the advantages if it's in your inventory? I dunno.

 

EDIT: Just tried out the code, didn't work :( this sucks! :P

Link to comment
Share on other sites

Did you try the code separately, or as a part of the code that is already there? If I remember right, I tried the armor a while back when I wasn't yet familiar with FO3 scripts, and didn't get the armor to work at all... :) As for the reason why my script didn't work, I have no idea... I might try it out tomorrow when I have time for GECK.

 

The check for the item indeed needs to be there so it will stop regeneration when unequipped.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...