Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
ASSS CB_ Additions?

 
Post new topic   Reply to topic Printable version
 View previous topic  ASSS Help Post :: Post Help Please  View next topic  
Author Message
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Thu Jun 09, 2005 4:49 pm    Post subject: ASSS CB_ Additions? Reply to topic Reply with quote

I found that I needed a callback for player-turrets and KOTH. I'm sure grel gets at least 10 requests per day for new features so I wrote one example for how these 2 callbacks could work, in effort that grel won't have to bust his balls if he decides to add these callbacks to his source.

Code: Show/Hide

//in game.h
#define PID_NONE -1

#define CB_TURRET "playerturret"
typedef void (*PlayerTurret)(Arena *arena, Player *p, int old_attach);
//p->p_attached determines attachment/detachment
//p->p_attached == PID_NONE if detach
//in the case of detachment, old_attach will be the pid of the player detached from


//in koth.h
#define CB_KOTH "koth"
typedef void (*KothWin)(Arena *arena, LinkedList *winners, int points);
//the linklist is the one in check_koth(), a list of players that receive KOTH reward

_________________
Current Terror Alert Level
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Fri Jun 10, 2005 5:02 am    Post subject: Reply to topic Reply with quote

Sounds good, I'll add them to my todo list. Except I think it'll make for a cleaner interface to call CB_KOTH once for each winner, instead of passing the list around.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Fri Jun 10, 2005 6:07 am    Post subject: Reply to topic Reply with quote

Sweet!
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Fri Jun 10, 2005 6:13 am    Post subject: Reply to topic Reply with quote

How about taking koth further and making a points_koth module? koth is currently one of the few modules not in scoring.so that requires persist.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Mon Jun 13, 2005 1:37 am    Post subject: Reply to topic Reply with quote

A CB_PlayerPositon would be nice. The thing is that I need to get correct player bounty amounts, I'm not sure if cb_green will provide as there are multiple ways to gather bounty, and cb_kill doesn't always have correct bounty amounts. PlayerPositions are constantly sent so I'm guessing that the callback hasn't been added because it will spam the hell out of the modules. I guess I can leave it out or do it with net->AddPacket() if I am really desperate.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Mon Jun 13, 2005 3:16 am    Post subject: Reply to topic Reply with quote

How about a bounty changed callback? To reduce callback spammage you could somehow queue up all the bounty changes in 10 ticks per player, and then call the callback.

game.c
Code: Show/Hide
bounty timer: newbounty, p
do cbs (new bounty, p)
p.bountychangecached = 0

# gets called from pppk when pkt.bounty != p.bounty
bountychanged: newbounty
if p.bountychangecached:
  newbounty += newbounty - p.bounty
else
  p.bountychangecached = 1
clear bounty timer (p)
start bounty timer (newbounty, 10, p)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 21 page(s) served in previous 5 minutes.

phpBB Created this page in 0.432759 seconds : 31 queries executed (93.5%): GZIP compression disabled