the short: you cannot delete variabels
Sc2 automatically cleans up after itself, in most cases. The big cases where it doesnt, is with actors. If you create them with a trigger, you need to remove them with a trigger. If you fail to properly remove them through actor events.
My project has something like 100,000 variables, and only uses 2% of available game memory to store the variables.
If variable count worries you, you can use user types instead, to store data; so you do not have the variables in the game.
If you want to make your own life difficult, you can re-use global variables, so once it is no longer needed, it is used for a new purpose.
All triggers are built at the start of a game before any of them are run.
This means that any variables used in events are set to null (unless they are a pre-existing value ex. preplaced units, declared integers).
However it is possible to add events using functions based on the native commands. If you want to use "new" variables and then delete them you can look to the datatable for this purpose.
I also feel it necessary to point out that you will almost never need to dynamically create and destroy global variables in SC2 (note the almost), if you really are just creating a temporary dialog it would be better to use the datatable for that purpose (really you should just destroy the dialog and reuse those variables for another dialog you make/use in the game).
And we use that variable through various events.
by the way!
I would like to delete it if that variable becomes useless later.
In other words! I would like to release memory.
Ultimately, you need to statically generate the variables.
However,! The GUI does not support static variables.
So is there a way to use static variables in the GUI?
To the best of my knowledge, I know that only local and global variables are used.
How will there be a way ...?
In the DeleteButtonVariable trigger,
I want to delete the variables dialogBox and button.
So, what you need in the end!
It is to delete that variable at the desired position.
There are global variables already declared on the GUI.
At this time I know that you can not delete that variable during the game.
So if!
If you want to delete some variables in the middle of the game ....
Are you declaring variables using Script?
If so, how do you use it?
Could you tell us how to use it?
Or maybe!
I would like to use the same class as used in Calc Java.
In other words! We want to assign and delete classes and variables dynamically.
the short: you cannot delete variabels
Sc2 automatically cleans up after itself, in most cases. The big cases where it doesnt, is with actors. If you create them with a trigger, you need to remove them with a trigger. If you fail to properly remove them through actor events.
My project has something like 100,000 variables, and only uses 2% of available game memory to store the variables.
If variable count worries you, you can use user types instead, to store data; so you do not have the variables in the game.
If you want to make your own life difficult, you can re-use global variables, so once it is no longer needed, it is used for a new purpose.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
All triggers are built at the start of a game before any of them are run.
This means that any variables used in events are set to null (unless they are a pre-existing value ex. preplaced units, declared integers).
However it is possible to add events using functions based on the native commands. If you want to use "new" variables and then delete them you can look to the datatable for this purpose.
I also feel it necessary to point out that you will almost never need to dynamically create and destroy global variables in SC2 (note the almost), if you really are just creating a temporary dialog it would be better to use the datatable for that purpose (really you should just destroy the dialog and reuse those variables for another dialog you make/use in the game).
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)