• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Units refuse to move with current trigger.

Status
Not open for further replies.
Level 1
Joined
Jul 14, 2010
Messages
5
Im trying to make 6 units of player10 move to 1 of 2 regions by using this trigger.



[trigger=Send to points]Send to points
Events
Time - Elapsed game time is 55.00 seconds
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 10) Greater than or equal to 5
Then - Actions
Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Unit Group - Order (Units owned by Player 10 (Light Blue)) to Move To Hall[1])
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 10) Less than 5
Then - Actions
Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Unit Group - Order (Units owned by Player 10 (Light Blue)) to Move To Hall[2])
Else - Actions
Do nothing[/trigger]

But in game they never move to the either of the points.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
[trigger=Send to points]
Events
Time - Elapsed game time is 55.00 seconds
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 10) Greater than or equal to 5
Then - Actions
Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Move To [1])
Else - Actions
Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Move To [2])
[/trigger]

And get rid of the leaks.
 
Level 1
Joined
Jul 14, 2010
Messages
5
would this count as removing leaks?

[trigger=Send to points]Send to points
Events
Time - Elapsed game time is 55.00 seconds
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 10) Greater than or equal to 5
Then - Actions
Set tempgroup = (Units owned by Player 10 (Light Blue))
Unit Group - Pick every unit in tempgroup and do (Unit - Order (Picked unit) to Move To Hall[1])
Custom script: call DestroyGroup(udg_tempgroup)
Else - Actions
Set tempgroup = (Units owned by Player 10 (Light Blue))
Unit Group - Pick every unit in tempgroup and do (Unit - Order (Picked unit) to Move To Hall[2])
Custom script: call DestroyGroup(udg_tempgroup)[/trigger]
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
would this count as removing leaks?

Yes, that is how you can clear the unit group leak.

You can also do it like this:
  • Send to points
    • Events
      • Time - Elapsed game time is 55.00 seconds
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 10) Greater than or equal to 5
        • Then - Actions
          • Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Move To Hall[1])
        • Else - Actions
          • Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Move To Hall[2])
The bj_wantDestroyGroup causes the next unit group create by GUI function to be destroyed after it is used.
 
Level 1
Joined
Jul 14, 2010
Messages
5
My next question if then: This trigger here lags every time it activates in my map.

[trigger=MainReinforcements]
Events
Time - Every 420.00 seconds of game time
Conditions
Actions
Game - Display to (All players) the text: |cffff0000Undead Re...
Sound - Play UndeadDissipate2 <gen>
Set UN = (Center of ScourgeSpawnNorth <gen>)
Unit - Create 8 Skeleton Warrior for Player 11 (Dark Green) at UN facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_UN)
Set US = (Center of ScourgeSpawnSouth <gen>)
Unit - Create 8 Skeleton Warrior for Player 11 (Dark Green) at US facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_US)
Wait 3.00 seconds
Set UN = (Center of ScourgeSpawnNorth <gen>)
Unit - Create 4 Abomination for Player 11 (Dark Green) at UN facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_UN)
Set US = (Center of ScourgeSpawnSouth <gen>)
Unit - Create 4 Abomination for Player 11 (Dark Green) at US facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_US)
Wait 12.00 seconds
Sound - Play UndeadDissipate2 <gen>
Set UN = (Center of ScourgeSpawnNorth <gen>)
Unit - Create 10 Ghoul for Player 11 (Dark Green) at UN facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_UN)
Set US = (Center of ScourgeSpawnSouth <gen>)
Unit - Create 10 Ghoul for Player 11 (Dark Green) at US facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_US)
Wait 6.00 seconds
Sound - Play U01Peasant15B <gen>
Set UN = (Center of ScourgeSpawnNorth <gen>)
Unit - Create 8 Skeletonarcher for Player 11 (Dark Green) at UN facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_UN)
Set US = (Center of ScourgeSpawnSouth <gen>)
Unit - Create 8 Skeletonarcher for Player 11 (Dark Green) at US facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_US)
Set UN = (Center of ScourgeSpawnNorth <gen>)
Unit - Create 2 Meat Wagon for Player 11 (Dark Green) at UN facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_UN)
Set US = (Center of ScourgeSpawnSouth <gen>)
Unit - Create 2 Meat Wagon for Player 11 (Dark Green) at US facing (Position of (Triggering unit))
Custom script: call RemoveLocation (udg_US)[/trigger]

and i already tried to fix the leak in this trigger but for an odd reason it still lags
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I take it you mean it causes performance problems, not that it generates lag (as if so then the waits must be doing that).

There are 2 noticable performance intensive opperations used.
1. Creating a unit/playing a sound that might not be loaded (this will occur only the first time).
2. Creating a lot of units at the same position.

1. can be ignored and will dissapear completly after the first time all data is loaded.
2. is probably the cause of any frame dropping. The unit displacement algorthim in WC3 is very slow.

To fix 2, just spawn the units randomly in an area or 1 at a time.
 
Level 1
Joined
Jul 14, 2010
Messages
5
The next problem i have is that i have a trigger which one the construction of a building it turns on a trigger to spawn workers and after they spawn i cant them to build a structure. this is what i have so far:

[trigger=P1]
Events
Unit - A unit enters (Playable map area)
Conditions
(Unit-type of (Entering unit)) Equal to Village Hall
Actions
Unit Group - Add (Entering unit) to FurbHall1
Wait 91.00 seconds
Trigger - Turn on build units1 <gen>[/trigger]



[trigger=buildunits1]
build units1
Events
Time - Every 20.00 seconds of game time
Conditions
(Number of units in (Units owned by Player 1 (Red) of type Furbolg Worker)) Less than 3
Actions
Set tempgroup = (Units owned by Player 1 (Red) of type Village Hall)
Unit - Create 1 Furbolg Worker for Player 1 (Red) at (Position of (Random unit from tempgroup)) facing Default building facing degrees
Custom script: call DestroyGroup(udg_tempgroup)[/trigger]



[trigger=build Huts1]
Build Huts1
Events
Time - Every 61.00 seconds of game time
Conditions
(Number of units in (Units owned by Player 1 (Red) of type Village Hut)) Equal to 3
Actions
Unit - Order (Random unit from (Units owned by Player 1 (Red) of type Furbolg Worker)) to build a Village Hut at (Random point in (Region centered at (Position of (Random unit from FurbHall1)) with size (80.00, 80.00)))[/trigger]



Tihs series works until the build huts trigger which then the workers just sit there aroung the Hall.

P,S thanks you all the help you guys have been giving me.
 
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
- Unit - A unit enters (Playable map area) >>> Unit - A unit Finishes construction
- Entering unit should be constructed structure

working building trigger;
  • Actions
    • Set tempgroup = (Random 1 units from (Units owned by Player 1 (Red) of type Village Hall))
    • Unit Group - Pick every unit in tempgroup and do (Actions)
      • Loop - Actions
        • Set temploc = (Position of (Picked unit))
        • Unit - Create 1 Furbolg Worker for Player 1 (Red) at temploc facing Default building facing degrees
        • Custom script: call RemoveLocation(udg_temploc)
    • Custom script: call DestroyGroup(udg_tempgroup)
- you should change this >>> Equal to 3
- you cant really build something on the posision of something
in other words you cant do this...
Random point in (Region centered at (Position of (Random unit from FurbHall1))
- that region must be buildable, no pathing blockades, no collisions, OR Possible to build
- lastly, check your gold/lumber
 
Status
Not open for further replies.
Top