• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Exception with Adding random real periodic event

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
Whenever I add this event at map initialization:
  • Trigger - Add to LichKing Skill 1 <gen> the event (Time - Every LichkingSkill1 seconds of game time)
and then I set the time after the dialog button for the difficulty is chosen to this:
  • Set LichkingSkill1 = (Random real number between 10.00 and 15.00)
it replays the event over and over and the game exceptions within a few seconds. Why is this and how can I fix it to do what I'm trying to do?
 
Level 8
Joined
Feb 17, 2007
Messages
368
Well the problem with that is when the game restarts and the dialog is brought up again, the same event is added to the trigger. And with 2 periodic time events in the trigger the skill will occur twice every X seconds. See the problem?
 
then just put it in a trigger that is turned off after the first run... or inside an if-then-else on the trigger with the dialog... then just use a boolean to control it...

also, if you restart the game, if you mean using the restart button, then the event will only be added once, since the last instance of the map is already lost...
 
Level 8
Joined
Feb 17, 2007
Messages
368
Like this?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • TriggerAdded Equal to False
    • Then - Actions
      • Trigger - Add to OroChiSkill1 <gen> the event (Time - Every OroSkill1 seconds of game time)
      • Set TriggerAdded = True
    • Else - Actions
Couldn't it also work with an integer? I'm asking because I have another system that works in a way like this.

Ah another problem with this is when a player chooses another difficulty, the times for each of the skills are different and since there's no way to delete events from a trigger the different times will be added with another difficulties times, resulting in two different periodic times for a trigger. So that means I have to make 2 versions of every bosses skills? Skills for the first run, and skills for the second run? :eekani: This is confusing me, haha.
 
Last edited:
Level 8
Joined
Feb 17, 2007
Messages
368
The player picks the difficulty at the start, and then I have to set the time for each of the skills based on the difficulty chosen. Then when the game restarts once they lose the game, they reselect the difficulty, and if they choose a different difficulty, then the bosses skills triggers need to have different times. I wish you could just set the real variable to a different number at the dialog button event and the event would register the change. But I see no other way other than making 1 set of triggers turn on after the 1st run, and using a boolean to turn on the second set if the value is set to true for the 1st set of triggers.

This is part of the trigger for the very easy difficulty:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Clicked dialog button) Equal to Dfficulty_Dialog_Button[4]
    • Then - Actions
      • Dialog - Clear Difficulty_Dialog
      • Dialog - Create a dialog button for BossPaths labelled DBZ Bosses
      • Set BossPathButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for BossPaths labelled Naruto Bosses
      • Set BossPathButton[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for BossPaths labelled World of Warcraft B...
      • Set BossPathButton[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for BossPaths labelled Zelda Bosses
      • Set BossPathButton[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for BossPaths labelled Final Fantasy Bosse...
      • Set BossPathButton[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for BossPaths labelled Mario Bosses
      • Set BossPathButton[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for BossPaths labelled Custom Bosses
      • Set BossPathButton[7] = (Last created dialog Button)
      • Dialog - Show BossPaths for Player 1 (Red)
      • Set ulttimer = 4.00
      • Set countertimer = 3.00
      • Set Difficulty = Very Easy
      • Game - Display to (All players) for 6.00 seconds the text: (|CFFFF0303 + ((Name of Player 1 (Red)) + |R |cff4169e1has selected |cffffff00Very Easy mode.|r |cff4169e1Note: Not all Bosses are playable on this Difficulty. Bosses Ultimates will have increased casting time. Bosses will be missing some armor resilience.|r)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BossTriggerEventsAdded Equal to False
        • Then - Actions
          • Trigger - Add to OroChiSkill1 <gen> the event Event
          • Trigger - Add to OroChiSkill2 <gen> the event Event
          • Trigger - Add to OroChiSkill3 <gen> the event Event
          • Trigger - Add to Kabuto Skill 1 <gen> the event Event
          • Trigger - Add to LichKing Skill 1 <gen> the event Event
          • Trigger - Add to LichKing Skill 2 <gen> the event Event
          • Set BossTriggerEventsAdded = True
        • Else - Actions
    • Else - Actions
So there's no way to change the time for the events once they're added like I've asked, right? You have to turn on new triggers and add the new events to those triggers based on the difficulty. What a pain lol.
 
hmmmm... well, yeah... the fact that you want the functionality to reselect difficulty after each round makes it hard...

you could do the skills trigger this way... rather than adding a periodic event... just use a .03 second periodic event... then set the correct skill time via variables (two variables per skill, one will be used as a countdown, the other as a constant guide)... now on the periodic skill triggers, reduce the value of the countdown variable by .03 seconds, then once it becomes <= 0 do the skill actions and reset the time value of the countdown variable to be equal to the value of the constant guide ...
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Events when added are called like normal functions and so the values you pass them are evaluated at execution of the function.

What you are after doing requires that the event accept a pointer so it can dynamically change as the value at the pointer changes (which WC3 does not support).

You should probably use a timer instead as you can restart it at any time during the game and pass it a different time out each time.
 
Level 8
Joined
Feb 17, 2007
Messages
368
You lost me there near the end lol. Probably cuz it's late and I'm tired. =p would you mind showing me via triggers what your saying exactly?

EDIT: Ah I see Dr Super Good, so use timers instead and set the timers amount as integers based on the difficulty chosen? Why doesn't Warcraft 3 support dynamic events like this haha.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
EDIT: Ah I see Dr Super Good, so use timers instead and set the timers amount as integers based on the difficulty chosen? Why doesn't Warcraft 3 support dynamic events like this haha.

Because how would one handle it? Every time the time gets changed, what happens? When to detect when a time gets changed? It just does not make much sense to impliment such a thing as timers already do what you are after (variable amounts of time).
 
Level 8
Joined
Feb 17, 2007
Messages
368
That's true haha, it'd just be easier and more convenient than having to make a timer for every skill. Well this will be better anyways performance wise and to make the skills fire more accurately, correct? And I use repeating timers to make the timers continuously fire upon completion I'm assuming. Alright well thanks guys for the patience! =) +Rep for you guys!
 
Status
Not open for further replies.
Top