Jump to content

Requesting Scripting Help


Thromnambular

Recommended Posts

First:

I'd love to know what I can do with the Begin keyword. Let me explain, before you roll your eyes, because I know how the question sounds. I've used it to make scripts activate when you pick something up or when an effect goes off and calls the script, but how about a script that is called when a player levels up?

 

Second:

Can scripts access and change values found under Gameplay->Settings in the Geck? If so, how--do I just use the variable's name (eg: valuexyz = ab + c) or do I have to call a mutator function?

 

This is what I have so far in relation to the two points above, where I try to give the player an extra amount of Health when they level up:

 

scn MyHP

Begin MenuMode 1027
ModActorValue Health 2

End

 

According to the wiki, Begin MenuMode 1027 should make the script execute every frame while the game is in the specified menu mode (in this case 1027, which is the level up menu,) but I have two problems with this. The script isn't actually executing, and I only want it to execute ONCE.

Link to comment
Share on other sites

Is your script an object or quest script? What object or quest did you attach it to?

 

If you were to use a quest script, you'll need to explicity define what reference you want to call modactorvalue on. Plus you'll also have to make a quest to attach your script to. For the quest, give it an id, choose your script, check start game enabled, and type in 1 in the box next to default. You can ignore all the other tabs along the top.

 

I would change your script to something like this:

scn myhp
short level

begin menumode 1027
if player.getlevel != level
    player.modav health 2
    set level to player.getlevel
endif
end

Link to comment
Share on other sites

Thanks, documn! :thumbsup:

With a couple tweaks I can even make this script act retroactively on the player's health.

 

Something like this:

scn ThromHealthProgressionSCRIPT
short level

Begin MenuMode 1027

if Player.GetLevel != level
	short newPlayerHealth
	set newPlayerHealth to 100 + (Player.GetLevel - 1) * 5 + Player.GetActorValue Endurance * 2 * (Player.GetLevel - 1) + Player.GetActorValue Endurance * 20
  	 	Player.ForceAV health newPlayerHealth
  	 	set level to Player.GetLevel
EndIf

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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