(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Modding > Triggers & Scripts

Triggers & Scripts Discussions regarding GUI triggers & JASS/AI scripts may be found here. Please review the » JASS Tutorials » Trigger Tutorials

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 09-24-2004, 11:23 AM   #1 (permalink)

User
 
Join Date: Aug 2004
Posts: 28

wikidme is an unknown quantity at this point (0)


explain handle?

im pretty familiar with JASS and the only thing i dont know how to use are the types 'Handle'.

ive seen several people use them in thier spells but cant figure out why.

so my question(s) is,
what is the type 'Handle'
why is it useful?
when should it be used?

and if someone can give an easy to understand example please.
wikidme is offline  
Old 09-24-2004, 12:41 PM   #2 (permalink)

User
 
Join Date: Mar 2004
Posts: 70

KaTTaNa has little to show at this moment (1)


All types except integer, real, boolean, string and code are handles.
For example:
local unit u = GetTriggerUnit()
local handle h = u // Legal: All units are handles
set u = h // Illegal: Not all handles are units
The advantage of handles is that any object can be referenced assigned to a handle.
It can be inverted with a function like this:
function HandleToUnit takes handle h returns unit
    return h
    return null
endfunction

function HandleToInt takes handle h returns integer
    return h
    return 0
endfunction
The HandleToInt function is great because you can get a unique integer representation for any object that way.
KaTTaNa is offline  
Old 09-24-2004, 07:41 PM   #3 (permalink)

User
 
Join Date: Aug 2004
Posts: 28

wikidme is an unknown quantity at this point (0)


ok, im still not sure on its uses?

i mean, why do you want/NEED to use handle?

can you always get away without using them?

can u give an exmaple where something would be impossible to do without the use of handle.
wikidme is offline  
Old 09-25-2004, 08:45 PM   #4 (permalink)

User
 
Join Date: Apr 2004
Posts: 39

AIAndy is an unknown quantity at this point (0)


You can completely avoid the type handle. It has no value by itself.
But on the other hand every unit, group, force, ... are actually handles since those types are derived from handle.
The only use I know of is using it with return bug functions so you do not need one for every type.
__________________
http://amai.wc3campaigns.com - The best War3 melee AI
AIAndy is offline  
Old 09-29-2004, 06:24 PM   #5 (permalink)

User
 
Join Date: Jul 2004
Posts: 72

FireFreak is an unknown quantity at this point (0)


i dont know exactly but i think u can use handlevars to have them as "local vars" between several fuctions because "normal" local vars work in only one
FireFreak is offline  
Closed Thread

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
Rroma (Gypsies) Can someone explain? Darkholme Off-Topic 16 02-20-2008 12:11 AM
Could someone give me a example or explain. madcat2 Texturing & Surfacing 5 02-08-2008 10:20 PM
Can someone explain why my animations are going away? Darkholme Modeling & Animation 1 01-28-2008 11:08 PM
trying to explain Manukiller Map Development 2 08-05-2004 09:09 PM

All times are GMT. The time now is 01:11 PM.






Your link here 
Loans | Credit Cards | Debt Consolidation | Credit Cards | Actress
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle