- Joined
- Dec 8, 2005
- Messages
- 8
Yo,
i try to create all my maps with no leaks at all. (yes jass would be better to do that but i seem to get it mostly to work in GUI aswell)
Its for an footiewars iam working on, i create an location in the map initilization using this trigger:
and then mostly the bold part. Iam not sure if this would leak as it doesnt use an unitgroup but an unit.
Then every X seconds i run this trigger:
At the bold part i create my unit. Now when calling this trigger does it leak? Since i dont destroy my location i thought it might leak but doing the location creating part everyone time might be a tad slower?
(edit it seems the bold part doesnt work when i use
i try to create all my maps with no leaks at all. (yes jass would be better to do that but i seem to get it mostly to work in GUI aswell)
Its for an footiewars iam working on, i create an location in the map initilization using this trigger:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) == Is unused
Then - Actions
Set player_units[(Integer A)] = (Units owned by (Player((Integer A))))
Unit Group - Pick every unit in player_units[(Integer A)] and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Unit Group - Destroy player_units[(Integer A)]
Else - Actions
Player - Add 650 to (Player((Integer A))) Current gold
[b]Set player_main_location[(Integer A)] = (Position of (Find the first unit next to (Center of (Playable map area)) that matches (((Unit-type of (Matching unit)) == Basic Building (Tier 0)) and ((Owner of (Matching unit)) == (Player((Integer A)))))))[/b]
Unit - Create 1 hero_types[(Random integer number between 1 and 16)] for (Player((Integer A))) at player_main_location[(Integer A)] facing Default building facing (270.0) degrees
Hero - Give (Last created unit) a Scroll of Town Portal in slot 1
Hero - Give (Last created unit) a Wiebbe's necklace or power in slot 0
and then mostly the bold part. Iam not sure if this would leak as it doesnt use an unitgroup but an unit.
Then every X seconds i run this trigger:
Code:
Spawn Player 1
Events
Time - player_spawn_timer[1] expires
Conditions
Actions
Set unit_spawn_group[1] = (Units owned by Player 1 (Red))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in unit_spawn_group[1]) > 100
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: |cFFFF0000You have ...
Else - Actions
[b]Unit - Create 1 player_main_spawn[1] for Player 1 (Red) at player_main_location[1] facing Default building facing (270.0) degrees[/b]
Unit Group - Destroy unit_spawn_group[1]
At the bold part i create my unit. Now when calling this trigger does it leak? Since i dont destroy my location i thought it might leak but doing the location creating part everyone time might be a tad slower?
(edit it seems the bold part doesnt work when i use
Code:
so check the parts with [b] infron of them)