Jump to content

workshop activate item links and keywords


bud9961

Recommended Posts

The symptoms you are seeing (have to leave and return) are typically liked to scripts using the OnLoad or OnUnload event or script states to manage settings.

 

If the script runs when the object is created all is good, but if the script is deferred nothing happens until the object can unload and reload in the uGridsToLoad active area around the player.

Link to comment
Share on other sites

The symptoms you are seeing (have to leave and return) are typically liked to scripts using the OnLoad or OnUnload event or script states to manage settings.

 

If the script runs when the object is created all is good, but if the script is deferred nothing happens until the object can unload and reload in the uGridsToLoad active area around the player.

thanks good to know i think im unlikely to make this mistake again lol it turned a 5 min change into a day wasted problem

Link to comment
Share on other sites

There is OnInit(), which I use to circumvent this issue. Basically, OnInit fires whenever an object is first introduced to the game and then only ever again when the area around it reset (should never happen for workshops). The area around the object doesn't have to be loaded for OnInit to fire.

Event OnInit()
	Load()
EndEvent

Event OnLoad()
	Load()
EndEvent

Function Load()
	If (Is3DLoaded())
            ; stuff to do only when 3D for the object is loaded
        Else
            ; stuff to do only when 3D for the object is not loaded
	EndIf
        ; stuff that's always to do
EndFunction
Link to comment
Share on other sites

  • Recently Browsing   0 members

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