• 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.

Dialogs - Seperate Players

Status
Not open for further replies.
Level 5
Joined
Dec 13, 2008
Messages
141
Alrighty, I'm all giddy about the SC2 Editor now since I've gotten the hang of the ever-so-complex process of the data editor, I created Dialogs and started using them for research, mercs, etc.

I only have a few problems with this though:
1. When more than one person is using a menu/dialog and he clicks a button(which removes the menu, I used Destroy), that menu/dialog he was in is destroyed, and anyone else that has that menu/dialog open has it destroyed also.

2.This is more of a general annoyance to me: I want to play a sound for a certain player, but it wants me to play it for a player group instead(or change a dialog item text for a player, but it wants me to change it for a player group). Is there anyway to have it for the individual and not for player group?

Appreciate any help, including advice.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I only have a few problems with this though:
1. When more than one person is using a menu/dialog and he clicks a button(which removes the menu, I used Destroy), that menu/dialog he was in is destroyed, and anyone else that has that menu/dialog open has it destroyed also.
Hide it for the player instead of destroying it. Remember to disable any button responses for players that have the dialog hidden from them to prevent possible exploits.

2.This is more of a general annoyance to me: I want to play a sound for a certain player, but it wants me to play it for a player group instead(or change a dialog item text for a player, but it wants me to change it for a player group). Is there anyway to have it for the individual and not for player group?
Use a player group consisting of only the individual you want to change. There is even a native which will take a player (int) and returns a player group containing only him in it. StarCraft II's powerful garbage collector will make sure that player groups do not leak if all references to them are lost so do not worry too much about green code until you get to optimizing stage of development.
 
Level 5
Joined
Dec 13, 2008
Messages
141
There is even a native which will take a player (int) and returns a player group containing only him in it.

You mean Convert Player to Player Group? I read it as "Player in Player Group".
I think I've been using it for some already. Thanks for the help.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
native playergroup PlayerGroupSingle (int inPlayer);

If you are doing many things for the same player and require a playergroup then you are advised to store the player group in a local to prevent unnescescary work for the garbage collector and allocator.
 
Status
Not open for further replies.
Top