• 🏆 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] MPI Trackables

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hi all.

I am creating a dungeon map and I want to have a custom inventory system.
Full screen etc.
Next to that a custom (full screen) skilltree thingy and maybe more of that kind.
I have done the concept before but I cannot figure out how to make it mpi/mui.

I know I can't do GetTriggerPlayer() but I thought that there was something with GetLocalPlayer() that it would make it perfect.

Can anyone remind me of how you make trackables MPI?

Thanks in advantage.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Ah thanks.

I got it again.

EDIT:
Can I not put everything inside the "(GetLocalPlayer() == p)"?
Or is that bullshit?
JASS:
loop
        exitwhen i > udg_Player_Amount
        set p = Player(i)
        if GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p) == MAP_CONTROL_USER then
            if GetLocalPlayer() == p then
                set s = "war3mapImported\\Trackable.mdx"
            else
                set s = ""
            endif
            set t = CreateTrackable(s, x, y, 0)
            set id = GetHandleId(t)
            
            //Register the events for the trackable.
            call TriggerRegisterTrackableHitEvent(fcw_Trigger_TrackableClick, t)
            call TriggerRegisterTrackableTrackEvent(fcw_Trigger_TrackableHover, t)
            
            //Save the data to the hashtable.
            call SaveInteger(fcw_Hashtable, id, 0, whichFCW)
            call SaveInteger(fcw_Hashtable, id, 1, i)
            call SaveInteger(fcw_Hashtable, id, 2, x)
            call SaveInteger(fcw_Hashtable, id, 3, y)
        endif
        set i = i + 1
    endloop
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You can't "create" something inside GetLocalPlayer block.Only exceptions are floating texts.

The reason this works is, you are creating a trackable for all players but since trackables of player 2 has invalid model for other players they can't click it.
 
Status
Not open for further replies.
Top