• 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] One Trigger For Complicated Hero Ability?

Status
Not open for further replies.
Level 13
Joined
May 11, 2008
Messages
1,198
I've seen spells like this, but I can't understand them and I can't do it for mine.
I've asked a little about this in another thread, but it wasn't the title of the thread and nobody helped me with it so here is a new thread with a more accurate title describing what i'm looking for.

Here is what i'm trying to do.

And I've done it, but it took me about 24 triggers or so.

Auto Flame Strike is the name of the ability.

Most of the time I find myself using auras alot with triggers, they seem easy to work with, you can do on the triggers looking for if a unit has buff and use the buff that goes with the aura.

So the Hero has 4 different Auras for the 4 different levels. like Devotion, Vampiric, Trueshot, Endurance, whatever. Anyway I got all those auras and buffs edited so they all look like Auto Flame Strike level 1-4. They are of course, auras that are only on the user. And then for the trigger...

Well let me say first of all that I'm only using one level of flame strike for this ability. I want the damage and radius and those kinds of things the same for each level. But since it's an automatic flamestrike casting ability, I want the flame strike to get casted automatically at regular intervals. I've been making it so that when the level goes up, the frequency increases. So it is set so that at level one, it strikes every 40 seconds, at level two, every 30 seconds, level three, every 20 seconds, and level 4, every ten seconds.

Anyway, I had alot of problems getting the flamestrike to level up properly, and I might've had problems with leaks along the way...So I ended up with 24 triggers or so and well, couldn't it all have been done in one very simply? But I don't know how. Anyway I'll take whatever solution you got, Jass or GUI or both or whatever. Here is the link to my map if you wanna check out the triggers: The Demon Hunt 0.937 - The Hive Workshop - A Warcraft III Modding Site

Off Topic:
Originally I had wanted to make it so that the flame strike hits a random area around the Hero, but I decided that I knew absolutely nothing about how to do that. So I settled for making it hit where the caster is. As you can tell by looking in the object editor the flamestrike doesn't hurt the Hero. I think I like this feature, so I don't think I'll change it.

P.S.
I downloaded that MasterHaosis map that Alexis Septimus made and used the timer trigger for my map. (for 0.938) (I had looked around but couldn't find any proper timers or timer variables that worked/that I could understand, before I had been stuck with using some bizzare counting of how much gold/lumber/food neutral extra and hostile have and nonsense like that, and then the leaderboard too.)Wow, cool. So...can you make additional timers then? and you don't need to make windows if you're just wanting to use them for variables for abilities, right? maybe I should use a timer expires event and timer variable for my ability? that might help? i'm not sure...but someone suggested that in an older thread.
 
Level 10
Joined
Jun 1, 2008
Messages
485
try this tutorial on Individual Nova for random location flame strike, and add this trigger
  • Auto Flame Strike
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to (==) Auto Flame Strike
    • Actions
      • Trigger - Add to Melee Initialization <gen> the event (Time - Every (50.00 - (10.00 x (Real((Level of Auto Flame Strike for (Triggering unit)))))) seconds of game time)
 
Level 13
Joined
May 11, 2008
Messages
1,198
well i don't understand how to use the real variable so that does not help me.

i don't think that would work anyway because i would for example be casting the spell every 40 and every 30 at level two because both events would be on the trigger and i would only want 30 on there at level 2 and not 30 and 40.

that nova spell tutorial doesn't seem to help, it's not that i can't make a spell. i got a dummy caster casting the spell...that's not a problem.

anyway i'm implementing the idea that was given to me before, about the timers, hopefully having 5 timers running all game isn't going to be a problem. (a one shot timer and 4 repeating timers)

here is what i got: (let me know what you guys think)

btw, once again, i don't know how to do that cool thing that everyone else does, so bear in mind that there are no else actions...

edit: one more thing! this will be no problem with multiple red dragon demon hunters, right?

flamestrikelevel1
Events
Time - tmr_fslvl1 expires
Conditions
Actions
Set unitgroups = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to |cffBC310ERed Dragon Demon Hunter|r))
Unit Group - Pick every unit in unitgroups and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff flamebuff[0]) Equal to True
Then - Actions
Set points = (Position of (Picked unit))
Unit - Create 1 Archer for (Owner of (Picked unit)) at points facing Default building facing degrees
Unit - Order (Last created unit) to Human Blood Mage - Flame Strike points
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_points)
Custom script: set udg_points = null
Else - Actions
Custom script: call DestroyGroup(udg_unitgroups)
Custom script: set udg_unitgroups = null

flamestrikelevel2
Events
Time - tmr_fslvl2 expires
Conditions
Actions
Set unitgroups = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to |cffBC310ERed Dragon Demon Hunter|r))
Unit Group - Pick every unit in unitgroups and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff flamebuff[1]) Equal to True
Then - Actions
Set points = (Position of (Picked unit))
Unit - Create 1 Archer for (Owner of (Picked unit)) at points facing Default building facing degrees
Unit - Order (Last created unit) to Human Blood Mage - Flame Strike points
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_points)
Custom script: set udg_points = null
Else - Actions
Custom script: call DestroyGroup(udg_unitgroups)
Custom script: set udg_unitgroups = null

flamestrikelevel3
Events
Time - tmr_fslvl3 expires
Conditions
Actions
Set unitgroups = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to |cffBC310ERed Dragon Demon Hunter|r))
Unit Group - Pick every unit in unitgroups and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff flamebuff[2]) Equal to True
Then - Actions
Set points = (Position of (Picked unit))
Unit - Create 1 Archer for (Owner of (Picked unit)) at points facing Default building facing degrees
Unit - Order (Last created unit) to Human Blood Mage - Flame Strike points
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_points)
Custom script: set udg_points = null
Else - Actions
Custom script: call DestroyGroup(udg_unitgroups)
Custom script: set udg_unitgroups = null

flamestrikelevel4
Events
Time - tmr_fslvl4 expires
Conditions
Actions
Set unitgroups = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to |cffBC310ERed Dragon Demon Hunter|r))
Unit Group - Pick every unit in unitgroups and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff flamebuff[3]) Equal to True
Then - Actions
Set points = (Position of (Picked unit))
Unit - Create 1 Archer for (Owner of (Picked unit)) at points facing Default building facing degrees
Unit - Order (Last created unit) to Human Blood Mage - Flame Strike points
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_points)
Custom script: set udg_points = null
Else - Actions
Custom script: call DestroyGroup(udg_unitgroups)
Custom script: set udg_unitgroups = null

flamestrike
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Auto Flame Strike (devotion aura)
Actions
Trigger - Run tmrfs <gen> (checking conditions)
Trigger - Turn on flamestrikelevel1 <gen>
Trigger - Turn on flamestrikelevel2 <gen>
Trigger - Turn on flamestrikelevel3 <gen>
Trigger - Turn on flamestrikelevel4 <gen>
Custom script: call DestroyTrigger(GetTriggeringTrigger())

set fs
Events
Map initialization
Conditions
Actions
Set flamebuff[0] = Auto Flame Strike - Level 1
Set flamebuff[1] = Auto Flame Strike - Level 2
Set flamebuff[2] = Auto Flame Strike - Level 3
Set flamebuff[3] = Auto Flame Strike - Level 4
Custom script: call DestroyTrigger(GetTriggeringTrigger())

tmrfs
Events
Conditions
Actions
Countdown Timer - Start tmr_fslvl1 as a Repeating timer that will expire in 40.00 seconds
Countdown Timer - Start tmr_fslvl2 as a Repeating timer that will expire in 30.00 seconds
Countdown Timer - Start tmr_fslvl3 as a Repeating timer that will expire in 20.00 seconds
Countdown Timer - Start tmr_fslvl4 as a Repeating timer that will expire in 10.00 seconds
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
You said anything, so do not complain :p
vJass + HSAS
(Getting JNGP is recommended)

It works with a single trigger. It is perfectly MUI(though it is currently configured to support up to 100 different units running the spell; but actually it still supports infinite instances(HSAS ftw) but in a bit slower way; the 100 can be changed to something bigger (lets say 8000) nonetheless).

It can be done in a different fashion, but this is the one I chose and did not need a lot of thinking(talking about level up adjustment way).
 

Attachments

  • Autocast.w3x
    22.5 KB · Views: 56
Level 13
Joined
May 11, 2008
Messages
1,198
oh this will take quite a bit of homework to figure out what you just told me...thanks, spiwn...i'll be sure to let you know if the information was useful...sure looks like it.
and cokemonkey11 thanks for the input...i'll check into that a bit later.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Ops, I lied in the previous post - it is not 100, but 500.
And the test map is short on comments :(
If you have any questions just ask.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Ah, yes. But that is because I set the times to 10,6,4,1 for testing purposes... having to wait 40 seconds is kinda boring and pointless.
The function called TimeTables has all the times, they are commented - you will easily spot them. You can make this work for as much levels as you need.
Ask for anything you do not understand.
If you want, I can adjust anything to your liking.
 
Level 13
Joined
May 11, 2008
Messages
1,198
Ah, yes. But that is because I set the times to 10,6,4,1 for testing purposes... having to wait 40 seconds is kinda boring and pointless.
The function called TimeTables has all the times, they are commented - you will easily spot them. You can make this work for as much levels as you need.
Ask for anything you do not understand.
If you want, I can adjust anything to your liking.

uhm...ok...how about...what are the advantages of this trigger setup over what i displayed in a few posts above? i'm about to make some adjustments now, i was busy reading up on starcraft 2 news because i was offline at home for about a month and was wondering what had happened at that event in california.

just to double check...all you got in there is the 2 custom abilities, the edited bloodmage abilities, and the two triggers? anyway the hero using the ability is what used to be a farseer, i assume that's not an issue? i guess i'll just test the new ability and see...

lol...disabling and then enabling the triggers gets the world editor angry at you...what the heck?
oh i can't even save the map with those triggers...i assume you're using an advanced world editor? which one? well it's either that or i forgot to copy over something from the other map...but i kinda doubt that's the issue since the triggers won't enable in the autocast map.

oh well i did forget your dummy footman guy...haha and i've also just now noticed that you used some of the same interface settings as my map...apparently you deleted most of the data from it...that or you exported my settings...lol
yeah it's kinda weird because the items are edited too but then like the names of the items aren't there for whatever reason... oh i get it, apparently you can save your map and then although it says the trigger has been disabled due to errors it really won't disable it before saving so you can reload the map and it will be fine. anyway this will be a pain to hear my comp go beep beep beep every time i save my map...plus then i have to close it and load it back up if i want to keep working on it....got a good solution?

ok well anyway i'll get jngp, sounds like a program? and figure out what vjass is...i guess it's like jasscraft?
oh...is some of these options what they sound like? merge object editor data...etc?

so uhm how do you get rid of the problem that the syntax checkers always say that the global variables that you make in the gui are invalid or whatever?

ok so apparently that program you recommended doesn't have a problem with those triggers in that autocast map...that's good.

this section:
private constant integer abilid='A000'
private constant integer dummyabilid='A001'
private constant integer dummyid='h000'

don't i need to change those numbers? i assume they correspond to the custom dummy unit and the custom abilities...it seems to me if i already had custom abilities...which i think i do...then it's going to be a problem...i don't have any custom units yet though. i guess since i only had 2 abilities i should just add 2 to those numbers...so...
private constant integer abilid='A002'
private constant integer dummyabilid='A003'
private constant integer dummyid='h000'
that's fine, but what if i don't want to swap my tooltips and whatever else from my previous stuff? like the flamestrike ability...how can i find out what numbers i need for the non custom abilities?
ok this might sound like a stupid question but did you create flamestrike or evasion first?
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Lol, long post :p
Yeah, as said JNGP.
Do not use the Syntax checker, it does not show errors properly. Just save the map.
In the object editor press Ctrl + D to see the raw codes.
Those constants are there only so that you can configure the trigger easier(but I forgot to comment ;) ).
 
Level 13
Joined
May 11, 2008
Messages
1,198
The JNGP built in syntax checker does not check the syntax of vJass (oddly enough)

It also can return false positives in inittrigs and editor-defined globals (like a preplaced rect or cameraobject)

yeah that's about what it seemed like.

well anyways, thanks for your help, guys...unless i'm mistaken my triggers that i came up with mostly with the use of timers that i got from that masterhaosis map are working pretty good.

actually, i went through my triggers and found alot of small problems...i fixed them. i think i did that before jngp but i was adding some new features which were probably a bit easier with this new editor such as changing some variables around and changing the colors for tooltips. it's kinda cool to see alternate colors in the jass in the world editor...i used that a bit to double check things.

well, for right now i need to take a bit of a break from programming...it's too much work! haha...i updated my map to 0.938 now and later on i'll try to learn more about this ABC and HSAS and real functions...

i'll probably post a new thread in a few fortnights or so when i get stumped again and am having difficulty learning about something.
 
Status
Not open for further replies.
Top