Crestfall Posted February 13, 2012 Share Posted February 13, 2012 I think use UnregisterForUpdateGameTime() Link to comment Share on other sites More sharing options...
Galacticat42 Posted February 13, 2012 Share Posted February 13, 2012 I'm pretty sure that (Un)registerForUpdateGameTime() extends the Form script so he'll have to reference it like I showed. Link to comment Share on other sites More sharing options...
GomuGomu64 Posted February 13, 2012 Author Share Posted February 13, 2012 (edited) Should be Form.UnregisterForUpdateGameTime()And of course you'll need to match it with Form.RegisterForUpdateGameTime(.25) *Sigh* It fixed that one error, and has given me two more (Well, the same error twice) scriptName Hunger extends Quest int Property iAAGGHunger = 100 auto ;This is the script default when you start a new game or start the plugin. Function AAFunction() debug.MessageBox("Hunger plugin loaded!") endFunction Function AAAFunction() Form.RegisterForUpdateGameTime(0.25) endFunction Event OnUpdateGameTime() if iAAGGHunger > 1 iAAGGHunger -= 1 ; -= means that Hunger = Hunger - 1 elseif iAAGGHunger == 1 ; This means that the code checks if the value is at 1 Game.GetPlayer().ModActorValue("health", 0) debug.MessageBox("Oh dear. You didn't eat, so you died. Sucks to be you!") elseif iAAGGHunger <=10 debug.MessageBox("Ah, your stomach beckons for bacon. Might be a good idea to eat. You know, being hungry and all.") endif Form.UnregisterForUpdateGameTime() endEvent Event OnActivate(ObjectReference akActionRef) if iAAGGHunger == 99 iAAGGHunger += 1 debug.MessageBox("Your belly is full, your mouth tastes fantastic. Life is good.") elseif iAAGGHunger == 100 debug.MessageBox("You have already eaten! You don't want to get indigestion, now.") elseif iAAGGHunger == 50 debug.MessageBox("The gurgling has stopped, but you probably eat more. You fat pig.") endif endEvent And the error is C:\Program Files\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\Hunger.psc(10,7): cannot call the member function RegisterForUpdateGameTime alone or on a type, must call it on a variableC:\Program Files\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\Hunger.psc(23,13): cannot call the member function UnregisterForUpdateGameTime alone or on a type, must call it on a variableNo output generated for Hunger, compilation failed. Also, thanks again for your help so far. I am really obliged to you guys :D Edited February 13, 2012 by GomuGomu64 Link to comment Share on other sites More sharing options...
Crestfall Posted February 13, 2012 Share Posted February 13, 2012 Form is a general type, you need to actually have a form object. I'm not sure but if you don't put anything before Register/UnregisterForUpdateGameTime it will implicitly use the current script. You can try like Hunger.UnregisterForUpdateGameTime(). Link to comment Share on other sites More sharing options...
Galacticat42 Posted February 13, 2012 Share Posted February 13, 2012 (edited) Looking at Creationkit.com you should get rid of the unregister line. @CrestfallThe custom script Hunger isn't a script library and thus will put out an error. The Quest script library doesn't handle game time and so Form would be the only plausible thing to use. Should you try to use it as an extension of the main script that you're using, then get rid of the prefix. Edited February 13, 2012 by Budz42 Link to comment Share on other sites More sharing options...
GomuGomu64 Posted February 13, 2012 Author Share Posted February 13, 2012 Form is a general type, you need to actually have a form object. I'm not sure but if you don't put anything before Register/UnregisterForUpdateGameTime it will implicitly use the current script. You can try like Hunger.UnregisterForUpdateGameTime(). Egh. It gave the same errors as before. Sheesh. What started out as a simple variable changer has become so complicated. I much prefer Lua than to papyrus XD Link to comment Share on other sites More sharing options...
Galacticat42 Posted February 13, 2012 Share Posted February 13, 2012 @GomuGomu Yea... I started out with Flash's ActionScript 2.0 in 9th grade, went to C++ in 12th and after learning C++ all the other languages just figured themselves out for me. Link to comment Share on other sites More sharing options...
GomuGomu64 Posted February 13, 2012 Author Share Posted February 13, 2012 Heh. I've always wanted to learn C++, but I can't find a good book/site that teaches me it....Feel free to recommend one XD I must ask (Again with the questions! Does this guy ever shut up?), do you know what might be causing that error? I'm at your mercy XD Link to comment Share on other sites More sharing options...
WiseMan999 Posted February 13, 2012 Share Posted February 13, 2012 (edited) Don't put Form.UnregisterForUpdateGameTime, just put UnregisterForUpdateGameTime. As a suggestion, I think its actually UnregisterforUpdateGameTime, at least it is that way in the script I'm looking at. EDIT: Also, how long is it supposed to take to reach death? At the moment I think it will take about 25 seconds to die from hunger :D. Edited February 13, 2012 by WiseMan999 Link to comment Share on other sites More sharing options...
GomuGomu64 Posted February 13, 2012 Author Share Posted February 13, 2012 ...I see what you mean. I'll make it that it goes down every hour. Make it take a few days to die :3 By the way, thanks for that. It compiled! Time to see if it works >:3 Link to comment Share on other sites More sharing options...
Recommended Posts