• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Some GetLocalPlayer() Issues

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi, tested a RPG map i'm making for the first time, and noticed some interesting stuff... most of them associated with GetLocalPlayer. I use GUI mostly, not JASS, and i'm not pretty sure about how to use GetLocalPlayer to fix some problems.

I'm not having desyncs, since i'm not using GetLocalPlayer() right now xD It's just that other players triggers events that are supposed to trigger only for them.


In the map every NPC has a 'Talk' item. When units 'Talk' the 'BlaBlabla' sound should play only to the (Owner of(Buying Unit)).
  • Chat sound
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Sold Item)) Equal to Talk
          • (Item-type of (Sold Item)) Equal to Beach Monk Talk 1
          • (Item-type of (Sold Item)) Equal to Beach Monk Talk 2
      • ((Buying unit) is A Hero) Equal to True
    • Actions
      • Sound - Play Blablabla <gen> at 100.00% volume, skipping the first 0.00 seconds
How should I add the GetLocalPlayer or make the sound play only for that player?.
  • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetBuyingUnit()) then
  • - Actions -
  • Custom script: endif
Like that?


I'll add more of these later. I haven't been able to test with other players =/
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Interesting. I created this post AFTER reading that tutorial because of the tons of doubts and blackholes in my mind about it.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Right now I'm using it exactly for that. I read that GetLocalPlayer mustn't be used with handles nor waits (something like that). The thing is that sometimes the skill works, sometime it doesnt... It's a bit weird. I'll keep testing over and over to check how to make it work :) Thanks keinerhauck.

The thing is that I spent a month creating a map, and today I realized that all the events were mixed up between players xD
 
Status
Not open for further replies.
Top