 |   |  |  |
| World Editor Help Zone Need help with Blizzard's World Editor? Ask general questions about its features and use in this forum. README! |
 |
11-29-2008, 04:17 PM
|
#1 (permalink)
|
User
Join Date: Nov 2008
Posts: 3
|
Timers
Question 1: Isn't there any search function here? sorry I'm new here
Question 2: How would you attach units to timers? Can I get the format, I'm just self study in jass and still a newbie  .. I wanted to make my spells MUI so I shouldn't use globals.. I mean, you create a timer, store a unit/anything to it, run the timer and you're stored unit is there.. I just can't get it to work
Tnx guyz
|
|
|
11-29-2008, 04:20 PM
|
#2 (permalink)
|
Cute Kargo is Cute :3
Join Date: Jun 2008
Posts: 2,674
|
A 1: Yes. Its called 'Search'.
A 2: Why would you use global units in jass, and not Local units?
__________________
Last edited by The Administration; Today at 15:08 PM.. Reason: Do not spam, flame, harass and discriminate other users in a such way.
|
|
|
11-29-2008, 04:28 PM
|
#3 (permalink)
|
User
Join Date: Nov 2008
Posts: 3
|
Yea I should use locals, and how would you do that? I mean Use locals to timers? ~__~
|
|
|
11-29-2008, 04:34 PM
|
#4 (permalink)
|
Cute Kargo is Cute :3
Join Date: Jun 2008
Posts: 2,674
|
Im no Jasser, but i suppose that there is some local timer t function. Try it, if it gives syntax, then there isnt.
__________________
Last edited by The Administration; Today at 15:08 PM.. Reason: Do not spam, flame, harass and discriminate other users in a such way.
|
|
|
11-29-2008, 04:37 PM
|
#5 (permalink)
|
User
Join Date: Nov 2008
Posts: 3
|
Nope..
Mm okay..
I mean attaching a unit to the timer
like call SetHandleHandle (WTF, WTF, WTF, WTF)
And then getting it into the function callback..
o.O I really dunno..
Edit: Found the search function ^^
|
|
|
11-29-2008, 04:40 PM
|
#6 (permalink)
|
Cute Kargo is Cute :3
Join Date: Jun 2008
Posts: 2,674
|
Congrats on finding the Search, and thanks for reading the rules (Edit).
And sorry, i dont think i can help ya.
__________________
Last edited by The Administration; Today at 15:08 PM.. Reason: Do not spam, flame, harass and discriminate other users in a such way.
|
|
|
12-01-2008, 08:03 PM
|
#7 (permalink)
|
User
Join Date: Oct 2007
Posts: 138
|
You can do that... Um. You will need to store the unit data in the game cache... OR well thats how I would do it and it would still be MUI. I use CS_CACHE which has several such functions.
You will need. Dam. I can't remember how to store data in the Game Cache. But you will do it like this..
You will need to create a game chache and set the variable gamecache to the game cache you created
then your functions:
function H2I takes handle h returns integerreturn h return 0 endfunctionfunction AttachObject takes handle h, string s, handle h2 returns nothingif h2== null thencall FlushStoredInteger (gamechache,I2S (H2I (h )),s )elsecall StoreInteger (gamechache,I2S (H2I (h )),s,H2I (h2 ))endifendfunctionfunction GetAttachedUnit takes handle h, string s returns unitreturn GetStoredInteger (gamechache,I2S (H2I (h )),s )return nullendfunction
This allows you to attach a unit on a time by calling AttachObject the handle is the thing you attach your variable too. This "thing" can be any unit, timer, destructable, trigger .... Secondly you have a string. This is your "save name" in a way and is used later on. Lastly you have the unit you are attaching.
Now how to use in your example:
function Timer take nothing returns nothinglocal timer t=GetExpiredTimer ()local unit u=GetAttachedUnit (t, "u") // Gets the attached unit saved under "u"call AttachObject (t, "u", null) // This deletes the attached unitendfunctionfunction SpellCast takes nothing returns nothinglocal unit u=GetSpellAbilityUnit ()local timer t=CreateTimer ()call StartTimer (t,2, false, function Timer )call AttachObject (t, "u",u ) // Stores a unit under u on the targetendfunction
Umm. I hope you understand since my explanation is quite crappy.
__________________
Download C.H.A.O.S and prepare yourself for the ultimate AOS experiance:
CHAOS version 0.4.2
Sorry, but I'm currently on vacation. I'll be back on the 10th.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
[JASS] Timers: How Do You Use Them
|
Tigershark |
Triggers & Scripts |
3 |
06-06-2008 10:14 PM |
|
[Trigger] Waits/Timers
|
Gost |
Triggers & Scripts |
5 |
04-25-2008 11:43 AM |
|
[JASS] timers
|
~DietX~ |
Triggers & Scripts |
7 |
09-23-2007 02:02 PM |
|
Jass Timers
|
Homicide13 |
World Editor Help Zone |
1 |
11-14-2006 11:17 AM |
|
Timers
|
fl3h |
Map Development |
7 |
02-12-2005 12:38 PM |
|  |  |  |  |   |  |
|