HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating An Efficient Unit Spawning System-GUI

10-05-2007, 04:45 PM#1
Diehard@Azeroth
Creating An Advanced Unit Spawning System-GUI (Advanced Tutorial)

Created by Diehard@Azeroth

Tutorial Idea Supported By Moyack >>

Notification: This Tutorial is not basic and you need some knowledge of memory leaks and variables/arrays.

Purpose of This Tutorial:

The purpose of this tutorial is not only to learn you how to make a better unit spawning system but to even learn you how to manage time functions better, use loops in a way where you can manipulate arrays and setting arrays in the proper format. Ultimately after you learn how this system or technique of spawning units works, you will be able to customize it even further or deeply or know how to manage time functions to their limit. One of the many easy to add-in features is instead of spawning in regions, spawning at a building if it is alive, you will be able to do all of this as soon as you learn how this technique works, good luck. (In This Tutorial also comes a demo map.)This Tutorial will be split into 3 Chapters/Triggers which are split into sections:
  1. Initializing The Spawning "Longest Chapter/Trigger, Very Long But Important"
  2. Keeping Track Of The Limits "EXTREMELY short, just one section."
  3. The Actual Spawning "Short, Just One Long Section"

~ Just so you know beforehand, i connect array information using their index or number, for example if array[1] = an integer and array2[1] = another integer then they will be connected or indexed together by "1". ~


Trigger 1: Initializing The Spawning

A. First of all, create a new trigger and make its event "Map Initialization" so it can run exactly when the map finishes loading.
Trigger:
Collapse Events
Map initialization
Conditions
Actions

B. In this section we will initialize the arrays, create 2 integer variables, name one "temp_StartingNumber" and name the other "temp_EndingNumber". Set the number at which your arrays start in in "temp_StartingNumber" and set the number at which your arrays end in in "temp_EndingNumber". Here is what i did:
Trigger:
Collapse Events
Map initialization
Conditions
Actions
-------- Current Section --------
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3

C. In this section we will set the unit types that will spawn. Create 1 Unit Type Variable Array called "temp_UnitTypes". In this variable array store whatever unit types you want to create to be created. (to change a arrays spawn if they upgrade their building or anything else, just set the variable temp_UnitTypes[ index of spawn ] = new unit type, also all others aspects can be changed, soon to be shown) This is what i did:

Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
-------- Current Section --------
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team

D.In this section we are going to set the unit amounts or quantities when they spawn. Create 1 Integer Variable Array called "temp_Unit_Amount".
In this variable array set the amounts of units you want that will be created when their spawning interval is done. "I will talk about spawning interval in section g (the hardest)." This is what i did:

Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team
-------- Current Section --------
Set temp_Unit_Amount[temp_StartingNumber] = 2
Set temp_Unit_Amount[2] = 1
Set temp_Unit_Amount[temp_EndingNumber] = 2

E. In this section i will set the limits of units for each player and this is only a 1-16 array, each variable index keeping track of a players unit limits, for example LIMIT[1] = Player 1 (red)'s unit limit.

Create 1 integer variable array called "temp_UnitLimit". In this variable array just set the amounts of units(you can change the conditions to whatever you like as soon as you learn how to use this system efficiently", not heroes or buildings you want the unit to stop at. So if his current amount of units reach his unit limit it will stop spawning. This is what i did:
Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team
Set temp_Unit_Amount[temp_StartingNumber] = 2
Set temp_Unit_Amount[2] = 1
Set temp_Unit_Amount[temp_EndingNumber] = 2
-------- Current Section --------
Set temp_UnitLimit[1] = 12
Set temp_UnitLimit[13] = 6 //Note: Player Number 13 is Neutral Hostile.
Set temp_UnitLimit[16] = 8 //Note: Player Number 16 is Neutral Passive.

F. This section initializes the amount of units each player has so it can start from that limit.

Create a integer variable array called "temp_TrackUnitLimit" then loop from integer a from 1 to 16, basically, looping all of the players including neutral hostile etc.. Then create a unit group variable called "temp_UnitGroup" then for each integer a set the variable "temp_UnitGroup" variable equal to units owned by player ((integer A)) matching unit is not a building, not a hero and alive, then pick every unit in "temp_UnitGroup" then Set
temp_TrackUnitLimit[(Integer A)] = (temp_TrackUnitLimit[(Integer A)] + 1)
which basically increases the limit by 1 as it picks each unit owned by player (integer a). After that Destroy The Unit Group And Nullify It, to remove its memory leaks. Here is what you are supposed to do:

Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team
Set temp_Unit_Amount[temp_StartingNumber] = 2
Set temp_Unit_Amount[2] = 1
Set temp_Unit_Amount[temp_EndingNumber] = 2
Set temp_UnitLimit[1] = 12
Set temp_UnitLimit[13] = 6 //Note: Player Number 13 is Neutral Hostile.
Set temp_UnitLimit[16] = 8 //Note: Player Number 16 is Neutral Passive.
-------- Current Section --------
Collapse For each (Integer A) from 1 to 16, do (Actions)
Collapse Loop - Actions
Set temp_UnitGroup = (Units owned by (Player((Integer A))) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is alive) Equal to True))))
Collapse Unit Group - Pick every unit in temp_UnitGroup and do (Actions)
Collapse Loop - Actions
Set temp_TrackUnitLimit[(Integer A)] = (temp_TrackUnitLimit[(Integer A)] + 1)
Custom script: call DestroyGroup(udg_temp_UnitGroup)
Custom script: set udg_temp_UnitGroup = null

G. In this section you will control the time functions and it will be a bit tricky. Create 2 real variable arrays, name one "temp_Time" and name the other one "temp_MaxTimeFor_UnitsToSpawn". Now create 1 real variable called "temp_MinimumTime". Now set the time intervals for the units spawning so for example like for every 3.00 seconds 2 footmens will spawn someplace. Now Loop through for each integer a from "temp_StartingNumber" to "temp_EndingNumber" and do the action "Set Temp_MaxTime_ForUnitsToSpawn[(Integer A)] = temp_Time[(Integer A)]"

This basically sets the interval time of a unit to be created but into another variable because the time variable will change throughout the spawning process and it needs to revert to its actual time so the unit wont be created instantly after being created. Now for the trickiest part, look at all your "temp_Time's" and spot the lowest decimal number if you are using decimals or lowest number if you are not using decimal numbers. Since this variable will be used to run the timer and every "temp_MinimumTime" it will Subtract the Time's value so the units can spawn if the time's value is 0.00 or below.

I Extremely suggest not to use decimals in your map if you are using this way of spawning since it may cause a slight lag or delay, i just used decimals in my demo map as an example of how i got the decimal and how it functions properly.
Here is what i did:

Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team
Set temp_Unit_Amount[temp_StartingNumber] = 2
Set temp_Unit_Amount[2] = 1
Set temp_Unit_Amount[temp_EndingNumber] = 2
Set temp_UnitLimit[1] = 12
Set temp_UnitLimit[13] = 6 //Note: Player Number 13 is Neutral Hostile.
Set temp_UnitLimit[16] = 8 //Note: Player Number 16 is Neutral Passive.
Collapse For each (Integer A) from 1 to 16, do (Actions)
Collapse Loop - Actions
Set temp_UnitGroup = (Units owned by (Player((Integer A))) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is alive) Equal to True))))
Collapse Unit Group - Pick every unit in temp_UnitGroup and do (Actions)
Collapse Loop - Actions
Set temp_TrackUnitLimit[(Integer A)] = (temp_TrackUnitLimit[(Integer A)] + 1)
Custom script: call DestroyGroup(udg_temp_UnitGroup)
Custom script: set udg_temp_UnitGroup = null
-------- Current Section --------
Set temp_Time[temp_StartingNumber] = 3.00
Set temp_Time[2] = 2.00
Set temp_Time[temp_EndingNumber] = 5.50
Collapse For each (Integer A) from temp_StartingNumber to temp_EndingNumber, do (Actions)
Collapse Loop - Actions
Set temp_MaxTime_ForUnitsToSpawn[(Integer A)] = temp_Time[(Integer A)]
Set temp_MinimumTime = 0.50 //temp_Time[temp_EndingNumber] = 5.(50) Lowest Decimal Number.

H. Time to return to easy triggering ^^ In this section first create regions where u want units to spawn at and create a region variable array called "temp_SpawningRegions", fill in the arrays depending on where u want them to spawn. This is what i did:

Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team
Set temp_Unit_Amount[temp_StartingNumber] = 2
Set temp_Unit_Amount[2] = 1
Set temp_Unit_Amount[temp_EndingNumber] = 2
Set temp_UnitLimit[1] = 12
Set temp_UnitLimit[13] = 6 //Note: Player Number 13 is Neutral Hostile.
Set temp_UnitLimit[16] = 8 //Note: Player Number 16 is Neutral Passive.
Collapse For each (Integer A) from 1 to 16, do (Actions)
Collapse Loop - Actions
Set temp_UnitGroup = (Units owned by (Player((Integer A))) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is alive) Equal to True))))
Collapse Unit Group - Pick every unit in temp_UnitGroup and do (Actions)
Collapse Loop - Actions
Set temp_TrackUnitLimit[(Integer A)] = (temp_TrackUnitLimit[(Integer A)] + 1)
Custom script: call DestroyGroup(udg_temp_UnitGroup)
Custom script: set udg_temp_UnitGroup = null
Set temp_Time[temp_StartingNumber] = 3.00
Set temp_Time[2] = 2.00
Set temp_Time[temp_EndingNumber] = 5.50
Collapse For each (Integer A) from temp_StartingNumber to temp_EndingNumber, do (Actions)
Collapse Loop - Actions
Set temp_MaxTime_ForUnitsToSpawn[(Integer A)] = temp_Time[(Integer A)]
Set temp_MinimumTime = 0.50 //temp_Time[temp_EndingNumber] = 5.(50) Lowest Decimal Number.
-------- Current Section --------
Set temp_SpawningRegions[temp_StartingNumber] = SpawningRegion1 <gen>
Set temp_SpawningRegions[2] = SpawningRegion2 <gen>
Set temp_SpawningRegions[temp_EndingNumber] = SpawningRegion3 <gen>

I. In this semi-final section you set the player who owns that unit group that spawns. Create a player variable array called "temp_SpawningPlayer". In this variable array just set the players who you want to control that group but two players cannot control one group, you will have to redo the whole process, what i mean is that if "temp_UnitTypes[1] spawns only temp_SpawningPlayer[1] will control that group." This is what i did:

Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team
Set temp_Unit_Amount[temp_StartingNumber] = 2
Set temp_Unit_Amount[2] = 1
Set temp_Unit_Amount[temp_EndingNumber] = 2
Set temp_UnitLimit[1] = 12
Set temp_UnitLimit[13] = 6 //Note: Player Number 13 is Neutral Hostile.
Set temp_UnitLimit[16] = 8 //Note: Player Number 16 is Neutral Passive.
Collapse For each (Integer A) from 1 to 16, do (Actions)
Collapse Loop - Actions
Set temp_UnitGroup = (Units owned by (Player((Integer A))) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is alive) Equal to True))))
Collapse Unit Group - Pick every unit in temp_UnitGroup and do (Actions)
Collapse Loop - Actions
Set temp_TrackUnitLimit[(Integer A)] = (temp_TrackUnitLimit[(Integer A)] + 1)
Custom script: call DestroyGroup(udg_temp_UnitGroup)
Custom script: set udg_temp_UnitGroup = null
Set temp_Time[temp_StartingNumber] = 3.00
Set temp_Time[2] = 2.00
Set temp_Time[temp_EndingNumber] = 5.50
Collapse For each (Integer A) from temp_StartingNumber to temp_EndingNumber, do (Actions)
Collapse Loop - Actions
Set temp_MaxTime_ForUnitsToSpawn[(Integer A)] = temp_Time[(Integer A)]
Set temp_MinimumTime = 0.50 //temp_Time[temp_EndingNumber] = 5.(50) Lowest Decimal Number.
Set temp_SpawningRegions[temp_StartingNumber] = SpawningRegion1 <gen>
Set temp_SpawningRegions[2] = SpawningRegion2 <gen>
Set temp_SpawningRegions[temp_EndingNumber] = SpawningRegion3 <gen>
-------- Current Section --------
Set temp_SpawningPlayer[temp_StartingNumber] = Player 1 (Red)
Set temp_SpawningPlayer[2] = Neutral Passive
Set temp_SpawningPlayer[temp_EndingNumber] = Neutral Hostile

J. Final Section, phew >_< , In this section you run a timer in "temp_MinimumTime" seconds as a repeating timer. Create a timer variable called "temp_SpawningTimer" then run the timer "temp_SpawningTimer" as a repeating timer that will expire in "temp_MinimumTime" seconds so time intervals will function properly. This is what i did, this is just one action.

Trigger:
Collapse Events
Map initialization
Conditions
Actions
Set temp_StartingNumber = 1
Set temp_EndingNumber = 3
Set temp_UnitTypes[temp_StartingNumber] = Footman
Set temp_UnitTypes[2] = Rifleman
Set temp_UnitTypes[temp_EndingNumber] = Mortar Team
Set temp_Unit_Amount[temp_StartingNumber] = 2
Set temp_Unit_Amount[2] = 1
Set temp_Unit_Amount[temp_EndingNumber] = 2
Set temp_UnitLimit[1] = 12
Set temp_UnitLimit[13] = 6 //Note: Player Number 13 is Neutral Hostile.
Set temp_UnitLimit[16] = 8 //Note: Player Number 16 is Neutral Passive.
Collapse For each (Integer A) from 1 to 16, do (Actions)
Collapse Loop - Actions
Set temp_UnitGroup = (Units owned by (Player((Integer A))) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is alive) Equal to True))))
Collapse Unit Group - Pick every unit in temp_UnitGroup and do (Actions)
Collapse Loop - Actions
Set temp_TrackUnitLimit[(Integer A)] = (temp_TrackUnitLimit[(Integer A)] + 1)
Custom script: call DestroyGroup(udg_temp_UnitGroup)
Custom script: set udg_temp_UnitGroup = null
Set temp_Time[temp_StartingNumber] = 3.00
Set temp_Time[2] = 2.00
Set temp_Time[temp_EndingNumber] = 5.50
Collapse For each (Integer A) from temp_StartingNumber to temp_EndingNumber, do (Actions)
Collapse Loop - Actions
Set temp_MaxTime_ForUnitsToSpawn[(Integer A)] = temp_Time[(Integer A)]
Set temp_MinimumTime = 0.50 //temp_Time[temp_EndingNumber] = 5.(50) Lowest Decimal Number.
Set temp_SpawningRegions[temp_StartingNumber] = SpawningRegion1 <gen>
Set temp_SpawningRegions[2] = SpawningRegion2 <gen>
Set temp_SpawningRegions[temp_EndingNumber] = SpawningRegion3 <gen>
Set temp_SpawningPlayer[temp_StartingNumber] = Player 1 (Red)
Set temp_SpawningPlayer[2] = Neutral Passive
Set temp_SpawningPlayer[temp_EndingNumber] = Neutral Hostile
-------- Current Section --------
Collapse Countdown Timer - Start temp_SpawningTimer as a Repeating timer that will expire in temp_MinimumTime seconds
// WE ARE DONE THE LONGEST PART OF THE SYSTEM !! Also most boring >>
Trigger 2: Keeping Track Of The Limits
a. In this section you just keep track of "temp_TrackUnitLimit" if a unit dies you subtract the owner of the dying units "temp_TrackUnitLimit" array by 1.
The dying unit must not be a hero or a structure. Here is what i did:
Trigger:
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Triggering unit) is A structure) Equal to False
((Triggering unit) is A Hero) Equal to False
Collapse Actions
Set temp_TrackUnitLimit[(Player number of (Owner of (Triggering unit)))] = (temp_TrackUnitLimit[(Player number of (Owner of (Triggering unit)))] - 1)

Trigger 3: The Actual Spawning (funnest part!)
This is what i did for the spawning, i wont post every current section, but instead all of the trigger and i will explain it all in one long section.

Trigger:
Collapse Events
Time - temp_SpawningTimer expires
Conditions
Collapse Actions
Collapse For each (Integer A) from temp_StartingNumber to temp_EndingNumber, do (Actions)
Collapse Loop - Actions
-------- You Can Add Your Own Conditions In Here --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
temp_UnitTypes[(Integer A)] Not equal to No unit-type
temp_TrackUnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])] Less than temp_UnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])]
Collapse Then - Actions
Set temp_Time[(Integer A)] = (temp_Time[(Integer A)] - temp_MinimumTime)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
temp_Time[(Integer A)] Less than or equal to 0.00
Collapse Then - Actions
-------- this debugs the spawning quantity so if the quantity of units it spawns makes the track unit limit greater than --------
-------- the unit limit then it will spawn a # of units which make the track unit limit exactly like the unit limit. --------
Set temp_DebugQuantity = (temp_TrackUnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])] + temp_Unit_Amount[(Integer A)])
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
temp_DebugQuantity Greater than temp_UnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])]
Collapse Then - Actions
Set temp_DebugQuantity = (temp_UnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])] - temp_TrackUnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])])
Set temp_bDebugged = True
Collapse Else - Actions
Set temp_bDebugged = False
Set temp_SpawningPoint = (Center of temp_SpawningRegions[(Integer A)])
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
temp_bDebugged Equal to True
Collapse Then - Actions
Unit - Create temp_DebugQuantity temp_UnitTypes[(Integer A)] for temp_SpawningPlayer[(Integer A)] at temp_SpawningPoint facing Default building facing degrees
Set temp_TrackUnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])] = (temp_TrackUnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])] + temp_DebugQuantity)
Collapse Else - Actions
Unit - Create temp_Unit_Amount[(Integer A)] temp_UnitTypes[(Integer A)] for temp_SpawningPlayer[(Integer A)] at temp_SpawningPoint facing Default building facing degrees
Set temp_TrackUnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])] = (temp_TrackUnitLimit[(Player number of temp_SpawningPlayer[(Integer A)])] + temp_Unit_Amount[(Integer A)])
Custom script: call RemoveLocation(udg_temp_SpawningPoint)
Custom script: set udg_temp_SpawningPoint = null
Set temp_Time[(Integer A)] = temp_MaxTime_ForUnitsToSpawn[(Integer A)]
Else - Actions
Else - Actions

before we start the section create one integer variable and name it "temp_bDebugQuantity", now create one boolean variable named "temp_bDebugged" and a point variable called "temp_SpawningPoint".

K. This is how the trigger works, when the timer "temp_SpawningTimer" expires, it loops from the beginning of the arrays to the end of the arrays you have checking for all units to spawn.First it checks if that array contains a unit so for example if you made "temp_UnitTypes[1] = No Unit" and Then "temp_UnitTypes[2] = Footman", then it wont spawn that unit type since its not valid. It also checks if the amount of units "temp_TrackUnitLimit" he has are less than his limit.

If it is less than it will spawn the units. This is how the unit is spawned and a debug feature is also included. This action "Set temp_Time[(Integer A)] = (temp_Time[(Integer A)] - temp_MinimumTime)" subtracts the current interval time for the units spawning by the "temp_MinimumTime" so therefore the time intervals all work !!

Then it checks if the "temp_Time" of the current group is less than or equal to 0 and if it is it will spawn the unit group. But before that i have to adress an issue, for example if the current amount units you have (trackunitlimit) is 11 and the quantity of units you spawn during each interval is 2 and your unit
limit is 12, that will create for you more units over your limit, hence i created the debug feature. First the debug feature adds the current amounts of units he has "temp_TrackUnitLimit" to the amount of units to be created during each interval "temp_Unit_Amount".

After that comes a If/Then/Else Check, If the "temp_DebugQuantity" is larger than the limit then it will produce a # of units to make the amount of units he currently has to fit his maximum unit limit. After that it checks off "temp_bDebugged" as true and sets that DebugQuantity # from subtracting his unit limit by his current amount of units.

Now it sets a point "temp_SpawningPoint" in the middle of the spawning regions of that array index so it can spawn the units there. First comes the last if/then/else check, if the Boolean "temp_bDebugged" equal to true then it makes it create not the normal quantity of units but the "temp_DebugQuantity" number of units, of the unit type "temp_UnitTypes[ integer A]" at the Spawning Point which has already at the center of the spawning regions [ integer A ] "temp_SpawningRegions[IntegerA]".

But if "temp_bDebugged" is false it which means it needs no debugging then it will create "temp_Unit_Amount[IntegerA]" instead of "temp_DebugQuantity". After that i remove the Point "temp_SpawningPoint" to remove leaks and then nullify it. (setting something to null is nullifiying)

Now for the most important part, the resetting of the units time intervals "temp_Time", you reset the unit group's array's "temp_Time" to its "temp_MaxTime_ForUnitsToSpawn".

To see how well this system works. download the demo map just below.
Attached Files
File type: w3xUnitSpawningSystemFinalEdit.w3x (21.0 KB)
10-06-2007, 01:01 AM#2
Anopob
Can't try the test map yet but the tutorial looks well done in GUI. Can't say much but I don't think you need to set things to null if they're global (in which case they are). If not, well, more learning for me.
10-06-2007, 01:51 AM#3
moyack
Ok, I've seen your tutorial and it has good documentation, but it needs better formating. Here it's a good opportunity to take advantage of the nice features of VBcode, and with that, make your tutorial looks more professional.

My recommendations:
  • To the title add your name man, you're the author :)

  • Put more spaces. Remember that dense text is usually ignored, because it's related with complex information.

  • You have to put new lines where it's needed. in order to do that, read your text loudly and check in which part you have to stop. There, you can put a period and start a new line or continue your text if the context need it.

  • You are using the red and orange too much. I know you want to use it in order to bold some ideas, but, at least in the WC3C interface it looks bad, tends to become unreadable.

  • I suggest to use lime color, I've noticed it's the most decent looking in all the themes here, but please don't abuse of it!! use it only for main titles, for instance. If you want to emphasize any word or phrase, use the bold, underline or italic styles. AS an example, I'm going to edit your text a little bit.

.:
Creating An Efficient Unit Spawning System-GUI
By Diehard@Azeroth

Notification: This Tutorial is not basic and you need some knowledge of memory leaks and variables/arrays.



Purpose of This Tutorial:

The purpose of this tutorial is not only to learn you how to make a better unit spawning system but to even learn you how to manage time functions better, use loops in a way where you can manipulate arrays and setting arrays in the proper format. In This Tutorial also comes a demo map.This Tutorial will be split into 3 Chapters/Triggers which are split into sections:
  • Initializing The Spawning "Longest Chapter/Trigger, Very Long But Important"
  • Keeping Track Of The Limits "EXTREMELY short, just one section."
  • The Actual Spawning "Short, Just One Long Section"


~ Just so you know beforehand, i connect array information using their index or number, for example if array[1] = an integer and array2[1] = another integer then they will be connected or indexed together by "1". ~

Trigger 1: Initializing The Spawning
  1. First of all, create a new trigger and make its event "Map Initialization" so it can run exactly when the map finishes loading.
    Trigger:
    Collapse Events
    Map initialization
    Conditions
    Actions

.....

In order to see how I did the formating, quote my post and see how the vBcode is used.
11-04-2007, 11:25 AM#4
PitzerMike
I approve.

Hidden information:
Well, I know it's been a long time, but reading the whole tutorial and going through the formatting took me more than 5 minutes.
01-03-2008, 10:55 PM#6
Pyrogasm
It does use CreateNUnitsAtLoc, but the point of this tutorial is to teach you how to make the spawning spawn the proper units each time and be configurable to the user's specifications.