HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Cant Figure it out

05-23-2007, 11:41 PM#1
famouspker49
alright i am trying to make a trigger in which the hero casts and ability and it creates a vortex of energy that sucks mana or life (not sure yet) but i create a lightning effect and i need it to last a certain amount of time, before i destroy it and i would guess u would use the "wait" thing to do that, but when i do that the effect does not get destroyed and if the destroy special effect is right after the create it doesnt show up here it is i am somewhat experienced in GUI and not at all in JASS

Trigger:
Vortex
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Mana Bomb (Neutral Hostile)
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 512.00 of (Target point of ability being cast) matching ((Owner of (Picked unit)) Not equal to (Owner of (Triggering unit)))) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Target point of ability being cast) facing (Facing of (Picked unit)) degrees
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Special Effect - Create a special effect at (Center of (Region centered at (Position of (Last created unit)) with size (512.00, 512.00))) using Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
Wait 2.00 seconds
Special Effect - Destroy (Last created special effect)
Lightning - Create a Forked Lightning lightning effect from source (Center of (Region centered at (Position of (Last created unit)) with size (512.00, 512.00))) to target (Position of (Picked unit))
Wait 0.50 game-time seconds
Lightning - Destroy (Last created lightning effect)
Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Banish\BanishTarget.mdl
Special Effect - Destroy (Last created special effect)
05-24-2007, 12:01 AM#2
Dil999
Set it to a variable andd= destroy the variable
05-24-2007, 07:30 AM#3
Alexander244
Last created special effect refers to the last created special effect; you are making one for every enemy in a region, so at best only one of those will be destroyed, and possibly one elsewhere on the map that was just created.
In order to keep track you will need to use local variables, using this trick;

global variable:
type: effect
name: TempEffect

Trigger:
Actions
Custom script: local effect udg_TempEffect
Special Effect - Create a special effect at YourPoint using Whatever.mdl
Set TempEffect = (Last created special effect)
Wait X seconds
Custom script: Now you can use the TempEffect global to manipulate the effect

You would need to do a similar thing for the lightning, but i seem to remember you can only use this trick once.. so you would need to do it in JASS to make your life easier.
05-24-2007, 03:41 PM#4
Dil999
Looking at it again, that wont work at all.
You need to have seperate loops for each wait, and use several arrays.
05-24-2007, 10:48 PM#5
famouspker49
ya ok i tried ur reccomendation alex and it popped up saying "expected code statement" and the line saying "local effect udg_tempeffect" is highlighted
05-25-2007, 10:44 AM#6
Alexander244
Firstly, you shouldn't use waits inside ForGroup callbacks (Unit Group - Do Actions...).
It is fairly simple to make a single instance version, I have outlined the basics of what you would need below, but no multi-instancing without jass/making it over-complicated. There are some leaks in the code below that will need cleaning up. I hope this helps.

Globals:
Integer VortexGroupSize
Special Effect VortexEffect array
Unit TempUnit
Unit Group VortexGroup
Lightning VortexLightningarray

Trigger:
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 512.00 of (Target point of ability being cast) matching ((Owner of (Triggering unit)) Not equal to (Owner of (Picked unit)))) and do (Actions)
Collapse Loop - Actions
Unit Group - Add (Picked unit) to VortexGroup
-------- Create Your Dummies etc. --------
Set VortexGroupSize = (Number of units in VortexGroup)
Collapse For each (Integer A) from 1 to VortexGroupSize, do (Actions)
Collapse Loop - Actions
Set TempUnit = (Random unit from VortexGroup)
Unit Group - Remove TempUnit from VortexGroup
Special Effect - Create a special effect at (Position of TempUnit) using Whatever.mdl
Set VortexEffect[(Integer A)] = (Last created special effect)
Wait 2.00 game-time seconds
Collapse For each (Integer A) from 1 to VortexGroupSize, do (Actions)
Collapse Loop - Actions
Special Effect - Destroy VortexEffect[(Integer A)]
-------- Just Repeat for Lightning --------
05-25-2007, 12:00 PM#7
famouspker49
sweet it works thanks a lot +rep for sure
but i got another question how do i create and effect that is much larger than it normally would be? because i want to create an explosion of energy that damages but i want it coming from the point of the ability being cast
05-25-2007, 07:51 PM#8
Alexander244
You can attach effects to units with different scales; this way you can change the scale and move the effect around.
You can get a dummy model specially designed for this like; the two I know of are in Infrane's Particle System and Vexorian's Caster System; these also have animations so you make the effects point in all directions and stuff.
Then just make a unit with locust and that model and attach your effects.