Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
reload
Events
Player - Player 1 (Red) types a chat message containing -reload as An exact match
Conditions
Actions
Item - Set charges remaining in <your item variable> to 20

Reload Gun

Events


Player - Player 1 (Red) types a chat message containing reload as An exact match

Conditions

Actions


Set Unit = (Triggering unit)


Item - Set charges remaining in (Item carried by Unit of type Railgun) to 0


Wait 3.00 seconds


Item - Set charges remaining in (Item carried by Unit of type Railgun) to 15
Here's the trigger i did(it didnt work)
Reload Gun
Events
Player - Player 1 (Red) types a chat message containing reload as An exact match
Conditions
Actions
Set Unit = (Triggering unit)
Item - Set charges remaining in (Item carried by Unit of type Railgun) to 0
Wait 3.00 seconds
Item - Set charges remaining in (Item carried by Unit of type Railgun) to 15
Reload PGM I

Events


Player - Player 1 (Red) types a chat message containing reloadpgm1 as An exact match

Conditions

Actions


Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)



Loop - Actions




Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Triggering player))) the text: PG Mark I reloaded....




Item - Set charges remaining in (Item carried by (Picked unit) of type PG Mark I) to 16
|
|
^It's only a message, but it has to be "Owner of (PickedUnit)" not "(Owner of (Triggering unit)".
Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Triggering player))) the text: PG Mark I reloaded....
If you put your heroes/units into unit[array] variable, you would not need any group creation at all, as you directly could do this:
(Or can a player have multiple units of this unit type?)
Item - Set charges remaining in (Item carried by Hero[PlayerNumber Of TriggeringPlayer] of type PG Mark I) to 16
You have a group leak at the moment. Leaks should be removed: https://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
(Anyway you probably don't really need this group creation as mentioned above)
Wc3 objects (i.e. handles) use memory and only will deallocate it when being destroyed by the map maker. Look at Things That Leak for a very good overview.And,why are leaks bad anyway? will my map become bad if there is a leak?
Unit - Move (Triggering unit) instantly to (Point(0.00, 0.00))
call SetUnitPositionLoc( GetTriggerUnit(), Location(0, 0) )
Set myLocation = (Point(0.00, 0.00))
Unit - Move (Triggering unit) instantly to myLocation
Custom script: call RemoveLocation(udg_myLocation)
Reload PGM I

Events


Player - Player 1 (Red) types a chat message containing reloadpgm1 as An exact match


Player - Player 2 (Blue) types a chat message containing reloadpgm1 as An exact match


Player - Player 3 (Teal) types a chat message containing reloadpgm1 as An exact match


Player - Player 4 (Purple) types a chat message containing reloadpgm1 as An exact match


Player - Player 5 (Yellow) types a chat message containing reloadpgm1 as An exact match


Player - Player 6 (Orange) types a chat message containing reloadpgm1 as An exact match


Player - Player 7 (Green) types a chat message containing reloadpgm1 as An exact match


Player - Player 8 (Pink) types a chat message containing reloadpgm1 as An exact match


Player - Player 9 (Gray) types a chat message containing reloadpgm1 as An exact match


Player - Player 10 (Light Blue) types a chat message containing reloadpgm1 as An exact match

Conditions

Actions


Custom script: set bj_wantDestroyGroup = true


Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)



Loop - Actions




Game - Display to (All players matching ((Owner of (Picked unit)) Equal to (Triggering player))) the text: PG Mark I reloaded....




Item - Set charges remaining in (Item carried by (Picked unit) of type PG Mark I) to 16
Um its not a test,I'm using that on my map right nowIn your Game - Display message you leak a player group. But as this was only for test I guess (if you remove it), you don't leak anymore.
so, now i have a player group leak? how to fix it?
|
|
