RedxYeti Posted February 26, 2022 Share Posted February 26, 2022 Say I have a specific Reference Alias of the Agility BobbleHead. The Player might not encounter that bobblehead for tens of hours. Since its a specific reference will an OnLoad script still run on it after hours of gameplay just using "Start Game Enabled"? Or should I refill the reference some how? Link to comment Share on other sites More sharing options...
LarannKiar Posted February 26, 2022 Share Posted February 26, 2022 The OnLoad event fires when the object is loaded. However, the event can't be sent by an empty Reference Alias: if the alias hasn't been filled, it doesn't point to an object and a "None" object can't send events. The script has to know what object is loaded. So, you have to fill the Reference Alias too, Start Game Enabled isn't enough. Link to comment Share on other sites More sharing options...
RedxYeti Posted February 26, 2022 Author Share Posted February 26, 2022 The OnLoad event fires when the object is loaded. However, the event can't be sent by an empty Reference Alias: if the alias hasn't been filled, it doesn't point to an object and a "None" object can't send events. The script has to know what object is loaded. So, you have to fill the Reference Alias too, Start Game Enabled isn't enough. So im using the actual agility bobblehead in game as a specific reference (as in the location its in and the bobblehead as the item). Wouldn't that be enough to fill the reference? also the script is running directly on the alias if that makes any difference. Link to comment Share on other sites More sharing options...
Fantafaust Posted February 26, 2022 Share Posted February 26, 2022 The OnLoad event fires when the object is loaded. However, the event can't be sent by an empty Reference Alias: if the alias hasn't been filled, it doesn't point to an object and a "None" object can't send events. The script has to know what object is loaded. So, you have to fill the Reference Alias too, Start Game Enabled isn't enough. So im using the actual agility bobblehead in game as a specific reference (as in the location its in and the bobblehead as the item). Wouldn't that be enough to fill the reference? also the script is running directly on the alias if that makes any difference. That would fill the reference, yes. They don't de-fill, if that's what you're concerned about. In terms of OnLoad(), it will run when the bobblehead gets its 3D loaded ie when you go into the area, and time is not a factor here. Link to comment Share on other sites More sharing options...
RedxYeti Posted February 27, 2022 Author Share Posted February 27, 2022 That would fill the reference, yes. They don't de-fill, if that's what you're concerned about. In terms of OnLoad(), it will run when the bobblehead gets its 3D loaded ie when you go into the area, and time is not a factor here. Perfect, thank you. That is what I was concerned about. Link to comment Share on other sites More sharing options...
Recommended Posts