• 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] I have 2 questions about: timers and hero exp per level WILL ADD REP

Status
Not open for further replies.
Level 4
Joined
Apr 19, 2009
Messages
42
first, i need to know how to make a working timer? i know ima noob :p

and second i would like to set my heros exp gain to 1exp per level, so at level 1 it would take 1 exp point to get to level 2 then level 2 1 exp point to get to level 3, etc.
 
Level 18
Joined
Feb 28, 2009
Messages
1,971
Yea create variable timer-timer and timer window. Then actions when elapsed game time is 0.00 seconds start timer (can`t be map initialization) than create window and than show timer. For your second question it would be I think harder because you will have to go to advanced-> game something (don`t know how in english)
 
Last edited:
Level 4
Joined
Apr 19, 2009
Messages
42
TFT i may be looking in the wrong area, but all i have in actions is
Countdown Timer - Start Timer
Countdown Timer - Pause Timer
Countdown Timer - Create Time Window
Countdown Timer - Destroy Timer Winder
Countdown Timer - Show/Hide Timer Window for Player
Countdown Timer - Show/Hide Timer Window
Countdown Timer - Change Timer Window Title
Countdown Timer - Change Timer Window Title Color
Countdown Timer - Change Timer Window Time Color

in probably just being blind or stupid, sry if i am

i still need the exp question answered
 
Last edited by a moderator:
Level 20
Joined
Jan 6, 2008
Messages
2,627
Yes, thats excactly what your looking for, press the X icon, and Add Variable (Green X) Call it (YourTimer), in the selection area you can select, select CountdownTimer.
Make a trigger called Set (Variable) YOURTIMER to so much seconds
and then you make a Countdown Timer - Start -YourTimer-
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
press controll+b to go to all your variables you have created...

now you have not created any variables yet as I think...

so click on the green +X button and create a variable of type timer and give it a name....

now make a trigger like this:

  • Timer
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 30.00 seconds
and another trigger to do whatever you want when the timer finishes:

  • Timer ends
    • Events
      • Time - MyTimer expires
    • Conditions
    • Actions
      • Do whatever you want here :)
if you want the player be abled to see the timer in game you will also have to make a variable of type timer window and then create a timer window and set that variable to it example:

  • Timer
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title My timer:
      • Set MyTimerWindow = (Last created timer window)
      • Countdown Timer - Show MyTimerWindow
hope this helps :thumbs_up:

With these actions u can make your countdown timer:
Countdown Timer - Start Timer
Countdown Timer - Pause Timer
Countdown Timer - Create Time Window
Countdown Timer - Destroy Timer Winder
Countdown Timer - Show/Hide Timer Window for Player
Countdown Timer - Show/Hide Timer Window
Countdown Timer - Change Timer Window Title
Countdown Timer - Change Timer Window Title Color
Countdown Timer - Change Timer Window Time Color

as U mentioned before :)

with this action you set your variable to a value:
set variable

with this event you check if the timer is finished:
Time - Timer expires

with this event you create some actions when the game starts:
Time - Elapsed Game Time





to change the hero exp:

go to advanced in your editor and click on gameplay constants...

then click on use custom gameplay constants and scroll down to these fields:

Hero XP
Hero XP Gained
Hero XP Required

change some of these fields and experiment a bit to get it to work
 
Last edited:
Level 20
Joined
Jan 6, 2008
Messages
2,627
Umm, if you use that last trigger and make a one in the end of it and make a trigger like this:

  • Timer
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title My timer:
      • Set MyTimerWindow = (Last created timer window)
      • Countdown Timer - Show MyTimerWindow
      • Wait - 30 Seconds
      • Your Actions
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
then what? your waiting till the timer is done?...
y u can use an if function but you can also use a different trigger... Don't make it harder for the guy he's already having trouble in understanding...
 
Level 12
Joined
May 21, 2009
Messages
994
Variables needed = 1 variable
Timer = Timer varialbe
  • Timer
  • Event - Time elapsed 0.01 second.
  • condition -
  • action -
  • Create a timer window for (Timer)
  • start (Timer) as a one-shot that will expire in 20 seconds.
Trigger 2
  • Timer Expire
  • Event - (Timer) expire
  • condition -
  • action -
    • Do your action it could be:
  • Create 1 footmen for player(1) at (Position) facing 0.00)
If you use create action then remember to remove leak
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Umm, if you use that last trigger and make a one in the end of it and make a trigger like this:

  • Timer
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start MyTimer as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title My timer:
      • Set MyTimerWindow = (Last created timer window)
      • Countdown Timer - Show MyTimerWindow
      • Wait - 30 Seconds
      • Your Actions

Dumb, you shouldnt do that,,
Why? action 'wait' or in JASS called 'TriggerSleepAction' is inaccurate,, now if you want an exact 30 seconds you should use Hasjie's way, it is the most accurate and works!

In (v)JASS we also use timers for small intervals (like 0.03), why? Because they are accurate and relyable,, Do NOT use the action 'wait' when you want an exact waiting,, first, it is always at LEAST ~0.27 seconds, no matter what you do, then, it is bad due to inaccuracy,, if you want 30 seconds wait it is really possible it stops at 30.69 seconds,, which is a small time but it can be vital in some moments,,

Tip: Do not use wait when you want accuracy, use wait when you want an easy inaccurate trigger (i use it myself sometimes when i am lazy >:] )

Ciao =)
 
Status
Not open for further replies.
Top