sample race.conf wrote: |
#define PRIZE_WARP 7
#define PRIZE_THRUST 11 #define PRIZE_SPEED 12 #define PRIZE_FULLCHARGE 13 [Race] MinPlaying=1 MinTeams=1 Laps=2 ; rectangular checkpoint area (top left and bottom right map tile coord) ChkPt0=507,507,516,516 ChkPt1=549,500,558,509 ChkPt2=527,566,536,575 ;whether checkpoint 0 is the start and the finish ContinuousMap=1 ; anyone not in a safe zone on 'gogogo' gets specced InSafeToPlay=1 ; stages: Ready, Start, CheckPoint, Lap, Death and Finish ; actions: Spec, ShipReset, Prize, WarpXY, ArenaMessage, Message ; message macros: ; name - player's name ; lap - laps completed so far ; chkpt - last checkpoint crossed ; rank - position in the race, 0 if still racing ; time - time in seconds since the race started (#.##) ; # - play bong#.wa2 ; example configuration: Ready-ShipReset = 1 Ready-Prize = $PRIZE_SPEED,$PRIZE_SPEED, $PRIZE_THRUST, $PRIZE_THRUST Ready-WarpXY = 512,512 Ready-ArenaMessage=Get ready! Start-ArenaMessage=GooOOoo Go GO gO!!%104 CheckPoint-Message=checkpoint %chkpt ok%26 Lap-Message=lap %lap time so far %time Death-ShipReset = 1 Death-Prize = $PRIZE_WARP Death-ArenaMessage=%name had a fatal accident (%lap laps) ;Finish-Spec = 1 Finish-Prize = $PRIZE_WARP, $PRIZE_FULLCHARGE Finish-ArenaMessage=#%rank %time %name |
Code: Show/Hide ArenaPlayers*RewardModifier/Place |
Code: Show/Hide if( place != 1 ) ArenaPlayers*RewardModifier/(1stPlaceTime-Yourtime) else ArenaPlayers*RewardModifier/1 |
Code: Show/Hide --- asss-1.2.0/src/race.c 2004-08-13 13:43:20.000000000 -0400 +++ asss-1.3.2/src/race.c 2004-10-07 10:11:09.000000000 -0400 @@ -70,9 +70,14 @@ #include <ctype.h> //isdigit() #include "asss.h" -#include "region.h" //rect_t +//#include "region.h" //rect_t #include "packets/speed.h" +typedef struct rect_t +{ + int x, y, w, h; +} rect_t; // From old region.h + typedef struct { u8 completedlaps; @@ -1097,7 +1102,7 @@ pdkey = pd->AllocatePlayerData( sizeof(pdata) ); if (pdkey == -1) return MM_FAIL; - cmd->AddCommand("race", Crace, race_help); + cmd->AddCommand("race", Crace, ALLARENAS, race_help); // needs arena param in 1.3.x mm->RegCallback(CB_ARENAACTION, ArenaAction, ALLARENAS); mm->RegCallback(CB_PLAYERACTION, PlayerAction, ALLARENAS); net->AddPacket(C2S_POSITION, Pppk); @@ -1112,7 +1117,7 @@ mainloop->ClearTimer(timer, NULL); mainloop->ClearTimer(countdown_timer, NULL); - cmd->RemoveCommand("race", Crace); + cmd->RemoveCommand("race", Crace, ALLARENAS); // needs arena param in 1.3.x mm->UnregCallback(CB_ARENAACTION, ArenaAction, ALLARENAS); mm->UnregCallback(CB_PLAYERACTION, PlayerAction, ALLARENAS); net->RemovePacket(C2S_POSITION, Pppk); |
Code: Show/Hide CHANGELOG
11/05/04 v 1.3i i88gerbils * "i" branch started ;-) * RaceReward hack, does not use a separate module. * RaceDelay timer added to set maximum race time. * AutoRace functionality added to start races automatically. * InStartToPlay changed to spec OR ignore non-racers. * stats->SendUpdates works. Now scores will update immediately. Yay. |
Code: Show/Hide TODO
* RaceMinDelay min=0 Minimum time needed to passa checkpoint before being disqualified. * RaceRewardMode Add in a new race reward mode based on time. This will probably be players^2 * RaceReward / rank / (mytime-1sttime) [except for 1st place racer of course!] |
i88gerbils wrote: |
Yay saving about 2 seconds of d/l for dialup users... |
Dr Brain wrote: |
If you factor in the time it takes to download 7zip, it actually takes longer. |