HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[Trigger/Spell] Triggering Ability, Help!

11-17-2008, 02:42 AM#1
RenegadeMushroom
Well, i'm making a spell called Summoning Circle right now, and it's supposed to spawn 5 random skeletons over 10 seconds. The buff I modified was Battle Roar, and the spell I modified was Anti-Magic Shell:
1 ~ How do I make 5 random skeletons be summoned?
2 ~ I triggered a non-random summoning of 5 skeletons with the spell, however the skeletons do not get summoned :P
Here is the trigger (NOTE: I am only beginning to trigger, and in GUI too - so no JASS or vJASS please :P)
Trigger:
Summoning Circle
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Summoning Circle
Collapse Actions
Unit - Create 1 Dark Minion for (Owner of (Targeted unit)) at (Target point of ability being cast) facing Default building facing degrees
Wait 2.00 seconds
Unit - Create 1 Skeletal Orc Grunt for (Owner of (Targeted unit)) at (Target point of ability being cast) facing Default building facing degrees
Wait 2.00 seconds
Unit - Create 1 Burning Archer for (Owner of (Targeted unit)) at (Target point of ability being cast) facing Default building facing degrees
Wait 2.00 seconds
Unit - Create 1 Skeletal Mage for (Owner of (Targeted unit)) at (Target point of ability being cast) facing Default building facing degrees
Wait 2.00 seconds
Unit - Create 1 Skeletal Orc for (Owner of (Targeted unit)) at (Target point of ability being cast) facing Default building facing degrees
11-17-2008, 10:02 AM#2
BestZero
Store variables before using wait. It may not work properly.

Try this
Trigger:
Summoning Circle
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Summoning Circle
Collapse Actions
Set Temp_player = (Owner of (Target unit of ability being cast))
Set Temp_point = (Target point of ability being cast)
Unit - Create 1 Dark Minion for Temp_player at Temp_point facing Default building facing degrees
Wait 2.00 seconds
Unit - Create 1 Skeletal Orc Grunt for Temp_player at Temp_point facing Default building facing degrees
...........
Notice that (Owner of (Target unit of ability being cast)) not (Owner of (Targeted unit))

This spell won't work well if it is cast by two units at the same time because it's global variables not local variables. So maybe you should consider learning JASS.


And I thought you posted in the wrong section. Scripts related go to http://www.wc3campaigns.net/forumdisplay.php?f=8
11-17-2008, 12:34 PM#3
Kino
You could stroe the skeleton types in a unit type array before using a "From every integer A" trigger to slowly release them.
11-18-2008, 12:16 AM#4
Pyrogasm
Rule #1: Don't use "beings casting" because it fires before manacost/cooldown are spent. Instead, use "starts the effect of."

Rule #2: Most event responses don't retain their value after a wait, so you'll need to store Target Point of Ability being Cast in a variable before the wait(s).
11-18-2008, 04:38 AM#5
RenegadeMushroom
Quote:
Originally Posted by Pyrogasm
Rule #1: Don't use "beings casting" because it fires before manacost/cooldown are spent. Instead, use "starts the effect of."

Rule #2: Most event responses don't retain their value after a wait, so you'll need to store Target Point of Ability being Cast in a variable before the wait(s).
Oh, right I see, thanks :)
When storing skeleton types in a unit type variable, do I have to make seperate variables for each one, or is there a way to store 'em in one variable?
Sorry if it seems like a very *noob question, but I've barely begun GUI :P
BestZero, thanks, but what kind of variable is the Temp_player variable? (eg; unit type, game cache)
11-18-2008, 05:31 AM#6
darkwulfv
Temp_Player is a player variable, from what I can see.
11-18-2008, 01:29 PM#7
BestZero
If you have just begun and you want to make it usable in multiplayer game, using array variables for each player is not a bad idea.

And this should do it
Trigger:
Actions
Set Temp_player[(Player number of (Owner of (Target unit of ability being cast)))] = (Owner of (Target unit of ability being cast))
Set Temp_point[(Player number of (Owner of (Target unit of ability being cast)))] = (Target point of ability being cast)
At least this works if it you didn't cast to owner of target unit of ability at the same time.

EDIT : Oops, sorry this didn't work in this case, but it do work fine without using of wait so you just consider this reply is a tip.
11-18-2008, 04:31 PM#8
RenegadeMushroom
Thanks, BestZero :)
+Rep if I can :P
11-18-2008, 04:39 PM#9
Anitarf
You can't have "target unit of ability being cast" and "target point of ability being cast" at the same time, your spell either targets a point or a unit.

Quote:
Originally Posted by Pyrogasm
Rule #2: Most event responses don't retain their value after a wait, so you'll need to store Target Point of Ability being Cast in a variable before the wait(s).
Actually, that's only the case with spellcast event responses as far as I know.
11-18-2008, 10:58 PM#10
Pyrogasm
Meh, when do you ever use non-spellcast events? Player selection and chat events, I guess...
11-19-2008, 07:23 AM#11
RenegadeMushroom
OK, well I've got casting all clear and done (since this afternoon).
But how do I make random skeletons (of a certain group of skeletons) get summoned?
I'm trying to figure it out myself right now, but it's pretty difficult. :P
11-19-2008, 01:18 PM#12
Anitarf
Store the skeleton unit types in a unit type variable array, then use a random num,ber as the index for the array when creating the unit.
11-19-2008, 05:56 PM#13
RenegadeMushroom
OK, thanks a bunch! I assume the following is correct?:
Trigger:
Summoning Circle
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Summoning Circle
Collapse Actions
Set Temp_player[0] = (Owner of (Target unit of ability being cast))
Set Temp_point = (Target point of ability being cast)
Set RandomSkeleton[1] = Dark Minion
Set RandomSkeleton[2] = Skeletal Mage
Set RandomSkeleton[3] = Skeletal Orc
Set RandomSkeleton[4] = Skeleton Archer
Set RandomSkeleton[5] = Giant Skeleton Warrior
Unit - Create 1 RandomSkeleton[(Random integer number between 1 and 5)] for Temp_player[1] at Temp_point facing Default building facing degrees
Wait 2.00 seconds
Unit - Create 1 RandomSkeleton[(Random integer number between 1 and 5)] for Temp_player[1] at Temp_point facing Default building facing degrees
Wait 2.00 seconds
Unit - Create 1 RandomSkeleton[(Random integer number between 1 and 5)] for Temp_player[1] at Temp_point facing Default building facing degrees
I've already tested it and works fine, just wanting to make sure it's right.
11-19-2008, 08:15 PM#14
Anitarf
Wouldn't you want to spawn the skeletons for the owner of the casting unit, not the targeted unit? Why target a unit in the first place?

Also, your indexes for the temp_player are different, I don't think that's intended?
11-19-2008, 08:35 PM#15
bounty_hunter2
You should probably add a Raise dead effect at the spawn position just to look better.