• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger doesnt work

Status
Not open for further replies.
Level 7
Joined
Dec 5, 2013
Messages
280
I am trying to make boss cast this spell when players enter in 50 range from the boss, but nothing happens.

JASS:
function Trig_LKspell1_Actions takes nothing returns nothing
    call UnitAddAbilityBJ( 'A002', gg_unit_H00N_0336 )
    call SetUnitAnimation( gg_unit_H00N_0336, "spell channel" )
    call TriggerSleepAction( 2.00 )
    call IssuePointOrderLocBJ( gg_unit_H00N_0336, "a002", GetUnitLoc(gg_unit_H00N_0336) )
endfunction

//===========================================================================
function InitTrig_LKspell1 takes nothing returns nothing
    set gg_trg_LKspell1 = CreateTrigger(  )
    call TriggerRegisterUnitInRangeSimple( gg_trg_LKspell1, 50.00, gg_unit_H00N_0336 )
    call TriggerAddAction( gg_trg_LKspell1, function Trig_LKspell1_Actions )
endfunction
 
Level 7
Joined
Dec 5, 2013
Messages
280
I cant find all options I need in GUI and making GUI trigger and then converting into custom text is easy way to see how it works and I can change some parts of the code.

In place of a002 was originally Blizzard spell, the list didnt have all of the spells in the game so I was unable to get my custom spell from the list.

Why custom spell names are not in the order string list?
 
I cant find all options I need in GUI and making GUI trigger and then converting into custom text is easy way to see how it works and I can change some parts of the code.

In place of a002 was originally Blizzard spell, the list didnt have all of the spells in the game so I was unable to get my custom spell from the list.

Why custom spell names are not in the order string list?

Okay then learn JASS because that piece of code up there is bad.

Did you find the correct order string in the object editor?
 
Level 7
Joined
Dec 5, 2013
Messages
280
I used the default order string of the custom spell and changed it in the code, but still nothing happens.

I would like to learn JASS but despite hours and hours of reading tutorials I still could not understand anything about writing jass. I would use just GUI but GUI does not even have command like "destroy all path blockers", only "destroy random"
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
You should really try to understand the GUI before you try trekking into pure JASS because something as elementary as this will be the least of your concerns.

Also...post the updated trigger, we don't know what advances you've made or not. Also tell us the base spell and we can simply tell you the order string if you are unable to locate it.

Edit: About path blockers, you can just add them to a destructible group and remove them I'm pretty sure. While GUI definitely has its limitations, if you're struggling try to embrace it and weave JASS in slowly and as needed.
 
Level 7
Joined
Dec 5, 2013
Messages
280
Thunderclap isn't a point order.

IssueImmediateOrder
I changed that and now there are following errors:

line2: undeclared variable gg_unit_H00N_0336
line5: too many arguments passed to function
line 10: undeclared variable gg_trg_LKspell1
line 11: undeclared variable gg_unit_H00N_0336

JASS:
function Trig_LKspell1_Actions takes nothing returns nothing
    call UnitAddAbilityBJ( 'A002', gg_unit_H00N_0336 )
    call SetUnitAnimation( gg_unit_H00N_0336, "spell channel" )
    call TriggerSleepAction( 2.00 )
    call IssueImmediateOrder( gg_unit_H00N_0336, "thunderclap", GetUnitLoc(gg_unit_H00N_0336) )
endfunction

//===========================================================================
function InitTrig_LKspell1 takes nothing returns nothing
    set gg_trg_LKspell1 = CreateTrigger(  )
    call TriggerRegisterUnitInRangeSimple( gg_trg_LKspell1, 50.00, gg_unit_H00N_0336 )
    call TriggerAddAction( gg_trg_LKspell1, function Trig_LKspell1_Actions )
endfunction
 
See you're in over your head just like I said.

This is such a basic change you couldn't even make because you don't know the the first thing about JASS nor does it seem like you event want to know.
You want people to write stuff for you so you can copy it in your map without even understanding what's going on.

The line should be this:

call IssueImmediateOrder( gg_unit_H00N_0336, "thunderclap")

line5: too many arguments passed to function

If you can't even read the syntax errors you shouldn't be using JASS. It clearly stated the problem..
 
Level 7
Joined
Dec 5, 2013
Messages
280
Best way to learn is by example, and this is exactly how learning happens most effectively. Also reading syntax errors have no use if I dont understand where stated problem is.

I changed that line removing the last argument, but trigger still doesnt do anything.
 
Also reading syntax errors have no use if I dont understand where stated problem is.

It said the error was on line 5?

I changed that line removing the last argument, but trigger still doesnt do anything.

Does the trigger even fire?

add BJDebugMsg("debug")'s throughout your trigger and see if any messages display. If they do, the issue is with order string.

50 is also a small range, try 90+

Best way to learn is by example, and this is exactly how learning happens most effectively

Sure it's a great way to learn, but that's not what you're doing.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
lol, it says line 5, but whatever.

It would make more sense if you want to learn JASS, to read tutorials and practice on your own. Make this trigger in GUI, make sure it works how you want it to. Then convert it to JASS and interpret what you had and see how it was manipulated by the system.

Saying I want to learn, I want to learn but expecting someone to just fix your problems with no effort of your own does not seem genuine to me.

I'm not "mad" that you are posting trying to get help its just like someone with only general math knowledge does not attempt to understand Calculus. They need to build up their knowledge base before delving into the next tier, in this instance coding in JASS.

EDIT: If the trigger had errors it was likely disabled, did you re-enable it?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
I completely disagree. It was made to be as easy for beginners to understand as possible.

In your instance trying to get your unit to cast thunderclap...

You would go to actions...

Then look for something to the effect of

Issue a Unit order with No Target

Specify the unit, specify the order "Human Mountain King Thunderclap" for your thunderclap based spell.

Seems to be very logical in my opinion.
 
Level 7
Joined
Dec 5, 2013
Messages
280
But if GUI trigger makes unit to cast thunderclap, then doesnt it cast the original thunderclap instead of my custom spell? how can i differentiate between ordering to cast real thunderclap and custom spell?
 
But if GUI trigger makes unit to cast thungerclap, then doesnt it cast the origina thunder clap instead of my custom spell? how can i differentiate between ordering to cast real thunderclap and custom spell?

You would have to give the spell a different order string.

As I said a few posts back the field is under Text - Order String in the object editor.
 
Level 7
Joined
Dec 5, 2013
Messages
280
As I said previously, I checked that order string command, but problem was that there are no custom spells in the list
 
As I said previously, I checked that order string command, but problem was that there are no custom spells in the list

There are no custom order strings, you have to re-use already created ones.
  1. Go to your ability in the object editor.
  2. Find Text - Order String.
  3. Change the value to something that doesn't conflict with other spells the unit has.
  4. Order it via triggers
    • Unit - issue "some spell string" to unit
 
Level 7
Joined
Dec 5, 2013
Messages
280
I issued order with no target and spell thunderclap, nothing happens

Trigger only has event unit enters region
 
Status
Not open for further replies.
Top