wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Tutorials > JASS/AI scripts tutorials
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 05-10-2007, 04:37 AM   #16
Toink
User
 
Join Date: Oct 2006
Posts: 1,086

Submissions (3)

Toink is on a distinguished road (17)

Send a message via Yahoo to Toink
Default

This was also teh reason I got good at JASS :P I started to learn how to use handle vars, and from then on structs.
Toink is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 05-10-2007, 06:16 PM   #17
Euroset
User
 
Join Date: May 2007
Posts: 6

Euroset has little to show at this moment (0)

Default

can i use callback functions with parameters??
Euroset is offline   Reply With Quote
Old 05-10-2007, 07:47 PM   #18
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Unfortunately not. If you want to do that, you must use a memory system like Handlevars.
moyack is offline   Reply With Quote
Old 05-10-2007, 09:51 PM   #19
Euroset
User
 
Join Date: May 2007
Posts: 6

Euroset has little to show at this moment (0)

Default

hmmm, know anyone this: timer actual time is real time or game time?
Euroset is offline   Reply With Quote
Old 05-12-2007, 11:35 PM   #20
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Timers are game time.
They will pause and resume if you pause/unpause the game and so forth.
__________________
Rising_Dusk is offline   Reply With Quote
Old 03-15-2008, 06:03 PM   #21
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

I updated this again to make it easier to read and make better mention of vJass applications. I was going to give an example, but then I realized it would be more a tutorial of vJass than for timers.
__________________
Rising_Dusk is offline   Reply With Quote
Old 07-01-2008, 02:22 PM   #22
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Hi, I read your tutorial and I must say it is simple and goes direct to the point. Great job you did =)
However I have some questions on the part of recycling timers.
You use a system CSsafety to recycle timers, are there any other systems, better than that one that you may advice ?

Also, Anitarf is helping me changing a spell so I can post it here.
He is the guy who is really pushing me into this recycling timer thing, and I think it can increase the efficiency of my spells. He said I didn't need any system, and so I made this example:

Collapse JASS:
struct foo
    private timer t

    static method expire takes nothing returns nothing
        call foo(GetTimerStructA(GetExpiredTimer())).destroy()
    endmethod

    static method create takes real duration returns foo
        local foo f = foo.allocate()
        if f.t==null then
            // only create the timer if we don't have one yet
            set f.t=CreateTimer()
            call SetTimerStructA(f.t, f)
        endif
        call TimerStart(f.t, duration, false, foo.expire)
        return f
    endmethod

    method onDestroy takes nothing returns nothing
        call PauseTimer(this.t)
        //do not destroy the timer
    endmethod
endstruct

This uses vJASS (as you already saw lol) and ABC system, however this code is a little complex for me and I have trouble understanding it. Can you explain it in your tutorial please ?
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 07-01-2008 at 02:25 PM.
Flame_Phoenix is offline   Reply With Quote
Old 07-01-2008, 02:40 PM   #23
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Using CSSafety is as easy as add this library and replace all the CreateTimer() commands by NewTimer() and all the DestroyTimer(<your timer var>) by ReleaseTimer(<your timer var>). And voila!!! your spell is doing timer recycling.
moyack is offline   Reply With Quote
Old 07-28-2008, 02:08 PM   #24
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

there is an error for the attach timer method :

Collapse JASS:
call DestroyEffect(I2E(GetTimerInt(GetExpiredTimer())))
should be
Collapse JASS:
call DestroyEffect(I2R(GetTimerInt(GetExpiredTimer())))

Nice discovery, btw.
__________________
Cool != Useful
Troll-Brain is offline   Reply With Quote
Old 08-15-2009, 10:40 PM   #25
T3RMINUS
User
 
Join Date: May 2009
Posts: 79

T3RMINUS has little to show at this moment (4)

Default

Is this all valid in 1.24?
T3RMINUS is offline   Reply With Quote
Old 08-15-2009, 10:48 PM   #26
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Yes, all of the things regarding timers are. I should probably update it so that it tells you to use TimerUtils for timer recycling, though. Also, the example firebolt spell uses LHV, but if you're just using the tutorial for timers (as you should) then it is fine.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-25-2009, 05:44 AM   #27
Newuser
User
 
Join Date: Sep 2008
Posts: 25

Newuser has little to show at this moment (8)

Default

How do you use the new natives in 1.24 for handles and stuff in general regarding using timers without using global variables?

Last edited by Newuser : 03-10-2010 at 04:14 AM.
Newuser is offline   Reply With Quote
Old 09-25-2009, 11:46 AM   #28
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

How to handle timers hasn't changed at all between 1.23 and 1.24. You still use TimerUtils.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-25-2009, 01:49 PM   #29
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Will you update this tutorial for 1.24 nonetheless ??

still contains return bugs..
__________________
akolyt0r is offline   Reply With Quote
Old 04-15-2010, 09:42 PM   #30
SHAƎDY
User
 
Join Date: Apr 2010
Posts: 14

SHAƎDY has little to show at this moment (0)

Default

Yes, the return bug is nothing you should keep, I thought most tutorials that use the Return Bug were deleted across the forums.

Also, in other news, I suggest you explain how to store a timer as a string in a hashtable and then recover it.
SHAƎDY is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:36 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services