• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Channeling Charm Trigger

Status
Not open for further replies.
Level 21
Joined
Aug 21, 2005
Messages
3,699
after trying it myself (and a long way of GUI pain), I failed in making this spell (well tbh, it's my first actual spell cause I've never made any spells before)

Here's what I want: I want a channel spell (the caster is channeling the spell). as long as the unit is channeling (the unit stops channeling if you move it, start casting another spell or if the unit dies), the targetted unit of the channel spell should be changed ownership to the side of the casting unit. as soon as you sto p channeling, the unit is owned by its original owner again.
if jass is required... well then feel free to make a script & send it, but I can hardly understand it.

so basically, I want a channel spell, that stops finishes channeling after 30 seconds. when channeling: the targetted unit is 'charmed'. as soon as the spell is finished OR stops channeling, the targetted unit is owned by its original owner again.

here's what I did so far:
Trigger 1:
events:
Unit - A unit Begins channeling an ability
Conditions: (Ability being cast) Equal to Charm Test
Actions: Unit - Set the custom value of (Target unit of ability being cast) to (Player number of (Owner of (Target unit of ability being cast)))
Wait 0,01 seconds
Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color

Trigger 2:
Events:
Unit - A unit Stops casting an ability
Unit - A unit Finishes casting an ability
Conditions: (Ability being cast) Equal to Charm Test
Actions: Unit - Change ownership of (Target unit of ability being cast) to (Player((Custom value of (Target unit of ability being cast)))) and Change color

this should work fine, but I get this error as soon as I start casting the spell
http://www.freeimagehost.eu/image/43dc8c37089
I don't get this error anymore if I change the "wait 0,01 seconds" into 1 second, but then the spell is no longer multi instancable, and that's really a MUST.
then, if I stop casting the spell, I get the error again... I have no idea why.
if you wonder why I use custom value rather than changing the ownership to the previous owner, that's because I did that first, but then it didn't change back to the original owner... it just remained under your control.

I really need help.
if you decide to remake the spell for me, and make a multi instancable fully working version, you will be credited. thank you
 
Level 8
Joined
Sep 13, 2006
Messages
431
this should work fine, but I get this error as soon as I start casting the spell
http://www.freeimagehost.eu/image/43dc8c37089

Unfortunately, I don't think it is possible to do in GUI. The "Finishes casting ability" cannot reference the target of the ability, so you cannot select it to change its owner. And the error message appears for me only when I use the player index (as opposed to Player 3 (Teal), etc), about 20 seconds after gaining control of the unit.
 
Level 15
Joined
Feb 9, 2006
Messages
1,598
In your second trigger, the game does not know who ''Target unit of ability being cast'' is. So you have to make a variable for the ''Target unit of ability being cast'' unit. And then somehow detect that unit in the second trigger.....I can't really think of a way to do that in GUI, so I think you'll need JASS.
 
Level 10
Joined
Nov 10, 2004
Messages
351
It is possible!

It actually is possible to do in GUI, with a little use of custom script.
The map is attached here, to implement it into your map, just copy the H2I and U2I function from the custom script section, copy the Channeled Charm ability and copy both triggers.
Have fun! :)

By the way, the spell will bug a little if 2 units Charm the same target at one time. you can just add some kind of condition not allowing targets already charmed by the spell, to be charmed by another target.
 

Attachments

  • Channeled Charm.w3x
    17.9 KB · Views: 73

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I know you have what you wanted but. . .

Is there not an event called unit finished channeling an ability since I am sure there is because I used it in one of my spell which was an enhanced starfall.

Anyway this is very simlar to my psyco charm I made a while ago except that was an AOE charm for a duration not a channel.
 
Status
Not open for further replies.
Top