• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Attaching values to trackables...

Status
Not open for further replies.
Level 25
Joined
Jun 5, 2008
Messages
2,572
I know that it is possible and i mean like you click a trackable and it shows a value we stored.
To explain better, this is what i need:
  • i create a trackable(i know how to)
  • i set a specific value
  • i attach that value to the trackable
  • when i click the trackable the value is shown

Reputation will be given.
To a very efficent answer credits in my inventory system will be given.
 
Level 16
Joined
Feb 22, 2006
Messages
960
try it with struct attaching, you attach the struct to the trackable and if a trackable is klicked just show the struct :O
JASS:
function action takes nothing returns nothing
    local trackable bla = GetTriggeringTrackable()
    local someStruct dat = GetAttachedStruct(bla)
    local integer i = dat.info
endfunction
But before dont forget to attach struct and set info :D

for that you could use this system: Click Me :)
 
Level 8
Joined
Aug 6, 2008
Messages
451
If you create all trackables on map init, you can easily use H2I( trackable ) - MIN_HANDLE_COUNT and a struct array for attaching. Table is also good.
 
Status
Not open for further replies.
Top