HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Help Please

10-30-2006, 03:03 AM#1
EveOfFire
I have a trigger that posseses a unit giving control over the unit for a limited amount of time and putting them in cinema if they are a human controlled unit, before going out of the unit and giving back control... but it never gives back the control to the person. Here is the trigger, if you have any suggestions please tell me.

Trigger:
Possess
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
((Owner of (Target unit of ability being cast)) controller) Equal to User
(Ability being cast) Equal to Infection
Collapse Actions
Set Possessed_Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Target unit of ability being cast))
Set Possessed_Unit[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
Player Group - Add (Owner of (Casting unit)) to Possessed_Group
Cinematic - Disable user control for (Player group((Owner of (Target unit of ability being cast))))
Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Retain color
Unit - Hide (Casting unit)
Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using war3mapImported\FHugger.mdx
Special Effect - Destroy (Last created special effect)
Unit - Create 1 Aura for Neutral Passive at (Position of (Target unit of ability being cast)) facing Default building facing (270.0) degrees
Set Aura_Unit[(Player number of (Owner of (Casting unit)))] = (Last created unit)
Trigger - Turn on Move unit <gen>
Wait 60.00 seconds
Cinematic - Enable user control for (Player group(Possessed_Player[(Player number of (Owner of (Casting unit)))]))
If ((Number of players in Possessed_Group) Less than 1) then do (Trigger - Turn off Move unit <gen>) else do (Do nothing)
Unit - Remove Aura_Unit[(Player number of (Owner of (Casting unit)))] from the game
Player Group - Remove (Owner of (Casting unit)) from Possessed_Group
Special Effect - Create a special effect at (Position of Possessed_Unit[(Player number of (Owner of (Casting unit)))]) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Change ownership of Possessed_Unit[(Player number of (Owner of (Casting unit)))] to Possessed_Player[(Player number of (Owner of (Casting unit)))] and Retain color
Unit - Move (Casting unit) instantly to (Position of Possessed_Unit[(Player number of (Owner of (Casting unit)))])
Unit - Unhide (Casting unit)
Unit - Create 1 Trigger Caster for Neutral Passive at (Position of Possessed_Unit[(Player number of (Owner of (Casting unit)))]) facing Default building facing (270.0) degrees
Unit - Order (Last created unit) to Neutral - Firebolt Possessed_Unit[(Player number of (Owner of (Casting unit)))]
10-30-2006, 05:49 AM#2
Ignitedstar
It's really hard to read the trigger. Please use [trigger] tags.
10-30-2006, 07:04 AM#3
EveOfFire
That should help right?
10-30-2006, 07:13 AM#4
zen87
hmph.... don't use wait action for this, use timer instead
10-30-2006, 08:28 AM#5
EveOfFire
Even so, I doubt that would help with my trigger's problem.. :/ plus there is more then one action that is to be done after the wait, like the fireball to stun the person for a few seconds so the person can get away.
11-01-2006, 09:01 AM#6
[VDM]Amn
I've added two comments in the trigger.

Quote:
Originally Posted by EveOfFire
I have a trigger that posseses a unit giving control over the unit for a limited amount of time and putting them in cinema if they are a human controlled unit, before going out of the unit and giving back control... but it never gives back the control to the person. Here is the trigger, if you have any suggestions please tell me.

Trigger:
Possess
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
((Owner of (Target unit of ability being cast)) controller) Equal to User
(Ability being cast) Equal to Infection
Collapse Actions
Set Possessed_Player[(Player number of (Owner of (Casting unit)))] = (Owner of (Target unit of ability being cast))
-------- Shouldn't the below value for the array be -player number of owner of casting unit? ;p --------
Set Possessed_Unit[(Player number of (Owner of (Target unit of ability being cast)))] = (Target unit of ability being cast)
Player Group - Add (Owner of (Casting unit)) to Possessed_Group
Cinematic - Disable user control for (Player group((Owner of (Target unit of ability being cast))))
Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Retain color
Unit - Hide (Casting unit)
Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using war3mapImported\FHugger.mdx
Special Effect - Destroy (Last created special effect)
Unit - Create 1 Aura for Neutral Passive at (Position of (Target unit of ability being cast)) facing Default building facing (270.0) degrees
Set Aura_Unit[(Player number of (Owner of (Casting unit)))] = (Last created unit)
Trigger - Turn on Move unit <gen>
Wait 60.00 seconds
-------- After a wait action stop referring to units/players of Event Responses functions, this values may get lost by then. i think only -triggering unit and triggering player keeps its values till the end of the trigger. --------
Cinematic - Enable user control for (Player group(Possessed_Player[(Player number of (Owner of (Casting unit)))]))
If ((Number of players in Possessed_Group) Less than 1) then do (Trigger - Turn off Move unit <gen>) else do (Do nothing)
Unit - Remove Aura_Unit[(Player number of (Owner of (Casting unit)))] from the game
Player Group - Remove (Owner of (Casting unit)) from Possessed_Group
Special Effect - Create a special effect at (Position of Possessed_Unit[(Player number of (Owner of (Casting unit)))]) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Change ownership of Possessed_Unit[(Player number of (Owner of (Casting unit)))] to Possessed_Player[(Player number of (Owner of (Casting unit)))] and Retain color
Unit - Move (Casting unit) instantly to (Position of Possessed_Unit[(Player number of (Owner of (Casting unit)))])
Unit - Unhide (Casting unit)
Unit - Create 1 Trigger Caster for Neutral Passive at (Position of Possessed_Unit[(Player number of (Owner of (Casting unit)))]) facing Default building facing (270.0) degrees
Unit - Order (Last created unit) to Neutral - Firebolt Possessed_Unit[(Player number of (Owner of (Casting unit)))]
good luck, the spell looks good.
surely u'll end up with something different after some tests. i mean, the player having his unit possessed cant play for 60 seconds.
11-06-2006, 06:46 PM#7
EveOfFire
Yeah, but it won't give back the unit, tested it on a dog in game, and I was walking around for 15 mins as a dog :/


Edit: Wait, I think I see the problem, if this is it I'm going to hate myself for not seeing it sooner, but if it is why did it allow me to possess the dog in the first place?!
11-07-2006, 05:05 PM#8
Anitarf
Don't use Casting unit, it's bugged and can fail after a wait, use Triggering unit instead.
11-07-2006, 06:30 PM#9
1RingToRule
I had a problem like that with a map of mine about a year ago.

Simply store the (casting unit) as a variable and refer back to it for everything after the wait.

If you are making it a multiplayer you will need multiple variables or an array as then you can run into the problem of someone doing the same spell/ability while you are waiting.
11-08-2006, 08:30 AM#10
Anitarf
There's no need for all that, Triggering unit will work just fine.
11-08-2006, 03:20 PM#11
1RingToRule
Are you sure that works in multi-instancing?
11-08-2006, 05:46 PM#12
Anitarf
Absolutely.