| 08-15-2004, 03:27 AM | #1 |
ok like i had a problem before with spawning creeps i was wondering if anyone had a really good one like when they entered a region like 4 differents units would come out and attack... just like in final fansty rpg.. i mite have a hint but im not sure ill post it when i think i have it.... can u plz help... |
| 08-15-2004, 06:38 AM | #2 |
Well you would need to make 5 regions. then make a trigger similar to this Code:
[b][u]Event[/u][/b] Unit enters (region0) [b][u]Conditions [/u][/b][u][/u] (Optional) [b][u]Actions[/u][/b][u][/u] Create (number) (unit)s in (region1) facing angle (angle) Pick every units in (last created unit group) and do actions Order (picked unit) to (attack) (triggering unit) Create (number) (unit)s in (region2) facing angle (angle) Pick every units in (last created unit group) and do actions Order (picked unit) to (attack) (triggering unit) Create (number) (unit)s in (region3) facing angle (angle) Pick every units in (last created unit group) and do actions Order (picked unit) to (attack) (triggering unit) Create (number) (unit)s in (region4) facing angle (angle) Pick every units in (last created unit group) and do actions Order (picked unit) to (attack) (triggering unit) |
| 08-15-2004, 10:07 PM | #3 |
well ill found out how he did it but im not sure if the trigger is correct... Events Unit - A unit enters Region 025 <gen> Conditions ((Owner of (Entering unit)) is in Playersgroup) Equal to True Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions ((Owner of (Entering unit)) is in Playersgroup) Equal to True (Number of units in (Units in Region 025 <gen> owned by Neutral Hostile)) Less than or equal to 7 Then - Actions Wait 6.00 seconds Unit - Create 3 (Random level 1 creep unit-type) for Neutral Hostile at (Center of Region 025 <gen>) facing Default building facing degrees Unit Group - Pick every unit in (Units in Region 025 <gen> owned by Neutral Hostile) and do (Unit - Order (Picked unit) to Attack (Entering unit)) Trigger - Run (This trigger) (checking conditions) Else - Actions ok well tahts wut i have so far it will creat 3 waves of 3 of random level 1 units and i have no clue how to remove the units after the the hero has left.. |
| 08-16-2004, 09:24 AM | #4 |
ohh so you wanted random units spawning, should be more specific. To remove units after hero leaves the region. First you need a unit group variable. The you need 2 (including the one you already made) triggers. The first trigger is the one you already made, but you need an extra action. NOTE: Let the variable "Spawned_Units" to be a unit group variable with the initial value to be "Empty Unit Group (Default)" Code:
[center][b][size=3][i][u]Trigger 1[/u][/i][/size][/b][/center]
Events
Unit - A unit enters Region 025 <gen>
Conditions
((Owner of (Entering unit)) is in Playersgroup) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Entering unit)) is in Playersgroup) Equal to True
(Number of units in (Units in Region 025 <gen> owned by Neutral Hostile)) Less than or equal to 7
Then - Actions
Wait 6.00 seconds
Unit - Create 3 (Random level 1 creep unit-type) for Neutral Hostile at (Center of Region 025 <gen>) facing Default building facing degrees
[b]Unit Group - Pick every unit in (Last created unit group) and do (Actions)
Loop - Actions
Set Spawned_Units = (Last created unit group)[/b]
Unit Group - Pick every unit in (Units in Region 025 <gen> owned by Neutral Hostile) and do (Unit - Order (Picked unit) to Attack (Entering unit))
Trigger - Run (This trigger) (checking conditions)
Else - ActionsCode:
[center][b][size=3][i][u]Trigger 2[/u][/i][/size][/b][/center]
Events
Unit - A unit leaves Region 025 <gen>
Conditions
((Owner of (Triggering unit)) is in Playersgroup) Equal to True
(Number of units in (Units in Region 025 <gen> owned by (Owner of (Triggering unit)))) Equal to 0
Actions
Unit Group - Pick every unit in Spawned_Units and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)I think thats about it. Hope this helps, GL. ![]() |
| 08-16-2004, 08:58 PM | #5 |
ok should help me out alot and i guess ill just change somethings but thanks alot for the help.. i mite ask for one more thing but im not sure yet |
| 08-16-2004, 11:12 PM | #6 |
ok i have a problem and im guessing its it the unit group attacking the entering unit.. whenever the unit dies it goes to a location and when it gets there it starts running around tryin to attack some 1. |
| 08-17-2004, 05:36 AM | #7 |
There are a few ways you could fix this. The simplest would be to kill the spawned units once the entering unit dies. To do this you need to edit the 2 triggers a bit. In trigger 1 you need to add the actions that are highlighted/colored/etc. NOTE: Let ENT_UNIT be a "unit" variable with no array and the initial value to be "none" Code:
[center][size=4][b][u][i]Trigger 1[/i][/u][/b][/size][/center][size=4][b][u][i][/i][/u][/b][/size][b][u][i][/i][/u][/b][u][i][/i][/u][i][/i]
Events
Unit - A unit enters Region 025 <gen>
Conditions
((Owner of (Entering unit)) is in Playersgroup) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Entering unit)) is in Playersgroup) Equal to True
(Number of units in (Units in Region 025 <gen> owned by Neutral Hostile)) Less than or equal to 7
Then - Actions
[color=green][size=3][b]Set ENT_UNIT = (Triggering unit)[/b][/size][/color]
Wait 6.00 seconds
Unit - Create 3 (Random level 1 creep unit-type) for Neutral Hostile at (Center of Region 025 <gen>) facing Default building facing degrees
Unit Group - Pick every unit in (Last created unit group) and do (Actions)
Loop - Actions
Set Spawned_Units = (Last created unit group)
Unit Group - Pick every unit in (Units in Region 025 <gen> owned by Neutral Hostile) and do (Unit - Order (Picked unit) to Attack (Entering unit))
Trigger - Run (This trigger) (checking conditions)
[color=green][size=3][b]Trigger - Turn on ([u]Trigger 2[/u])[/b][/size][/color]
Else - ActionsIn trigger 2 you need to add the events, conditions and actions that are highlighted/colored/etc. Code:
[center][size=4][b][u][i]Trigger 2[/i][/u][/b][/size][/center][size=4][b][u][i][/i][/u][/b][/size][b][u][i][/i][/u][/b][u][i][/i][/u][i][/i]
Events
Unit - A unit leaves Region 025 <gen>
[color=green][size=3][b]Unit - A unit Dies[/b][/size][/color]
Conditions
[color=green][size=3][b](Triggering unit) Equal to ENT_UNIT[/b][/size][/color]
((Owner of (Triggering unit)) is in Playersgroup) Equal to True
(Number of units in (Units in Region 025 <gen> owned by (Owner of (Triggering unit)))) Equal to 0
Actions
Unit Group - Pick every unit in Spawned_Units and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)
[color=green][size=3][b]Trigger - Turn off (This trigger)[/b][/size][/color]Hope this helps or works, . |
