 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Apr 28, 2004 2:27 pm Post subject: Prize control |
 |
|
|
|
I think there should be a green/prize callback for game.h /* 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 |
|
 |
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Thu May 06, 2004 10:04 pm Post subject: |
 |
|
|
|
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 |
|
 |
|
|
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
|
Software by php BB © php BB Group Server Load: 66 page(s) served in previous 5 minutes.
|