ZakkWylde-
New Member
- Reaction score
- 14
Create Units and Order them to Patrol Help please =D
So, I'm making a maze...As I make my map larger and longer, my map (fps/delay) lags because I place my units on the map (so that when I start the game, all of the units are there). Right now, there are over 500 units all constantly using Permanent Immolation (slightly modified) and LocustTrigger/Locust.
Now, as each level progresses, I do remove the units from the previous levels...and as you get further and further in the maze, the lag goes away...but this is going to be a huge problem as I estimate over 1000 units once the maze is done.
Is there any way that I can create units (using JASS of course), create/set regions, and order patrols when I want them?
I'd like the units to be present only for the level for which they are required.
i.e., if I'm on level 5, there are no units for level 4 and below and no units for level 6 and above.
It's fairly simple in GUI or JASS to remove the units once you're done with them...but my problem is for the "no units for level 6 and above" scenario.
Any help would be much appreciated!
If something is not clear, feel free to ask questions and I should respond promptly.
Zakk
EDIT: So I've tried things like
call CreateUnitAtLoc(Player(0), 'hfoo', Location(0, 0), 50)
set udg_TempUnit (my unit variable) = GetLastCreatedUnit()
call IssuePointOrderLoc( udg_TestTempUnit, "patrol", Location (1100, 0))
set udg_TempUnit=null (or to the next unit and repeat)
What happens then is it chooses some random unit that had been created at one point....and orders that unit to patrol...why doesn't this work for the unit I just created...?
Would this method leak? Does anyone have a version that would be much easier (and could possibly spell it out for me =D)?
Thanks again.
EDIT#2: I resolved this problem. If anyone is wondering how to do this as well, I'd be glad to help out...just post here or send me a PM (sending a PM will probably get a quicker response)!
So, I'm making a maze...As I make my map larger and longer, my map (fps/delay) lags because I place my units on the map (so that when I start the game, all of the units are there). Right now, there are over 500 units all constantly using Permanent Immolation (slightly modified) and LocustTrigger/Locust.
Now, as each level progresses, I do remove the units from the previous levels...and as you get further and further in the maze, the lag goes away...but this is going to be a huge problem as I estimate over 1000 units once the maze is done.
Is there any way that I can create units (using JASS of course), create/set regions, and order patrols when I want them?
I'd like the units to be present only for the level for which they are required.
i.e., if I'm on level 5, there are no units for level 4 and below and no units for level 6 and above.
It's fairly simple in GUI or JASS to remove the units once you're done with them...but my problem is for the "no units for level 6 and above" scenario.
Any help would be much appreciated!
If something is not clear, feel free to ask questions and I should respond promptly.
Zakk
EDIT: So I've tried things like
call CreateUnitAtLoc(Player(0), 'hfoo', Location(0, 0), 50)
set udg_TempUnit (my unit variable) = GetLastCreatedUnit()
call IssuePointOrderLoc( udg_TestTempUnit, "patrol", Location (1100, 0))
set udg_TempUnit=null (or to the next unit and repeat)
What happens then is it chooses some random unit that had been created at one point....and orders that unit to patrol...why doesn't this work for the unit I just created...?
Would this method leak? Does anyone have a version that would be much easier (and could possibly spell it out for me =D)?
Thanks again.
EDIT#2: I resolved this problem. If anyone is wondering how to do this as well, I'd be glad to help out...just post here or send me a PM (sending a PM will probably get a quicker response)!