• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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