Page 1 of 1

Storing a player's name via ACS?

Posted: Wed Jul 25, 2012 5:20 am
by Ænima
Is there a way to get a player's name and store it in a string to be called later?

Example: Something like

Code: Select all

printbold(s:"killstreak record held by ",s:champ,s:" with ",d:streakrecord,s:" kills.");
Whereas "champ" is the string where the player's name is stored.

RE: Storing a player's name via ACS?

Posted: Wed Jul 25, 2012 6:44 am
by Llewellyn
I don't think so.
I tried GetCvar("Name") before but it had unpredictable results... it came up with like the last used string or something.

EDIT: LOL I just tried it again, in a test wad I had and it called me "Fatso"

RE: Storing a player's name via ACS?

Posted: Wed Jul 25, 2012 8:14 am
by President People
Jumpmaze uses a record tracker. Maybe you could try looking at that?

Though I probably don't know what I'm talking about. :)

RE: Storing a player's name via ACS?

Posted: Wed Jul 25, 2012 8:16 am
by Llewellyn
President People wrote: Jumpmaze uses a record tracker. Maybe you could try looking at that?

Though I probably don't know what I'm talking about. :)
I don't think it has anything to do with your name.

The problem he has is not trying to store anything really, the problem is that there isn't any way to GET a player's name.

Maybe if you could somehow access %o in an obituary and save it magically.

RE: Storing a player's name via ACS?

Posted: Wed Jul 25, 2012 10:34 am
by Ivan
Did you not try the "n" value of print ? Here, a quote from the wiki;
name, depending on expression. If expression is -1, it prints the level name (e.g., "Entryway"); for -2 the map lump name (e.g., "MAP01"); and for -3 the skill name (e.g., "Hurt me plenty"). If expression is 0 then it prints the name of the activator (a class name if the activator isn't a player, player name otherwise); if expression is greater than 0, then it prints the name of the n-th player (one-based)).

RE: Storing a player's name via ACS?

Posted: Wed Jul 25, 2012 6:24 pm
by Ijon Tichy
Ænima wrote: Is there a way to get a player's name and store it in a string to be called later?

Example: Something like

Code: Select all

printbold(s:"killstreak record held by ",s:champ,s:" with ",d:streakrecord,s:" kills.");
Whereas "champ" is the string where the player's name is stored.
use stralloc; things like this are explicitly what it's made for

edit: or use n:pln+1 for this specific example but who's counting