In many of my mods I'm making it would be wonderful to be able to reload an object periodically so random numbers are reloaded and changed. It would be a very helpful. Thanks!
It could be used as:
sysReload- which reloads everything, or
objReload- which reloads the object in question
[Suggestion] sysReload
-
- Fleet Officer
- Posts: 1036
- Joined: Wed Feb 03, 2010 4:28 am
- Location: Researching how to make St. Kats star go supernova.
- Contact:
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
My suggestion would be to manually add code to reload the variables that you want. I can't see a way to find every variable placed on an object and 'refresh' it, sometimes you don't want certain ones refreshed, and most would end up being the same value anyways.
One way to accomplish this refresh would be to make an event on the object in question, in that event, place code to refresh/recalculate only the variables you need and you can call that event from the console whenever needed.
(objFireEvent obj event)
To simplify it even further, add a global helper function to fire the event when necessary:
This requries the object in question have an event called "RefreshEvent" that will do what you're asking, which I can't really help you with without knowing more about your code.
One way to accomplish this refresh would be to make an event on the object in question, in that event, place code to refresh/recalculate only the variables you need and you can call that event from the console whenever needed.
(objFireEvent obj event)
To simplify it even further, add a global helper function to fire the event when necessary:
Code: Select all
<globals>
(setq refreshVars (lambda (obj)
(block (target)
(if obj (setq target obj) (setq target (objgettarget gplayership))
(objFireEvent target 'RefreshEvent)
)
)
</globals>
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
-
- Fleet Officer
- Posts: 1036
- Joined: Wed Feb 03, 2010 4:28 am
- Location: Researching how to make St. Kats star go supernova.
- Contact:
Ok. I was just trying to make a stargate that sends you to a random location which is different each time you enter it. I wanted to be able to have the random topology refresh every few seconds.
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?