I want to revert all vars on a mob to their initial value.
I tried looping thru their vars list and doing var_name=initial(var_name) on each one.
This works fine until it reaches a read-only var, then it gives an error that I can't change read-only vars, then the loop stops.
How can I skip read-only vars? I don't know of any way to differentiate between vars and read only vars.
Thanks
Apr 13 2014, 2:47 pm
Best response
|
|
Look up the issaved() proc in the DM ref
|
Thanks. It works. Except that it skips tmp vars. Is there a way to recognize those? They need to be reset as well
|
Well..
Creating a copy of the vars list and removing known read-onlys works: mob/verb/Reset_Variables() However, if you are wanting to do something like this to reset players, there is a much simpler way. mob/verb/Reset_Variables_2() |