- Joined
- Sep 25, 2021
- Messages
- 28
Context
Looking at my functional system that changes weapon types in a "Unit", I wonder if this is creating a memory leak.
The system uses the following triggers:
How it Works:
The unit in question exists already in the map and has the three abilities represented in each condition (Metamorphosis (Normal to Magic); Bear Form (Magic to Siege); Storm Crow Form (Siege to Normal)).
Now, like the name says, each ability is a different morph ability that uses alternately the "Data - Normal Form Unit" and "Data - Alternate Form Unit" like this:
Metamorphosis (Normal to Magic): Data - Normal Form Unit: Blackrock Smith (Normal); Data - Alternate Form Unit: Blackrock Smith (Magic);
Bear Form (Magic to Siege): Data - Normal Form Unit: Blackrock Smith (Magic); Data - Alternate Form Unit: Blackrock Smith (Siege);
Storm Crow Form (Siege to Normal): Data - Normal Form Unit: Blackrock Smith (Siege); Data - Alternate Form Unit: Blackrock Smith (Normal);
How it appears:
The system seems to work as intended: Whenever the Unit (Blackrock Smith (Normal)) uses Metamorphosis it will turn into a similar unit (Blackrock Smith (Magic)) with the previous unit stats (exp, str, int, agi, ...). Then Metamorphosis gets disabled and only Bear Form can be used by Blackrock Smith (Magic). By using Bear Form, this unit becomes Blackrock Smith (Siege) with only Storm Crow Form ability enabled.
What it might be doing:
Now here's the part where I'm guessing it might create memory leaks:
When Blackrock Smith (Siege) uses Storm Crow Form to become Blackrock Smith (Normal), is it creating a new unit (a Blackrock Smith (Normal)01), maintaining the initial unit in the data along with this new one? Is it deleting it? Is it reversing exactly to the data referencing to that initial unit?
This also because I'm never using turn off on these abilities, only Turn On and so on.
If it is creating memory leaks, please reply to this thread so I can disable this on the map I'm currently working on. If there are better ways to do it (change three times the attack type value from a Hero unit), please reply as well.
Otherwise, how can I detect if it is creating leaks?
I know that at least it is possible to change two times the attack type value from a Hero unit with Attack 1 and Attack 2 switches.
Looking at my functional system that changes weapon types in a "Unit", I wonder if this is creating a memory leak.
The system uses the following triggers:
-
DoomhammerAbility
-
Events
- Unit - A unit owned by Player 1 (Red) Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Metamorphosis (Normal to Magic)
-
Actions
- Player - Disable Metamorphosis (Normal to Magic) for Player 1 (Red)
- Player - Enable Bear Form (Magic to Siege) for Player 1 (Red)
-
Events
-
DoomhammerAbility02
-
Events
- Unit - A unit owned by Player 1 (Red) Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Bear Form (Magic to Siege)
-
Actions
- Player - Disable Bear Form (Magic to Siege) for Player 1 (Red)
- Player - Enable Storm Crow Form (Siege to Normal) for Player 1 (Red)
-
Events
-
DoomhammerAbility03
-
Events
- Unit - A unit owned by Player 1 (Red) Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Storm Crow Form (Siege to Normal)
-
Actions
- Player - Disable Storm Crow Form (Siege to Normal) for Player 1 (Red)
- Player - Enable Metamorphosis (Normal to Magic) for Player 1 (Red)
-
Events
How it Works:
The unit in question exists already in the map and has the three abilities represented in each condition (Metamorphosis (Normal to Magic); Bear Form (Magic to Siege); Storm Crow Form (Siege to Normal)).
Now, like the name says, each ability is a different morph ability that uses alternately the "Data - Normal Form Unit" and "Data - Alternate Form Unit" like this:
Metamorphosis (Normal to Magic): Data - Normal Form Unit: Blackrock Smith (Normal); Data - Alternate Form Unit: Blackrock Smith (Magic);
Bear Form (Magic to Siege): Data - Normal Form Unit: Blackrock Smith (Magic); Data - Alternate Form Unit: Blackrock Smith (Siege);
Storm Crow Form (Siege to Normal): Data - Normal Form Unit: Blackrock Smith (Siege); Data - Alternate Form Unit: Blackrock Smith (Normal);
How it appears:
The system seems to work as intended: Whenever the Unit (Blackrock Smith (Normal)) uses Metamorphosis it will turn into a similar unit (Blackrock Smith (Magic)) with the previous unit stats (exp, str, int, agi, ...). Then Metamorphosis gets disabled and only Bear Form can be used by Blackrock Smith (Magic). By using Bear Form, this unit becomes Blackrock Smith (Siege) with only Storm Crow Form ability enabled.
What it might be doing:
Now here's the part where I'm guessing it might create memory leaks:
When Blackrock Smith (Siege) uses Storm Crow Form to become Blackrock Smith (Normal), is it creating a new unit (a Blackrock Smith (Normal)01), maintaining the initial unit in the data along with this new one? Is it deleting it? Is it reversing exactly to the data referencing to that initial unit?
This also because I'm never using turn off on these abilities, only Turn On and so on.
If it is creating memory leaks, please reply to this thread so I can disable this on the map I'm currently working on. If there are better ways to do it (change three times the attack type value from a Hero unit), please reply as well.
Otherwise, how can I detect if it is creating leaks?
I know that at least it is possible to change two times the attack type value from a Hero unit with Attack 1 and Attack 2 switches.