Storing a player's name via ACS?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

Storing a player's name via ACS?

#1

Post by Ænima » Wed Jul 25, 2012 5:20 am

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: Storing a player's name via ACS?

#2

Post by Llewellyn » Wed Jul 25, 2012 6:44 am

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"
Last edited by Llewellyn on Wed Jul 25, 2012 6:46 am, edited 1 time in total.

User avatar
President People
Forum Regular
Posts: 394
Joined: Tue Jun 05, 2012 8:12 am

RE: Storing a player's name via ACS?

#3

Post by President People » Wed Jul 25, 2012 8:14 am

Jumpmaze uses a record tracker. Maybe you could try looking at that?

Though I probably don't know what I'm talking about. :)
Image
***MARATHON SKINS PACK V1.0.7***

I have been Roland, Beowulf, Achilles, Gilgamesh.
I have been called a hundred names and will be called
a thousand more before the world goes dim and cold.

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: Storing a player's name via ACS?

#4

Post by Llewellyn » Wed Jul 25, 2012 8:16 am

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.

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Storing a player's name via ACS?

#5

Post by Ivan » Wed Jul 25, 2012 10:34 am

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)).
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Storing a player's name via ACS?

#6

Post by Ijon Tichy » Wed Jul 25, 2012 6:24 pm

Æ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
Last edited by Ijon Tichy on Wed Jul 25, 2012 6:24 pm, edited 1 time in total.

Post Reply