• 🏆 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!

Cannot get GUI Code working

Status
Not open for further replies.
Level 1
Joined
Oct 21, 2012
Messages
5
Hey there, I have a problem, i'm trying to get a 'Computer Hero' to cast a spell such as death coil.

At 1st i thought it was because i was using a trigger to attack move my spawn units.

I tried simply putting one Death Night(Computer Enemy) and One Demon Hunter(My Unit) in the top right corner of the map to test it.

The code i am using (GUI):

Events
Unit - Death Knight 0004 <gen> Is attacked

Actions
Unit - Order Death Knight 0004 <gen> to Undead Death Knight - Death Coil (Triggering unit)


People have said this should work, it has not.
Is there something i am missing, like maybe having the death knight learn death coil? Or should the Death Knight be learning it by himself.

Note: The Death Knight is not generated from a spawn, He's already made.
Also, if i have a spawn generated hero, how do i do multiple triggers to have them cast spells as well as attack move. Any help is much appreciated!

PS: I also tried putting this code in Map Initialization:

Events
Map initialization
Unit - A unit owned by (Owner of Death Knight 0004 <gen>) Learns a skill
Actions
Unit - Set level of Death Coil for Death Knight 0004 <gen> to 1

This doesn't seem to do anything? What am i doing wrong?!
 
Last edited:
Level 1
Joined
Oct 21, 2012
Messages
5
"Triggering unit" refers here to the attacked unit, not the attacker.
So you are basically ordering the Death Knight to Death Coils himself.

I changed it to

Event:
Unit - Death Knight 0004 <gen> Is attacked

Action:
Unit - Order Death Knight 0004 <gen> to Undead Death Knight - Death Coil (Attacking unit)

and it still doesn't work, any idea?
 
Last edited:
Level 1
Joined
Oct 21, 2012
Messages
5
There should be an event response that is something like "Attacking Unit". Just change "Triggering Unit" to that.

I did exactly that, but the death knight still does not cast the spell.

Do i need to make the death knight learn the spell or something?
 

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
I did exactly that, but the death knight still does not cast the spell.

Do i need to make the death knight learn the spell or something?

Yes. Do that:

[trigger="Death Coil"]Death Coil
Events
Map initialization
Conditions
Actions
Unit - Set level of Death Coil for [*Your Death Knight*] to 1
[/trigger]

The other trigger should be:
[trigger="Death Coil 2"]Death Coil 2
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacked unit)) Equal to Death Knight
Actions
Unit - Order (Attacked unit) to Undead Death Knight - Death Coil (Attacking unit)
[/trigger]

If it still doesn't work, make sure he has enough mana to cast the ability.

EDIT: You can also manually level up Death Coil for your hero by double clicking him in the World Editor.
 
Level 1
Joined
Oct 21, 2012
Messages
5
Death Coil:
Events:
Map initialization

Actions:
Unit - Set level of Death Coil for [*Your Death Knight*] to 1

Does not seem to work, (The Manual way does work though) Any ideas on how to make this work, i plan on having units spawned then attack moving to a position (And then casting spells if attacked)

EDIT: I also just tried

Death Coil:
Events:
Time - Elapsed game time is 1.00 seconds

Actions:
Unit - Set level of Death Coil for [*Your Death Knight*] to 1

This does not seem to work either.
 
Last edited:

SpasMaster

Hosted Project: SC
Level 23
Joined
Jan 29, 2010
Messages
1,969
[trigger="HeroDef"]Hero Def
Events
Unit - A unit enters (Playable map area)
Conditions
(Unit-type of (Entering unit)) Equal to [Your unit here]
Actions
Unit - Set level of [Your ability here] for (Entering unit) to 1
[/trigger]

There ya go :)
 
...
  • Hero - Learn skill for Death Knight 0004 <gen>: Death Coil
When a hero has a skill in his "hero ability list", he doesn't get the spell in his "unit ability list" until he learns the spell at least at lvl 1.
Until that moment, you can't use the action "Set level of Ability" on it (and it's depreciated even after that since it will mess up with the hero's way of upgrading the skill).

By the way, manually setting the preplaced hero's skill will actually create a kind of "trigger" that uses the very same action I gave and that is run on map initialisation.
 
Level 1
Joined
Oct 21, 2012
Messages
5
...
  • Hero - Learn skill for Death Knight 0004 <gen>: Death Coil
When a hero has a skill in his "hero ability list", he doesn't get the spell in his "unit ability list" until he learns the spell at least at lvl 1.
Until that moment, you can't use the action "Set level of Ability" on it (and it's depreciated even after that since it will mess up with the hero's way of upgrading the skill).

By the way, manually setting the preplaced hero's skill will actually create a kind of "trigger" that uses the very same action I gave and that is run on map initialisation.

WOW. Helped so much! :) Thanks!
 
Status
Not open for further replies.
Top