Jump to content

World script changes do not have effect


photo

Recommended Posts

Posted

Hi

 

I have a world script that creates some objects in the world.

When I change some values in the script and rerun Unigine the changes have no effect.

Only when renaming the world files to some new name and loading those files will have the correct result.

 

Are scripts cached and do I need to clear this cache?

Posted

Assuming you are creating objects on the fly and not adding them to the editor you will need to track these and clear them out when shutdown is run in your world script.

Posted

Thanks Danni

Can you explain why this is?

When I quit Unigine and run it again, why are the objects not correctly generated when I do not clear at shutdown?

Posted

I am guessing here.

They should be generated again...

If the ones you already created are not removed.

if you are checking if the objects exist before creating them than you might not end up creating new objects.

Posted

I'm talking about a complete fresh rerun of Unigine. So nothing will be in it initially.

It just loads a world corresponding to on old world file.

 

Anybody knows if there is some kind of caching involved that causes this?

Posted

Ok are you adding the objects to the editor (are they being stored in the world file?)

Do you have a small piece of example code you can post?

Posted

Are scripts cached and do I need to clear this cache?

No cache for scripts whatsoever. Every time you run the script anew (reload the world or relaunch the app), objects would be initialized. That is the reason you should not forget to delete them or you will run out of memory.

×
×
  • Create New...