Jump to content
Sign in to follow this  
XXon

Global variable vs module variable?

Recommended Posts

My script uses a global variable, just within the script itself (a wizard pet). I want to make another pet, very similar, it has the same variable setup to keep track of its targets, only now, because they are global, the two pets overwrite each other. I see the setting for module variable vs global variable, is that what I need and how does it work, please? I find no info on modules. Or what would be the correct, solution, if that is not it.

Thanks

Share this post


Link to post
Share on other sites

The best way to do this imo is to use an entity storage or game logic storage. You can create variables and instructions inside here. then you assign the storage to your wizard, and other pets. all these variables and instructions will be unique for each pet

  • Like 2

Share this post


Link to post
Share on other sites

oh I see. I did not know that existed.

Thank you again!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×