HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AoS TestMap / Trigger Problems

05-23-2007, 07:27 PM#1
Mathrigo666
Greetings...

i need there some help with my first WC3x map, AoS Style...
the map isnt anything serious, i just want to use it for testing the ability system i wanna create, maybe for a rpg campaign... but i want it running nicely... yet it is not...
i only used triggers there...

actually i want that 2 factions battle each other with 2 "armies" per faction, each spawning 6 units every 10 seconds, to a maximum of 12, making 24 per side, only restart spawning when the number falls below 11, so that there are not too many units on the map... but still, after letting it running for like 20 minutes its lagging, and i dont know why, the number of units never raise, the only thing that raises are the level of the heroes...
the other problem is that the units sometimes forget their order when they are fighting too long, especially the heroes, who then just stands still, not approaching enemy base... a trigger-sided reordering of the units every few seconds makes the units stop at once, for almost a second, before actually doing the order...
besides that, the battle works quite nice, i think... atleast for the first more (not completly) serious try of myself

for some more information:
its a singleplayer map, only player red is playable... the one (player) side is scourge, including three guarding elite heroes, that does not approach the enemy base... and the alliance, including 2 paladins... the "approach-path" of each side is crossing the center of the map, maybe that produces some hassle there, i am not sure...

well, for a deeper look i will attach that map... i've used WEU 1.20..

maybe someone can take a look, i would really aprec... apprac....... like that :D

sorry for my english, its not my native tongue...
Attached Files
File type: w3xscourge.w3x (279.9 KB)
05-23-2007, 08:01 PM#2
Castlemaster
Most likely you are creating "leaks" in your programming. In case you don't know, these are small bits of information that are used then stay around. They are caused by using "location" command in GUI, or several others. There are several tutorials on this subject if you go to the tutorial section and browse it. Chances are that you will find something else that will help you.

Your unit pauses could be caused by an excess of commands, or the incorrect commands. Generally speaking, the "attack move-to" command is the best for that type of situation because the computer AI will use autocast and make decisions on who to attack. Also if you have a command refresher that gives a different command than the current one, i can cause a unit delay.

For problems like that, learn how to post your code (search: "Posting GUI code") and showing us the code will help those that help you.
05-24-2007, 05:39 AM#3
Mathrigo666
yeea that makes sense, i heard of the memory leak stuff, yet not knowing what kind of stuff produces that... just using a variable (which is always global in GUI i think) and destroy it when i dont need it anymore, or reset it to null when planning to reuse it (like when spawning units in a AoS Map)...

well yet i dont know how to use the trigger-tags but i will find out... right now...

and i think i made it :D here are the two example triggers, taken from the map, allready less memory leaking i think... the second trigger happens 4 times in the map... this way there are allways only 4 variables, stating the spawn and target locations, and not , if my thoughts are right, allways a new variable when i use a action pointing to a point/location... what ya people think?

Trigger:
Init
Collapse Events
Map initalization
Conditions
Collapse Actions
Set locUndeadSpawn01 = (Center of Undead Spawn 01 <gen>)
Set locHumanSpawn02 = (Center of Human Spawn02 <gen>)
Countdown Timer - Start timer_UndeadWave01 as a Repeating timer that will expire in 10.00 seconds

Trigger:
Undead Waves 01
Collapse Events
Time - timer_UndeadWave01 expires
Conditions
Collapse Actions
if (nUndeadUnits_01 Greater than or equal to 10) then do (Skip Remaining Actions)
---- Spawning Ghouls ----
Collapse For each (Integer A) from 1 to 4, do (Actions)
Collapse Loop - Actions
Unit - Create 1 Ghoul for Player 7 (Green) at locUndeadSpawn01 facing 270.00 degrees
Unit - Order (Last created unit) to Attack-Move To locHumanSpawn02
Unit Group - Add (Last created unit) to ugUndead_01
Set nUndeadUnits_01 = (nUndeadUnits_01 + 1)
---- Spawning Crypt Fiends ----
Collapse For each (Integer A) from 1 to 2, do (Actions)
Collapse Loop - Actions
Unit - Create 1 Crypt Fiend for Player 7 (Green) at locUndeadSpawn01 facing 270.00 degrees
Unit - Order (Last created unit) to Attack-Move To locHumanSpawn02
Unit Group - Add (Last created unit) to ugUndead_01
Set nUndeadUnits_01 = (nUndeadUnits_01 + 1)

i wonder if the first IF in the second trigger should better be a condition for the trigger, dont know if that makes any difference in performance or stuff...

EDIT: Castlemaster, for making me remember the leak stuff:

THOU HAST BEEN REP'T (alittle)

EDIT TOO: and yea, now everything works... all questions solved... yet