• 🏆 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] Something wrong with my trigger. . .Help!

Status
Not open for further replies.
Level 10
Joined
Sep 3, 2009
Messages
458
Well hello there everyone!

I'm working on a combo system. basically what is does is string together abilities you set.

For example:

After Casting Ability One > Remove Ability One > Add Ability two

if ability two is not used

Remove Ability two > Add first ability

else

continue to ability three and so on.

Right now I'm having a little problem. In my trigger there's a variable called "Combo_Timer" this determines how long to wait until an unused combo ability is removed.

It functions like I wanted it to, going through first, second, to third ability. But the delay is two long for me so I decided to reduce it to 1.00 second. When I tested it, it only came to the second ability and didn't go to the third.

It seems there is something wrong with my timer trigger or something. Apparently I can't find a solution. Can anyone help me out?

here are the triggers:

This Trigger is run when the first ability is cast. The needed variables are set at that time as well.
  • Combo Start
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo_MinSize Equal to 0
        • Then - Actions
          • Trigger - Turn on Combo Timer <gen>
          • Trigger - Turn on Combo Continue <gen>
        • Else - Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Increase the index size --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Combo_MinSize = (Combo_MinSize + 1)
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Dynamic Index --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo_MinSize Greater than Combo_MaxSize
        • Then - Actions
          • Set Combo_Index[Combo_MinSize] = Combo_MinSize
          • Set Combo_MaxSize = Combo_MinSize
        • Else - Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Dynamic Index End --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • Set ComboInt = Combo_Index[Combo_MinSize]
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Variable Setup --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • Set Combo_Timing[ComboInt] = True
      • Set Combo_AddCaster[ComboInt] = Combo_Caster
      • Set Combo_SIndex[ComboInt] = 0
      • Set Combo_Timer[ComboInt] = 1.00
      • Set Combo_Counter[ComboInt] = Combo_NCombos
      • Unit - Remove Combo_Sequence[Combo_SIndex[ComboInt]] from Combo_AddCaster[ComboInt]
      • Set Combo_SIndex[ComboInt] = (Combo_SIndex[ComboInt] + 1)
      • Unit - Add Combo_Sequence[Combo_SIndex[ComboInt]] to Combo_AddCaster[ComboInt]
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- End of Variable Setup --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
This trigger checks if an ability finishes resets the timer and adds the next ability.
  • Combo Continue
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Combo_Sequence[Combo_SIndex[ComboInt]]
    • Actions
      • Set Combo_Timing[ComboInt] = False
      • Set Combo_Timer[ComboInt] = 1.00
      • Unit - Remove Combo_Sequence[Combo_SIndex[ComboInt]] from Combo_AddCaster[ComboInt]
      • Set Combo_SIndex[ComboInt] = (Combo_SIndex[ComboInt] + 1)
      • Unit - Add Combo_Sequence[Combo_SIndex[ComboInt]] to Combo_AddCaster[ComboInt]
      • Set Combo_Timing[ComboInt] = True

This is the timer trigger that handles the delay on the next ability. I'm not quite sure about this trigger actually. I've kinda was confused and just experimented with trial and error
  • Combo Timer
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Combo_Loop) from 1 to Combo_MinSize, do (Actions)
        • Loop - Actions
          • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- This let look everything cleaner. --------
          • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
          • Set ComboInt = Combo_Index[Combo_Loop]
          • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Condition... --------
          • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Combo_Timing[ComboInt] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Combo_Timer[ComboInt] Greater than 0.00
                • Then - Actions
                  • Set Combo_Timer[ComboInt] = (Combo_Timer[ComboInt] - 0.02)
                • Else - Actions
                  • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- Destroy handles --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
                  • Unit - Remove Combo_Sequence[Combo_SIndex[ComboInt]] from Combo_AddCaster[ComboInt]
                  • Unit - Add Combo_Sequence[0] to Combo_AddCaster[ComboInt]
                  • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
                  • -------- RecycleIndex --------
                  • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
                  • Set Combo_Index[Combo_Loop] = Damage_Index[Combo_MinSize]
                  • Set Combo_Index[Combo_MinSize] = ComboInt
                  • Set Combo_MinSize = (Combo_MinSize - 1)
                  • Set Combo_Loop = (Combo_Loop - 1)
            • Else - Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Turn the trigger again off if the index_size is below 0... --------
      • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Combo_MinSize Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Combo Continue <gen>
        • Else - Actions
Well here it is. If anyone needs a test map I'll make one. I really need help on this system. I've been thinking about this since yesterday.

Please and thank you! :grin:
 
Level 10
Joined
Sep 3, 2009
Messages
458
I can't see any event in the first trigger :/

Like I said that trigger will be run.

Oh and forgot to put this.

  • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
  • -------- Combo Setup --------
  • -------- --------------------------------------------------------------------------------------------------------------------------------- --------
  • Set Combo_Caster = Attack_Caster[AttackInt]
  • Set Combo_Sequence[0] = Attack (Custom)
  • Set Combo_Sequence[1] = Howl of Terror (Neutral Hostile)
  • Set Combo_Sequence[2] = War Stomp (Neutral Hostile 1)
  • Set Combo_NCombos = 2
  • Trigger - Run Combo Start <gen> (checking conditions)
  • -------- ---------------------------------------------------------------
This Block of Code(?) Will be put at the end of a trigger when a spell is cast

Example.

The First Ability is Attack

Make a trigger that checks if the ability "Attack" has been casted.

Then put the block of code(?)

At the end you can see that the first trigger (Combo Start) is run.

Edit: The variables with the "Attack" prefix is the variables in my Attack Ability Trigger. I simply put and set the varibles needed by the combo system.
 
question, why use Combo_Sequence[Combo_SIndex[ComboInt]] cant you just use Combo_Sequence[ComboInt]? since its just variables to get ability being cast... or just use three integer variables + just a block of If-Then-Else...

and why not just add the combo set-up in the init trigger... at least the integer variables for the combo spells...

then this line

Set Combo_Caster = Attack_Caster[AttackInt]

I dont see AttackInt being set... anyway I feel its also pretty useless, if that block is run on the casting of the first ability you can just use Set Combo_Caster = Triggering Unit

dont use Unit finishes casting an ability it could bug... use starts the effect of an ability...
 
Level 10
Joined
Sep 3, 2009
Messages
458
question, why use Combo_Sequence[Combo_SIndex[ComboInt]] cant you just use Combo_Sequence[ComboInt]? since its just variables to get ability being cast... or just use three integer variables + just a block of If-Then-Else...

Well I did this so that I can string together abilities easier

like

Combo_Sequence[0] = First Skill
Combo_Sequence[1] = Second Skill
Combo_Sequence[2] = Third Skill

if you want to add some more . . .

Combo_Sequence[3] = Etc Skill
Combo_Sequence[4] = Etc Skill

So you can technically add a lot of abilities

SIndex (Sequence Index) is used to determine what ability is/should be added or is currently added.

All abilities start with the first ability which is

Combo_Sequence[0] = First Skill

SIndex is always 0 at first, but as the ability is casted it is set to +1, meaning Sindex = 0+1 = 1. Now Since Sindex is = 1 Combo_Sequence now is . . .

Combo_Sequence[1] = Second Skill

Now this tells the system that when it adds the second skill it will be

Combo_Sequence[1] = Second Skill

Which is the second skill as it was set

and why not just add the combo set-up in the init trigger... at least the integer variables for the combo spells...

(I'm assuming this is the block of code(?) )Well I set it at the end of the triggers cause you can technically set what abilities you want to string together.

Say you want

To start a combo with the Attack Ability

Then another Combo with Fire Ball

It'll be easier instead of setting up specific combo strings, in the init trigger.

then this line

Set Combo_Caster = Attack_Caster[AttackInt]

I dont see AttackInt being set... anyway I feel its also pretty useless, if that block is run on the casting of the first ability you can just use Set Combo_Caster = Triggering Unit

Attack_Caster[AttackInt] is the variable for caster, for my example ability. Which is a triggered ability called attack.

You can technically set Combo_Caster = [Insert the caster for the first ability that starts the combo]

dont use Unit finishes casting an ability it could bug... use starts the effect of an ability...

Lol didn't know that but right now I can't figure it out yet cause I'm having trouble with the Timer T.T

I think I'll make a test map?
 
Status
Not open for further replies.
Top