• 🏆 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!

[Trigger] Trackable Object

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
There is a trackable tutorial for GUI users.

Otherwise I use this to spawn them and then make them ready for further use :p
  • Loop - Actions
    • Set TRACK_player = (Player((Integer A)))
    • Set TRACK_model = war3mapImported\4x4Trackable.mdl
    • Custom script: if udg_TRACK_player != GetLocalPlayer() then
    • Set TRACK_model = <Empty String>
    • Custom script: endif
    • Custom script: set udg_TRACK_dest = CreateDestructableZ( 'OTip', udg_TRACK_x, udg_TRACK_y, udg_TRACK_z, 0.00, 1, 0 )
    • Custom script: set track = CreateTrackable(udg_TRACK_model, udg_TRACK_x, udg_TRACK_y, 0)
    • Custom script: call RemoveDestructable(udg_TRACK_dest)
    • -------- -------------- --------
    • Custom script: call TriggerRegisterTrackableHitEvent(udg_TRACK_hit_trigger, track)
    • Custom script: call TriggerRegisterTrackableTrackEvent(udg_TRACK_move_trigger, track)
    • -------- -------------- --------
    • Custom script: set h = GetHandleId(track)
    • Custom script: call SaveReal(udg_TRACK_hash, h, 1, udg_TRACK_x)
    • Custom script: call SaveReal(udg_TRACK_hash, h, 2, udg_TRACK_y)
    • Custom script: call SaveReal(udg_TRACK_hash, h, 3, udg_TRACK_z)
    • Custom script: call SaveStr(udg_TRACK_hash, h, 4, udg_TRACK_model)
    • Custom script: call SavePlayerHandle(udg_TRACK_hash, h, 5, udg_TRACK_player)
or just check this test map.
 

Attachments

  • trackable.w3x
    26.4 KB · Views: 62

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Can someone explain to me how Trackable Object in the JassNewGen Editor works or send me a good tutorial?
They work the same as in normal world editor. This means you can create them, attach triggers with response events, process those response events and that really is about it.

You cannot get triggering player who generated the response event. You can use client local string paths for the model path to limit which clients see the trackable. It is important to note that you cannot destroy trackables once created meaning the only time they will ever disappear is when the map session is exited. The in-built save response for trackables I am unsure of.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Yeah I just thought about implementing it into my project to make a third person camera move able but I guess that wont work.

Trackables are only good for static locations, e.g. full screen inventories or talent trees. Since they cant be destroyed, it isnt recommended to use them on the field.
 
Status
Not open for further replies.
Top