(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Modding > World Editor Help Zone

World Editor Help Zone Need help with Blizzard's World Editor? Ask general questions about its features and use in this forum. README!

Reply
 
LinkBack Thread Tools Display Modes
Old 11-29-2008, 04:17 PM   #1 (permalink)
 
crehym's Avatar

User
 
Join Date: Nov 2008
Posts: 3

crehym has little to show at this moment (1)


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
crehym is offline   Reply With Quote
Old 11-29-2008, 04:20 PM   #2 (permalink)
 
TheBlooddancer's Avatar

Cute Kargo is Cute :3
 
Join Date: Jun 2008
Posts: 2,674

TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)


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.



TheBlooddancer is offline   Reply With Quote
Old 11-29-2008, 04:28 PM   #3 (permalink)
 
crehym's Avatar

User
 
Join Date: Nov 2008
Posts: 3

crehym has little to show at this moment (1)


Yea I should use locals, and how would you do that? I mean Use locals to timers? ~__~
__________________
crehym is offline   Reply With Quote
Old 11-29-2008, 04:34 PM   #4 (permalink)
 
TheBlooddancer's Avatar

Cute Kargo is Cute :3
 
Join Date: Jun 2008
Posts: 2,674

TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)


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.



TheBlooddancer is offline   Reply With Quote
Old 11-29-2008, 04:37 PM   #5 (permalink)
 
crehym's Avatar

User
 
Join Date: Nov 2008
Posts: 3

crehym has little to show at this moment (1)


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 ^^
__________________
crehym is offline   Reply With Quote
Old 11-29-2008, 04:40 PM   #6 (permalink)
 
TheBlooddancer's Avatar

Cute Kargo is Cute :3
 
Join Date: Jun 2008
Posts: 2,674

TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)TheBlooddancer is just really nice (419)


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.



TheBlooddancer is offline   Reply With Quote
Old 12-01-2008, 08:03 PM   #7 (permalink)
 
KYTON's Avatar

User
 
Join Date: Oct 2007
Posts: 138

KYTON has little to show at this moment (8)


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 integer
return h
return 0
endfunction

function AttachObject takes handle h, string s, handle h2 returns nothing
if h2==null then
call FlushStoredInteger(gamechache,I2S(H2I(h)),s)
else
call StoreInteger(gamechache,I2S(H2I(h)),s,H2I(h2))
endif
endfunction

function GetAttachedUnit takes handle h, string s returns unit
return GetStoredInteger(gamechache,I2S(H2I(h)),s)
return null
endfunction

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 nothing
local 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 unit
endfunction

function SpellCast takes nothing returns nothing
local 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 target
endfunction

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.
KYTON is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

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

All times are GMT. The time now is 07:41 AM.






Your link here 
Loans | Ringtones | Buy Anything On eBay | Loans | Credit Counseling
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle