First, when it comes to the Messaging module, I plan on having the ability to pass one user, a list/tuple/set of users, or a filter. My first question is, if only passing one user or a list of them, should we (just like EventScripts) assume that all users passed are in the form of their "userid"? Or their index (which is what a RecipientFilter requires to be added)? Or the player's entity (once we get further in development, this will be more robust and full of info you can quickly access, sort of like playerlib)?
With the filtering system, should it be just like EventScripts' playerlib, where you get an instance like?:
Syntax: Select all
playerlist = PlayerList('#alive,!bot')
Syntax: Select all
playerlist = PlayerList(['#alive', '!bot'])
Syntax: Select all
playerlist = PlayerList(['@alive', '!bot'])
# Or
playerlist = PlayerList(['alive', '!bot'])
An idea, that came from XE_ManUp, which we are definitely incorporating, will be to return multiple types of values for players (or other types of filters as well) that the scripter needs. It could possibly look like:
Syntax: Select all
for index, username, steamid in PlayerList(['alive', '!bot'], ['index', 'username', 'steamid']):
print(index)
print('\t%s' % username)
print('\t%s' % steamid)
Syntax: Select all
playerlist = PlayerList(['alive', '!bot'], ['index', 'username', 'steamid'])
@Event
def player_say(GameEvent):
if GameEvent.GetString('text') == 'print':
for index, username, steamid in playerlist:
print(index)
print('\t%s' % username)
print('\t%s' % steamid)
Also, if no return values are given, should we return the player's index, userid, or entity (which, again, once we get further in development, this will be more robust and full of info you can quickly access, sort of like playerlib)?:
Syntax: Select all
playerlist = PlayerList(['alive', '!bot'])
@Event
def player_say(GameEvent):
if GameEvent.GetString('text') == 'print':
for index in playerlist:
print(index)
Syntax: Select all
playerlist = PlayerList(['alive', '!bot'], ['username', 'steamid'])
@Event
def player_say(GameEvent):
if GameEvent.GetString('text') == 'print':
for index, username, steamid in playerlist:
print(index)
print('\t%s' % username)
print('\t%s' % steamid)
I'm sure I have other questions, but that is all I can think of right now. If anyone has any input, other suggestions, questions, etc..., please feel free to comment here.
Thank you,
Satoon