Accounts, persistent storage and EVENT scripts

General discussion of the port and Doom-related chat.
User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

Accounts, persistent storage and EVENT scripts

#1

Post by Torr Samaho » Wed May 07, 2014 8:07 pm

For those of you who are not following the details on the tracker I'd like to give an update on the things we have been doing recently.

The account and persistent storage systems are pretty much ready for testing by now. The ACS interface to make use of the new features is as follows:

Code: Select all

void SetDBEntryInt ( string Namespace, string EntryName, int EntryValue )
int GetDBEntryInt ( string Namespace, string EntryName ),
void SetDBEntryString ( string Namespace, string EntryName, string EntryValue )
string GetDBEntryString (string Namespace, string EntryName )
void IncrementDBEntryInt ( string Namespace, string EntryName, int Increment )
int PlayerIsLoggedIn( int Player )
string GetPlayerAccountName ( int Player )
There are three new cvars
- databasefile controls where the database is saved (defaults to ":memory:", i.e. volatile in-memory database)
- authhostname is the masterhostname analog (port can be specified with ":port")
- sv_forcelogintojoin prevents unauthenticated player from joining the game (can still connect as spectators)

The console command login allows the client to authenticate with the auth server the server has selected with its authhostname setting.

Furthermore, I added the new experimental script type EVENT. By calling EVENT scripts the engine can notify a mod that a noteworthy event happened and also provide some information about it. This is meant to cover events that are difficult or even impossible to be detected reliably with ACS. A mod can declare an event script (needs new ACC, source here) as follows:

Code: Select all

Script 11 (int type, int arg1, int arg2 ) EVENT
So far we have the following events (more details can be found in the tracker ticket)

Code: Select all

GAMEEVENT_PLAYERFRAGS (player frags another player)
GAMEEVENT_CAPTURES (player captures the flag/skull)
GAMEEVENT_MEDALS (player receives a medal)
GAMEEVENT_TOUCHES (player touches the flag/skull)
GAMEEVENT_RETURNS (the flag/skull is returned)
GAMEEVENT_ROUND_ENDS (the current round ends and the win sequence starts, e.g. when the fraglimit is hit)
'type' is the event type as integer, e.g. GAMEEVENT_PLAYERFRAGS=0. The activator, 'arg1' and 'arg2' encode additional information about the event. For instance, the activator of PLAYERFRAGS is the fragging player and arg1 is the number of the fragged player. For this event, arg2 is not needed and always zero. In the event script, the mod can react to the event in any way it sees fit. For instance, it can track stats with the new database interface.

At this point I'd be very happy about feedback from the community. While I'm pretty sure that the additions pave the way for new exciting mods, the interfaces are not fixed yet and can certainly benefit from your perspective. Also the list of events is still very short and has room for many more events.

User avatar
Tiger
Retired Staff / Community Team Member
Posts: 381
Joined: Thu May 31, 2012 6:21 am
Location: United States
Contact:

RE: Accounts, persistent storage and EVENT scripts

#2

Post by Tiger » Wed May 07, 2014 8:36 pm

I strongly encourage that someone either mirror's or properly format's this into the Zandronum Wiki. Otherwise, this information will get lost eventually and - that is it.

User avatar
Combinebobnt
Retired Staff / Community Team Member
Posts: 1906
Joined: Mon Jun 04, 2012 3:37 am
Location: Earth
Contact:

RE: Accounts, persistent storage and EVENT scripts

#3

Post by Combinebobnt » Wed May 07, 2014 8:41 pm

Nice work as always; Some people will probably test this by starting new projects, too.

User avatar
Frits
Forum Regular
Posts: 298
Joined: Fri Jun 01, 2012 9:04 pm

RE: Accounts, persistent storage and EVENT scripts

#4

Post by Frits » Wed May 07, 2014 8:52 pm

Tiger wrote: I strongly encourage that someone either mirror's or properly format's this into the Zandronum Wiki. Otherwise, this information will get lost eventually and - that is it.
Offtopic:
Imho wiki account should be linked to the forum one (like the bugtracker). Much easier.

On topic:
Digging all these new features and the development activity i've been seeing in the last couple of weeks.

Code: Select all

Mode #grandvoid -o Konar6 by Frits
<Konar6> the fuck
<Konar6> who made this IRC
<Konar6> how is this possible

Catastrophe
Retired Staff / Community Team Member
Posts: 2571
Joined: Sat Jun 02, 2012 2:44 am

RE: Accounts, persistent storage and EVENT scripts

#5

Post by Catastrophe » Wed May 07, 2014 9:10 pm

Question, with GAMEEVENT_MEDALS being added, will there be a way to check what medal the player received?

Kara Kurt
Frequent Poster Miles card holder
Posts: 887
Joined: Sat Oct 12, 2013 6:58 pm
Location: Strasbourg, France
Contact:

RE: Accounts, persistent storage and EVENT scripts

#6

Post by Kara Kurt » Wed May 07, 2014 9:17 pm

Tiger wrote: I strongly encourage that someone either mirror's or properly format's this into the Zandronum Wiki. Otherwise, this information will get lost eventually and - that is it.
^

---
I was wondering if "assists" can be added to the stats since these are medals.

Good job otherwise...

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: Accounts, persistent storage and EVENT scripts

#7

Post by Torr Samaho » Wed May 07, 2014 9:23 pm

The type of medal is specified in arg1, so you can check which medal the player received. The capture event also species the assisting player as one of the args.

Catastrophe
Retired Staff / Community Team Member
Posts: 2571
Joined: Sat Jun 02, 2012 2:44 am

RE: Accounts, persistent storage and EVENT scripts

#8

Post by Catastrophe » Wed May 07, 2014 9:25 pm

I see, hopefully somebody can provide some example code using this in action. I'll try to document this, what should the page(s) be called?
Last edited by Catastrophe on Wed May 07, 2014 9:26 pm, edited 1 time in total.

User avatar
Slim
Zandrone
Posts: 1112
Joined: Sat Mar 16, 2013 7:11 am
Location: Zero Space
Clan: Can't fit it in here
Clan Tag: -=FSR=-
Contact:

RE: Accounts, persistent storage and EVENT scripts

#9

Post by Slim » Wed May 07, 2014 9:43 pm

Oh wow, Nice to see this making great progress. Guess some of us now know why Z& 2.0 is taking so long.
Image

"Your childish antics grow tiring. If you dare to fight me, then I accept your challenge: Anytime, anywhere." - Zero, Megaman X5
Spoiler: Quotes (Open)
5:54 PM - Slim: you're complaining about something so small that
5:54 PM - Lance: so? we do that all the time
5:55 PM - Lance: we're a bunch of losers complaining at a bar minus the bar
Spoiler: Galactus tried evading (Open)
Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3582
Joined: Tue Jun 05, 2012 6:12 pm

RE: Accounts, persistent storage and EVENT scripts

#10

Post by Ænima » Thu May 08, 2014 12:17 pm

Aaaaaand work on Mercenaries resumes! Awesome work, Torr and friends. :)
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

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: Accounts, persistent storage and EVENT scripts

#11

Post by Torr Samaho » Thu May 08, 2014 7:10 pm

Catastrophe wrote: I see, hopefully somebody can provide some example code using this in action. I'll try to document this, what should the page(s) be called?
I think page for the new script type should be called "EVENT Scripts". The new functions should follow the same scheme the existing ACS functions use, see http://wiki.zandronum.com/ACS_Functions

Here is a testing binary that supports all features I mentioned above. The archive also includes an updated ACC version.

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Accounts, persistent storage and EVENT scripts

#12

Post by Lollipop » Thu May 08, 2014 8:28 pm

A thausand praises worthy, good job ;)
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Theshooter7
Forum Regular
Posts: 262
Joined: Wed Jun 06, 2012 2:15 am

RE: Accounts, persistent storage and EVENT scripts

#13

Post by Theshooter7 » Thu May 08, 2014 8:32 pm

Wow, color me impressed. I admit I don't monitor the tracker much and I wasn't expecting this in the slightest. I'll see about doing tests so hopefully this can make a speedy way into the official build. :)
Image

Theshooter7
Forum Regular
Posts: 262
Joined: Wed Jun 06, 2012 2:15 am

RE: Accounts, persistent storage and EVENT scripts

#14

Post by Theshooter7 » Thu Jun 19, 2014 12:23 am

Hate to sound like a needy person, but are these by chance implemented/going to be implemented into the official beta? It'd make it easier to give this a test in my opinion (for instance I could implement this stuff into WDI, then it'll get a good testing run for sure!)
Image

User avatar
Ninjamander
 
Posts: 66
Joined: Tue May 13, 2014 6:29 pm
Location: Canada - New-Brunswick

RE: Accounts, persistent storage and EVENT scripts

#15

Post by Ninjamander » Thu Jun 19, 2014 3:02 am

already excited for all this XD
Image

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: Accounts, persistent storage and EVENT scripts

#16

Post by Torr Samaho » Sat Jun 21, 2014 4:57 pm

Theshooter7 wrote: Hate to sound like a needy person, but are these by chance implemented/going to be implemented into the official beta?
I already ported the necessary code into our main development branch, so the next official beta will contain the new features.
There is only one thing left I'd like to resolve, before releasing the next beta build. This requires small but coordinated changes from AlexMax and me, so it may take a couple of days to get it done.

Theshooter7
Forum Regular
Posts: 262
Joined: Wed Jun 06, 2012 2:15 am

RE: Accounts, persistent storage and EVENT scripts

#17

Post by Theshooter7 » Fri Jun 27, 2014 5:54 pm

Torr Samaho wrote:
Theshooter7 wrote: Hate to sound like a needy person, but are these by chance implemented/going to be implemented into the official beta?
I already ported the necessary code into our main development branch, so the next official beta will contain the new features.
There is only one thing left I'd like to resolve, before releasing the next beta build. This requires small but coordinated changes from AlexMax and me, so it may take a couple of days to get it done.
Alright, glad to hear this. :) I await patiently.
Image

Kara Kurt
Frequent Poster Miles card holder
Posts: 887
Joined: Sat Oct 12, 2013 6:58 pm
Location: Strasbourg, France
Contact:

RE: Accounts, persistent storage and EVENT scripts

#18

Post by Kara Kurt » Fri Jun 27, 2014 6:12 pm

It's cool.

User avatar
MrSetharoo
Forum Regular
Posts: 330
Joined: Wed Oct 24, 2012 4:27 pm
Location: Florida

RE: Accounts, persistent storage and EVENT scripts

#19

Post by MrSetharoo » Fri Jun 27, 2014 7:04 pm

Can't wait to see all the stuff people are going to make with 2.0

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

RE: Accounts, persistent storage and EVENT scripts

#20

Post by Ijon Tichy » Fri Jun 27, 2014 7:49 pm

GAMEEVENT_PLAYERFRAGS seems extremely redundant - a DEATH script that uses SetActivatorToTarget can not only achieve this, but work with monster frags as well.

Everything else is pretty neato, though I haven't fiddled with any of it yet.

edit: An event that fires whenever a player deals damage, running on the actor taking damage with the player number being passed as an argument, along with the damage done, would be much more useful, and would allow for much more accurate damage tracking - perfect for all the RPG mods that crop up.

It would probably be better if the events got batched up into one call (eg. an SSG blast only sends one damage event per monster hit, rather than one per pellet), rather than every single projectile, explosion, hitscan, etc getting its own event.
Last edited by Ijon Tichy on Fri Jun 27, 2014 7:58 pm, edited 1 time in total.

Post Reply