Hi Guys, i am looking for a way to get the slot of an character, or unit.
Are there any functions known I could not find so far?
Thank you!
GetPlayerSlot
Moderator: Moderators
-
- Recruit Womprat Killer
- Posts: 12
- Joined: Sun Feb 17, 2019 5:55 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: GetPlayerSlot
What do you mean by the slot? What are you trying to do?
-
- Recruit Womprat Killer
- Posts: 12
- Joined: Sun Feb 17, 2019 5:55 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: GetPlayerSlot
The players are set in a slot in the multiplayer. Like slot0 = me slot1 = "another user" slot2 = "a third one"
I want to identify them and track who killed who
EDIT
To specify this more:
Like I have a function OnCharacterDeath(killer, victim) in lua
I want to do something like
killers = {}
victims = {}
killers[someindex] = MagicNameOrIDExtractorIamLookingFor(killer)
killers[someindex] = MagicNameOrIDExtractorIamLookingFor(victim)
I expect a return value with either the slot like when I have 5 Players:
"player1", "player2", "player3", "player4", "player5"
like: 0, 1, 2, 3, 4 or the names of the players.
Is there some function I could not find so far? Or how would you solve this?
I want to identify them and track who killed who
EDIT
To specify this more:
Like I have a function OnCharacterDeath(killer, victim) in lua
I want to do something like
killers = {}
victims = {}
killers[someindex] = MagicNameOrIDExtractorIamLookingFor(killer)
killers[someindex] = MagicNameOrIDExtractorIamLookingFor(victim)
I expect a return value with either the slot like when I have 5 Players:
"player1", "player2", "player3", "player4", "player5"
like: 0, 1, 2, 3, 4 or the names of the players.
Is there some function I could not find so far? Or how would you solve this?
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: GetPlayerSlot
IIRC the v1.3 patch docs come with some information on how to do things with player data. I've not had to deal with player data before, so I'd suggest having a look there.
Looks like it's here: "GameData\addon\AAA-v1.3patch\docs\howtos\Using Ingame Player Data.txt"
Looks like it's here: "GameData\addon\AAA-v1.3patch\docs\howtos\Using Ingame Player Data.txt"
-
- Recruit Womprat Killer
- Posts: 12
- Joined: Sun Feb 17, 2019 5:55 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: GetPlayerSlot
Thanks I think I can use that!
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: GetPlayerSlot
I believe killer and victim are already the character ids you're looking for, just be sure they aren't nil when you try to use them (suicides, player leaves server).
Humans/AIs are characters. When spawned, characters have units. Units are objects. Quickly searching, this topic may help understand how to work with them: http://gametoast.com/viewtopic.php?f=27 ... er#p204070 but I know there's better documentation out there.
You can get character's names using v1.3 features, but they aren't that useful since you can't display those names so there isn't much point. The only thing I know it was used for was admin-like features. Enter a map with a specific name and the script gives your character special boosts. It was used for banning specific people and some clan stuff. If you were trying to do advanced 3+ playable team things you could sort people into teams based on their name. Combine that with the profile renaming cheat code and people don't need to create new profiles when changing names.
Humans/AIs are characters. When spawned, characters have units. Units are objects. Quickly searching, this topic may help understand how to work with them: http://gametoast.com/viewtopic.php?f=27 ... er#p204070 but I know there's better documentation out there.
You can get character's names using v1.3 features, but they aren't that useful since you can't display those names so there isn't much point. The only thing I know it was used for was admin-like features. Enter a map with a specific name and the script gives your character special boosts. It was used for banning specific people and some clan stuff. If you were trying to do advanced 3+ playable team things you could sort people into teams based on their name. Combine that with the profile renaming cheat code and people don't need to create new profiles when changing names.
-
- Recruit Womprat Killer
- Posts: 12
- Joined: Sun Feb 17, 2019 5:55 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: GetPlayerSlot
What I exactly am looking for is a way to the playerslot or the playerhash.
I am syncing ingame values with the swbf2admin server software. But currently it is not possible for me to see which unit in the game currently belongs to which player, what I can address in the server software.
I am only able to read float values so far, so I need a number, that represents the players ingame.
Since each player has a slot in multiplayer assigned, I hoped I could use that as ID.
Btw. how is 1.3 coded?
Thanks for your help!
I am syncing ingame values with the swbf2admin server software. But currently it is not possible for me to see which unit in the game currently belongs to which player, what I can address in the server software.
I am only able to read float values so far, so I need a number, that represents the players ingame.
Since each player has a slot in multiplayer assigned, I hoped I could use that as ID.
Btw. how is 1.3 coded?
Thanks for your help!