• 🏆 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] TriggerRegisterTrackableHit/TrackEvent?

Status
Not open for further replies.
Level 2
Joined
Dec 10, 2010
Messages
8
Hey guys, I hope this is the right place for my question.
I'm trying to create a hero selection screen for a multiplayer map with trackables, no problems so far but when I'm adding the mouseover/click events of the trackables to my triggers it seems like only the first pair of events is actually added.
In this case I have 3 trackables per player on 3 different locations but only the events on the first location seem to work and I can't figure out what went wrong...
(I haven't tested with multiple players yet but I guess they'd also only have the events on the first location)

thanks for any help in advance :)

  • allpicknobansSelection
    • Ereignisse
      • Dialog - A dialog button is clicked for ModeVote
    • Bedingungen
      • (Clicked dialog button) Gleich allpicknobansbutton
    • Aktionen
      • Hashtabelle - Create a hashtable
      • Set tr_ht = (Last created hashtable)
      • -------- Creating Trackables --------
      • Set tr_m = 4x4Trackable.mdl
      • Set tr_facing = 0.00
      • Destructible - Pick every destructible in AcceptRandomRepick <gen> and do (Actions)
        • Schleifen - Aktionen
          • Custom script: local trackable tr
          • Set TempLoc = (Position of (Picked destructible))
          • Set tr_xpos = (X of TempLoc)
          • Set tr_ypos = (Y of TempLoc)
          • For each (Integer TempInt) from 1 to 10, do (Actions)
            • Schleifen - Aktionen
              • Set tr_p = (Player(TempInt))
              • Custom script: if udg_tr_p != GetLocalPlayer() then
              • Set tr_m = ""
              • Custom script: endif
              • Custom script: set tr = CreateTrackable(udg_tr_m, udg_tr_xpos, udg_tr_ypos, udg_tr_facing)
              • Custom script: call TriggerRegisterTrackableHitEvent(gg_trg_AcceptSelectedHero, tr)
              • Custom script: call TriggerRegisterTrackableTrackEvent(gg_trg_MouseOverEffect, tr)
              • Custom script: set udg_tr_hid = GetHandleId(tr)
              • Hashtabelle - Save tr_xpos as 0 of tr_hid in tr_ht
              • Hashtabelle - Save tr_ypos as 1 of tr_hid in tr_ht
              • Hashtabelle - Save Handle Oftr_p as 2 of tr_hid in tr_ht
              • Custom script: if udg_tr_p == GetLocalPlayer() then
              • Quest - Display to (All players) the Quest-Aktualisierung message: (String(tr_hid))
              • Custom script: endif
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Custom script: set tr = null
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
I didn't read carefully but it seems at first player you are changing tr_m variable to " " for all other players, when the loop continues and comes to player 2 or other players, trackable model variable is lost.
 
Level 2
Joined
Dec 10, 2010
Messages
8
Urgh you're right, thank you so much!!!
Shame on me wtf xD

I'll delete my accoutn asap ;(

Moving Set tr_m = 4x4Trackable.mdl just before the local player check solved the problem :/

tyvm again <3

thread can be closed :)
 
Status
Not open for further replies.
Top