virginharvester Posted September 11, 2018 Share Posted September 11, 2018 Scriptname EquilibriumScript extends Quest MiscObject Property Gold001 Auto Event OnInit(); RegisterForSingleUpdate(1.0); EndEvent Event OnUpdate() Debug.Notification("Hello, world!") Game.GetPlayer().addItem(Gold001, 1) EndEvent sorry if my eng;lish bad,i recently play this game again, and moding again, and after some time my skiill is seems lower, even i forget this script, this script is runing, but only once, any idea what i do wrong?note : "hello world" only appear once,and thanks fpr reading Link to comment Share on other sites More sharing options...
FrankFamily Posted September 11, 2018 Share Posted September 11, 2018 (edited) Well, of course it only runs once, you've used registerforSINGLEupdate once. Either use RegisterForUpdate or repeat the registering at the end of OnUpdate to chain them, like this: Scriptname EquilibriumScript extends Quest MiscObject Property Gold001 Auto Event OnInit(); RegisterForSingleUpdate(1.0); EndEvent Event OnUpdate() Debug.Notification("Hello, world!") Game.GetPlayer().addItem(Gold001, 1) RegisterForSingleUpdate(1.0); EndEvent Edited September 11, 2018 by FrankFamily Link to comment Share on other sites More sharing options...
virginharvester Posted September 11, 2018 Author Share Posted September 11, 2018 Well, of course it only runs once, you've used registerforSINGLEupdate once. Either use RegisterForUpdate or repeat the registering at the end of OnUpdate to chain them, like this: Scriptname EquilibriumScript extends Quest MiscObject Property Gold001 Auto Event OnInit(); RegisterForSingleUpdate(1.0); EndEvent Event OnUpdate() Debug.Notification("Hello, world!") Game.GetPlayer().addItem(Gold001, 1) RegisterForSingleUpdate(1.0); EndEventah thanks a lot, that will clear my problem, thanks again Link to comment Share on other sites More sharing options...
foamyesque Posted September 11, 2018 Share Posted September 11, 2018 Note: Using RegisterForUpdate is a bad idea, in general, because it won't go away if something unexpected (for example, uninstalling the mod) happens. RegisterForSingleUpdate(), with another RegisterForSingleUpdate() inside the OnUpdate() event, avoids those problems. Link to comment Share on other sites More sharing options...
Recommended Posts