reaper9111 Posted July 16, 2012 Share Posted July 16, 2012 (edited) 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 July 16, 2012 by reaper9111 Link to comment Share on other sites More sharing options...
gasti89 Posted July 16, 2012 Share Posted July 16, 2012 (edited) 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 July 16, 2012 by gasti89 Link to comment Share on other sites More sharing options...
flobalob Posted July 16, 2012 Share Posted July 16, 2012 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 More sharing options...
gasti89 Posted July 16, 2012 Share Posted July 16, 2012 (edited) 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 July 16, 2012 by gasti89 Link to comment Share on other sites More sharing options...
reaper9111 Posted July 16, 2012 Author Share Posted July 16, 2012 Hey, guy's sweet to see some interest... Thanks a thousand time !Will test this imediatly and get back to you guys ! Reaper Link to comment Share on other sites More sharing options...
1mike44 Posted July 16, 2012 Share Posted July 16, 2012 (edited) You wrote "GoToStage("NotReady") Should be: GoToState("NotReady") Just in case somebody is directly copying this, Edited July 16, 2012 by 1mike44 Link to comment Share on other sites More sharing options...
gasti89 Posted July 16, 2012 Share Posted July 16, 2012 Oups! Happens when you don't have the CK to tell you compiling errors, i'm sorry. Link to comment Share on other sites More sharing options...
reaper9111 Posted July 16, 2012 Author Share Posted July 16, 2012 (edited) 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 July 16, 2012 by reaper9111 Link to comment Share on other sites More sharing options...
flobalob Posted July 16, 2012 Share Posted July 16, 2012 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 More sharing options...
flobalob Posted July 16, 2012 Share Posted July 16, 2012 I only need help to know what are the property and what type are they and connected to what ?Can anyone help ? Reaper By property, do you mean what you can change instead of "Health" or "Stamina". if so the full list is here Link to comment Share on other sites More sharing options...
Recommended Posts