HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Which summoning ability allows us to limit the number of summoned creature type?

02-28-2007, 12:32 AM#1
Matarael
Which summoning ability allows us to limit the number of summoned creature type?

For instance, I want a summoning ability which lets me summon Grunts. But there can only be 3 Grunts at one time. So if I summoned another one, the first Grunt will disappear.

Do I need to trigger this or is there a ready ability? If I recall correctly, the "number of units summoned" on abilities only lets us decide how many is initially summoned.

Many thanks.
02-28-2007, 02:14 AM#2
WNxCryptic
If you want to be able to summon all 3 at once, then use Feral Spirit.

If you want to summon them individually, Carrion Beetles is your choice..although, good luck getting them to work w/o corpses...as I recall corpse-based abilities are nasty..at least raise skeletons always was...anyways..yea.
02-28-2007, 03:29 AM#3
Av3n
Water Elemental then trigger it so that 3 may only be on the field at an time

-Av3n
02-28-2007, 03:53 AM#4
Matarael
So I do have to use triggers, eh... *sigh* Okay then. Thanks again, guys.
Cheers!
02-28-2007, 04:18 AM#5
Pyrogasm
Try this:
Trigger:
Collapse Events
Unit - A unit spawns a summoned unit
Collapse Conditions
Unit type of (Summoned Unit) equal to <Your Unit>
Collapse Actions
Set Summoned_Unit_Index = Summoned_Unit_Index + 1
If (Summoned_Unit_Index > 3) then do (Set Summoned_Unit_Index = Summoned_Unit_Index - 3) else do (Do nothing)
Collapse If (All Conditions are True) then do (Then Actions), else do (Else actions)
Collapse If - Conditions
Summoned_Unit[Summoned_Unit_Index] not equal to (No unit)
Collapse Then - Actions
Set TempPoint = Position of (Summoned_Unit[Summoned_Unit_Index])
Special Effect - Create a special effect at TempPoint using (<Your SFX Filepath)
Custom script: call RemoveLocation(udg_Temp_Point)
Special Effect - Destroy (Last Created Special Effect)
Unit - Kill Summoned_Unit[Summoned_Unit_Index]
Else - Actions
Set Summoned_Unit[Summoned_Unit_Index] equall to (Summoned Unit)
Variables Required:
Variable NameVariable TypeInitial Value
Temp_PointPointNone [Default]
Summoned_UnitUnitNone
Summoned_Unit_IndexInteger0 [Default]

That will make a max of 3 of your summoned units by all players. If you need one that works for each player individually, I can whip it up for you.

EDIT: Fixed the trigger! I'd forgotten the last line.
02-28-2007, 05:11 AM#6
chobibo
Quote:
If (Summoned_Unit_Index > 3) then do (Set Summoned_Unit_Index = Summoned_Unit_Index - 3) else do (Do nothing)
@Pyrogasm:Did you deduct three to the variable summoned_unit_index? Can you explain why, I can't figure it out, Thanks.
02-28-2007, 05:26 AM#7
Pyrogasm
To keep a running loop of "Summoned_Unit[]", such that it never goes over 3. If you look at how feral spirit works in-game, you'll notice that if you re-summon your wolves, the previous ones are lost and you regain new ones.

If I had just put
Trigger:
Unit - Kill (Summoned Unit)
It would not have acheived this effect. The way I've set up keeps adding units to a 3-unit "Stack" and removes the top one each time.

Think of it this way:
  1. Unit A is summoned
  2. Summoned_Unit_Index increases from 0 to 1
  3. Summoned_Unit[1] is empty, so the unit is stored to the variable and nothing happens
  4. Unit B is summoned
  5. Summoned_Unit_Index increases from 1 to 2
  6. Summoned_Unit[2] is empty, so the unit is stored to the variable and nothing happens
  7. Unit C is summoned
  8. Summoned_Unit_Index increases from 2 to 3
  9. Summoned_Unit[3] is empty, so the unit is stored to the variable and nothing happens
  10. Unit D is summoned
  11. Summoned_Unit_Index increases from 3 to 4
  12. 4 > 3, so it resets Summoned_Unit_Index to 1 (4-3)
  13. Summoned_Unit[1] is occupied, so Unit A is killed, SFX happen, and Unit D is stored to the variable
  14. Etc.
Make sense?
02-28-2007, 11:36 AM#8
Rising_Dusk
Why don't you just count all units in the map of type summoned unit when a unit is summoned?
Then kill the summoned unit if that count is over 3.

You don't need any variables then, and it keeps you from going over the limit.
02-28-2007, 12:15 PM#9
Matarael
Quote:
Originally Posted by Rising_Dusk
Why don't you just count all units in the map of type summoned unit when a unit is summoned?
Then kill the summoned unit if that count is over 3.

You don't need any variables then, and it keeps you from going over the limit.

Problem is then which summoned unit is going to get killed? We want the first ones out to be the ones replaced, right?

I'm going to try that first code
02-28-2007, 12:17 PM#10
Rising_Dusk
Kill the first ones?
I guess that's a valid point.

Realistically though, that's why summoned unit duration was invented.
To max out how many of X summoned creature you can have at a time.
03-01-2007, 02:31 AM#11
Av3n
Why not just check if there is three. Then kill the one that is being summoned eh?

-Av3n
03-01-2007, 02:41 AM#12
chobibo
Quote:
Make sense?
Yes now i understant why , thanks for explaining it, I was having a hard time understanding how it worked.
03-01-2007, 02:42 AM#13
Pyrogasm
Don't mean to be too harsh Av3n, but read the damn posts above you!

Explaination:
Quote:
Problem is then which summoned unit is going to get killed? We want the first ones out to be the ones replaced, right?
03-01-2007, 02:44 AM#14
Av3n
I read that... And i said Why not. I never told to use it did i?

-Av3n
03-01-2007, 02:46 AM#15
Falitian
Try using Pyro's trigger, but add in a couple conditions so that it will select the summon with the lowest health, so it realistically will be more useful. Also, you should be able to set it so that the unit being killed is not equal to the summoned unit.