Jump to content

Scrip Help / Request (Simple)


reaper9111

Recommended Posts

Hello guy's, since i barely understand the new scripting language of skyrim, i turn to the community for helping me with this...

What i would like to achive here is:

the player activate a chair sit on it, and that chair will raise the PC's Staminia by 1 point once a day only, and block the pc movement for 10 in game second while the pc is siting on that chair !

 

Can anyone work this out for me, This is to go with the next update of my popular Dark Tower mod... Credit will be given for your help !

Thanks a lot !

Reaper

 

Edit:

I'm also looking for guide line on how to make an npc play a specific animation at a specific location... (a dance animation)

I know the basic of creating dialogue, since the animation will be trigger via dialogue...

Edited by reaper9111
Link to comment
Share on other sites

I'm not a good scripter, so it might not work. Let me try:

 

Function Register()
   RegisterForUpdateGameTime(24)
EndFunction

Auto State Ready
Event OnActivate(ObjectReference akActionRef)
     if akActionRef == Game.GetPlayer()
          Game.DisablePlayerControls(True, True, True, False, True, False, True)
          Utility.Wait(10)
          Game.GetPlayer().ModAV("Stamina", 1)
          Debug.Notification("You fell stronger")
          Game.EnablePlayerControls()
     endif
     GoToStage("NotReady")
EndEvent
EndState

State NotReady
Event OnUpdateGameTime()
    GoToState("Ready")
EndEvent
EndState

 

Hope it works

 

EDIT: Edited a bit the script with notifications!

Edited by gasti89
Link to comment
Share on other sites

gasti89, You do realise that modav will turn the stat value green like a temporary boost effect, but there is nothing to cause it to "wear off".

 

An alternative to modav is

 

int playersHealth = Game.GetPlayer().GetActorValue("Stamina") as int
Game.GetPlayer().SetActorValue("Stamina", playersHealth +1)

 

It's longer but won't change the colour to the affected attribute/skill etc.

Link to comment
Share on other sites

Oh thanks flob i didn't know that. I often don't have the opportunity to test the scripts and the wiki didn't mention that (at least i can't find any mention ;))

 

So, rewriting the script using flob's suggestion:

 

Function Register()
   RegisterForUpdateGameTime(24)
EndFunction

Auto State Ready
Event OnActivate(ObjectReference akActionRef)
     
int playersHealth = Game.GetPlayer().GetActorValue("Stamina") as int    
     
     if akActionRef == Game.GetPlayer()
          Game.DisablePlayerControls(True, True, True, False, True, False, True)
          Utility.Wait(10)
          Game.GetPlayer().SetActorValue("Stamina", playersHealth +1)
          Debug.Notification("You fell stronger")
          Game.EnablePlayerControls()
     endif
     GoToStage("NotReady")
EndEvent
EndState

State NotReady
Event OnUpdateGameTime()
    GoToState("Ready")
EndEvent
EndState

Edited by gasti89
Link to comment
Share on other sites

Hey guy's i get this error when compiling:

 

Ok, after atypo error on my side it work !

 

I only need help to know what are the property and what type are they and connected to what ?

Can anyone help ?

 

Reaper

Edited by reaper9111
Link to comment
Share on other sites

Oh thanks flob i didn't know that. I often don't have the opportunity to test the scripts and the wiki didn't mention that (at least i can't find any mention ;))

 

snip

 

I haven't seen anything on the wiki about it either, I'm just going by what you see in-game. e.g. activate a shrine and stats/skills that are temporarily boosted are green rather than white. Similarly, catch a disease that reduces them and they turn red.

 

You can simulate this by typing "player.modav health 10" or "player.modav health -10", press "?" to look at your character/skills and your health is green or red respectively.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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