0 Members and 1 Guest are viewing this topic.
/startrace: force a race to start/endrace: force a race to end/autostart: change autostart mode (on by default)/laps #: set number of laps/loadmap: load map from ini (it's done automatically, use it if you modified the ini)/savemap: will save the checkpoints and lap to a ini file (not race.ini cuz WriteFile not working good)/showpoints: lists the checkpoints in the console (for debugging)/setnumpoints: sets the number of checkpoints in the map (use before /pos)/pos: takes your player position and saves it in the 'current checkpoint', then it increases current checkpoint by 1/setpoint #: sets the current checkpoint
Waiting for everyone to be alive and with no movement.Starting in 3...Starting in 2...Starting in 1...Race Started! [*] [Error] PerroRACE -> (AppOnIdle): Out of Global Vars range [*] [Error] PerroRACE -> (RaceLoop): Access violation at address 0809DA07, accessing address 00000109 [*] [Error] PerroRACE -> (AppOnIdle): Access violation at address 0809DA90, accessing address 00000109 [*] [Error] PerroRACE -> (AppOnIdle): Access violation at address 0809DA90, accessing address 0000011C [*] [Error] PerroRACE -> (AppOnIdle): Access violation at address 0809DA90, accessing address 0000012C(etc)
You can do something like this in AppOnIdle: the checkpoints should be made of 2 points - the points will create a line segment. 2 player positions, from previous AppOnIdle and current AppOnIdle, will create the second line segment. Check if the line segments intersect, if true, the player passed the checkpoint. Though I dunno if it won't be to slow.
Well right now I'm rewriting the code, making it clean cause it was a mess. I'll try how it works doing the loop in AppOnIdle without considering the time resolution.
Maybe it's not so bad, the problem comes when 2 or more players go together, the one with lower ID will win I guess.
And also I made this script having in mind making it save the best lap times, and 1 second resolution would suck for that.
The weapons idea would screw up the race because sometimes you have to stop in order to take the weapon, and also there are some checkpoints in the air.
Then I calculate the angle between those 2 lines, if it's greater than 90° it means you crossed the checkpoint. I still have to think about it, I'm not so sure about this
function angle( v1x, v1y, v2x, v2y: single ): single;var cosangle: single; dist: single;begin dist := ( distance( 0, 0, v1x, v1y ) * distance( 0, 0, v2x, v2y ) ); cosangle := ( v1x * v2x + v1y * v2y ) / dist; if dist = 0 then begin result := -1; exit; end result := 90 - 720 * ( arctan( cosangle / ( 1 + sqrt( 1 - cosangle * cosangle ) ) ) ) / (2 * pi);end;
First of all you must download the dedicated server, which you can downlaod >here< (it's not the one that comes with soldat)Then, you unzip that somewhere and unzip PerroRACE.zip in the same somewhere.You can edit the file soldat.ini to set the server options, but it's not really necessary.If the race won't start use the command "/recompile race". That will reload the script. Other than that use the commands I posted in the first post. Remember that you have to use some of the maps I included (rc_Airpirates, rc_Bigfalls, rc_Arena) or set the checkpoints on your own if you want to play in another map.
My new password is secure as shit Mate, I am not sure Shit is even secured nowadays.
var SomeArray: Array [1 .. 2] of byte;procedure AppOnIdle(Ticks: integer);begin SomeArray[3] := 1;end;