Warcraft III resources & community, 2003–2006 · archived

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

3 posts
#1

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

Ok heres the 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:

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?!
#2
Custom script: call RemoveRect (udg_ATempRegion)


You are supposed to set and delete the points in a region using the jass scripts, not the region its self. I think you are deleteing the region when you have stuff spawn, and if they have no region assinged, they spawn at the center of the playable map area by default.
-VGsatomi
#3
Heres wat i did wrong for those of u that care to know:
1. I used region variables instead of points.
2. As VGsatomi said i was destroying the regions instead of the points.