Hashtable

Status
Not open for further replies.
Level 12
Joined
Jun 1, 2010
Messages
745
How to make this?

aoakix.jpg
[/IMG]
 
Last edited:
You need JASS for trackables.

First you create a trackable with native CreateTrackable takes string trackableModelPath, real x, real y, real facing returns trackable

Like I'm creating here:
set tr = CreateTrackable( "war3mapImported\\InvisiblePlatformSmall.mdl" , ORIGIN_X + 200 , ORIGIN_Y + 32 , 0 )

The x and y are coordinates where you want to create it. The 0 is facing. I'm using invisible platform model extracted from WC3 mpq file.

I guess you can apply a texture on every trackable, but I decided to use images on top of trackables.

native CreateImage takes string file, real sizeX, real sizeY, real sizeZ, real posX, real posY, real posZ, real originX, real originY, real originZ, integer imageType returns image

This creates an image on top of the trackable I just created:
set im = CreateImage( "war3mapImported\\TrackStrength.BLP" , 64 , 64 , 0 , ORIGIN_X + 182 , ORIGIN_Y + 32 - 32 , 0 , 0 , 0 , 0 , 2 )

The coordinates are of the lower left corner of the image, so you must use a bit of offset so it is directly ontop of the trackable.

Then show the image:
call SetImageRenderAlways( im , true )

You can then show/hide images with:
call ShowImage( whichImage , boolean )

Register events for the trackable, specify the function and trackable:
call TriggerRegisterTrackableHitEvent( AbilitySelectionHit , tr )
call TriggerRegisterTrackableTrackEvent( AbilitySelectionTrack , tr )

Then you can code the functions to do whatever you want to do. You can save stuff into a hashtable by using the trackable's handle.

Remember that the images must have invisible border or else they won't show correctly. Google a tutorial.

But there are tutorials for trackables. Check them.
 
set tr = CreateTrackable( "war3mapImported\\InvisiblePlatformSmall.mdl" , ORIGIN_X + 200 , ORIGIN_Y + 32 , 0 )

You can also access that model by using:
JASS:
"Doodads\\Terrain\\InvisiblePlatformSmall\\InvisiblePlatformSmall.mdl"

;D

----

Anyway, here are some tutorials that might help:
http://www.thehelper.net/forums/showthread.php/66955-How-to-Display-Images-in-game

That is for images. For trackables, I suggest:
http://wc3jass.com/viewtopic.php?t=1997&start=0

The other common method used is a custom model that is a plane. It allows for replaceable textures, so in the object editor you can change the texture to whatever you want, which is handy for icons such as the ones you posted.

For more information, you may want to look into these maps:
https://www.hiveworkshop.com/forums...nsion-176817/?prev=d=list&r=20&u=D4RK_G4ND4LF
https://www.hiveworkshop.com/forums...ory-159130/?prev=search=Inventory&d=list&r=20

Good luck. :)
 
Status
Not open for further replies.
Back
Top