• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

why does my unit spawn at center of playable map area?!

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2005
Messages
298
Ok heres the code:
Code:
Spawning Top 
Events 
Time - SpawnBasicForces expires 
Conditions 
(Keep 0059 <gen> is alive) Equal to True 
Actions 
Set ATempRegion = HumanSpawnerTop <gen> 
Set BTempRegion = Top 1 <gen> 
Unit - Create 1 Footman for Player 11 (Dark Green) at (Center of ATempRegion) facing 270.00 degrees 
Unit - Order (Last created unit) to Attack-Move To (Center of BTempRegion) 
Unit - Create 1 Footman for Player 11 (Dark Green) at (Center of ATempRegion) facing 270.00 degrees 
Unit - Order (Last created unit) to Attack-Move To (Center of BTempRegion) 
Unit - Create 1 Rifleman for Player 11 (Dark Green) at (Center of ATempRegion) facing 270.00 degrees 
Unit - Order (Last created unit) to Attack-Move To (Center of BTempRegion) 
Unit - Create 1 Priest for Player 11 (Dark Green) at (Center of ATempRegion) facing 270.00 degrees 
Unit - Order (Last created unit) to Attack-Move To (Center of BTempRegion) 
Custom script: call RemoveRect (udg_ATempRegion) 
Custom script: call RemoveRect (udg_BTempRegion)
That is supposed to work and not have any memory leaks but it doesnt work at all. What it does is it creates all the units at the center of playable map area and orders them to attack move to the center of playable map area. Why? I have several of these triggers running at the same time (all using those same two nonlocal variables) so i thought maybe that was the problem even though ive been told that it shouldnt cause any problems cause technically everything is called in an order and i dont have any wait commands. So to test and make sure that wasnt the problem i made this trigger:
Code:
Test 
Events 
Player - Player 1 (Red) types a chat message containing -test as An exact match 
Conditions 
Actions 
Set ATempRegion = HumanSpawnerTop <gen> 
Unit - Create 1 Footman for Player 11 (Dark Green) at (Center of ATempRegion) facing 270.00 degrees 
Custom script: call RemoveRect (udg_ATempRegion)
But that did the same thing as the other trigger, it created the unit at the center of playable map area. Pleae help! why doesnt this trigger work?!
 
Status
Not open for further replies.
Top