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
Prize control

 
Post new topic   Reply to topic Printable version
 View previous topic  hasball flag Post :: Post Visual C++ Errors?  View next topic  
Author Message
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Apr 28, 2004 2:27 pm    Post subject: Prize control Reply to topic Reply with quote

I think there should be a green/prize callback for game.h
Code: Show/Hide
/* this callback will be called whenever a a player picks up a
* prize. x and y are in tiles */
#define CB_GREEN "green"
typedef void (*GreenFunc)(Arena *arena, Player *p, int x, int y,
   int prize);
/* pycb: arena, player, int, int, int */

Also another argument in KillFunc to set the kill prize. The default points_kill module can poll clientset for the prize or game.c can preload the prize from clientset before DO_CBS(). Any custom modules can be loaded ontop and they would be able to overwrite the value (so load order would be important, possible rookie zone ops loading in wrong order).
A better way to implement this might be to use per arena interfaces, and if none are found then use clientset.

Why have control over prizes? This opens up possibilities of assigning an invalid prize # to the kill prize. The client sees this as fullcharge, but the server can detect the prize pickup and execute an event.

commands.txt vs. defs.h
Quote:
PRIZE_THOR,
PRIZE_MULTIPRIZE,
PRIZE_BRICK,
I may be wrong as HS prizes bricks, which come after the missing multiprize #.

OT: Aargh, these [.code.] tags not working properly in preview mode are so annoying.

Edit: meh, the post is narrower than my browser window. [.color.] tag is broken, and it says I can post this as a sticky o_O.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Thu May 06, 2004 10:04 pm    Post subject: Reply to topic Reply with quote

Nice catch on the missing PRIZE_MULTIPRIZE.

The other two suggestions seem reasonable. I originally didn't do a CB_GREEN because I figured it would be called too often, but that's probably not a good reason not to support it.

Letting kill callbacks set the kill prize with an extra int pointer in the args sounds like the best solution. It'll default to a random value provided by clientset, of course. I think module ordering issues aren't really a big deal here, because you shouldn't be loading two modules that both try to set that value anyway.

I'll try to do all these soon.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
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: 66 page(s) served in previous 5 minutes.

phpBB Created this page in 0.541485 seconds : 26 queries executed (82.7%): GZIP compression disabled