35void raceEvent(
int trigger_type,
string inst,
string box,
int nodeid);
114 void raceEvent(
int trigger_type,
string inst,
string box,
int nodeid);
134 void addLapTime(
int raceID,
double time,
bool &out newBestLap);
177 int addRace(
string raceName,
double[][] checkpoints,
int laps,
string objName_checkpoint,
string objName_start,
string objName_finish);
188 int addRace(
string raceName,
double[][] checkpoints,
int laps,
string objName_checkpoint,
string objName_start_finish);
198 int addRace(
string raceName,
double[][] checkpoints,
int laps,
string objName_checkpoint);
207 int addRace(
string raceName,
double[][] checkpoints,
int laps);
215 int addRace(
string raceName,
double[][] checkpoints);
432 void addCheckpoint(
int raceID,
int number,
string objName,
double[] coords);
604 void addChpCoordinates(
double[][] checkpoints_in,
const string &in objName_checkpoint,
const string &in objName_start,
const string &in objName_finish, uint startNumber);
607 void addCheckpoint(
int number,
const string &in objName,
const double[] &in v);
This class manages a race (singular!) You should only use this directly if the racesManager doesn't s...
string raceBuilderVersion
void destroy()
this function removes all checkpoints again
void loadRace(Script2Game::LocalStorage@ d)
void saveRace(Script2Game::LocalStorage@ d)
void deleteCheckpoint(int number, int instance)
void setVersion(const string &in version)
void deleteCheckpoint(int number)
array< array< string > > objNames
void addCheckpoint(int number, const string &in objName, const double[] &in v)
void setLaps(int laps_in)
double[] bestTimeTillPoint
int getNextCheckpointNum(int lastCheckpoint)
double[] lastTimeTillPoint
void addChpCoordinates(double[][] checkpoints_in, const string &in objName_checkpoint, const string &in objName_start, const string &in objName_finish, uint startNumber)
uint getRealInstanceCount(int chpNum)
bool checkpointExists(int chpNum, int instance)
int getPreviousCheckpointNum(int lastCheckpoint)
This class allows you to organize races.
void addRaceTime(int raceID, double time, bool &out newBestRace)
void deleteRace(int raceID)
Deletes a race.
double getBestRaceTime(int raceID)
Gets the best race time of a certain race.
int getRaceIDbyName(string raceName_in)
Returns the race ID of a race name.
void unhideRace(int raceID)
This shows your race again, after it was hidden.
bool addPenaltySeconds(int seconds)
Add an amount of penalty time to the current race.
void unlockRace(int raceID)
Unlocks a race.
raceBuilder getRace(int raceID)
Gets the raceBuilder object of a race.
int getPenaltyTime(int raceID)
This returns the penalty time setting of a race.
int STATE_Racing
We're in the middle of a race :D.
void advanceLap()
Advances a lap.
string lastCheckpointInstance
int ARROW_AUTO
This arrow method will always point to the checkpoint instance that comes closest to the previous one...
int ACTION_RestartRace
Not used.
int addRace(string raceName, double[][] checkpoints, int laps)
Add a race to the terrain, using the default checkpoint objects.
int getCurrentRaceID()
Gets the ID of the current race.
int addRace(string raceName, double[][] checkpoints)
Add a not-looping race to the terrain, using the default checkpoint objects.
bool raceCompleted(int raceID)
Is a certain race completed?
string raceManagerVersion
the version of the raceManager
string formatTime(double seconds)
Formats the time.
void setPenaltyTime(int raceID, int seconds)
This sets the penalty time of a race.
int addRace(string raceName, double[][] checkpoints, int laps, string objName_checkpoint, string objName_start, string objName_finish)
Adds a race to the terrain.
void addCheckpointList(int raceID, uint startNumber, string objName, double[][] coords)
Adds a list of checkpoints to a race.
bool allowVehicleChanging
if false: if the user changes vehicle, the race will be aborted. (default=false)
void setBestLapTime(int raceID, double time)
Sets a best lap time.
bool showTimeDiff
if true: Show + or - [best time minus current time] when passing a checkpoint. (default=true)
int arrowMethod
What checkpoint instance should the directional arrow point to. (default=ARROW_AUTO=point to the same...
void finishCurrentRace()
Finishes a race.
int currentLap
the number of the current lap. (starts from 0)
string lastRaceEventInstance
int lastCheckpoint
The number of the last passed checkpoint.
void loadRace(int raceID)
Loads a race.
void eventCallback(int eventnum, int value)
This should be called from within your RoR eventCallback function.
racesManager()
The constructor This initializes everything.
int raceCount
the raceID+1 of the last race.
void setupArrow(int position)
Make the directional arrow point to a certain checkpoint of the current race.
int LAPS_One
This race consist of 1 lap, and the start and finish line are the same object.
void lockRace(int raceID)
Locks a race.
void cancelCurrentRace()
Aborts the current race.
void setCallback(string event, RACE_EVENT_CALLBACK @func)
Adds a callback funciton.
bool showCheckPointInfoWhenNotInRace
if true: if the user drives through a checkpoint of a race that isn't running, a message will be show...
bool abortOnVehicleExit
if true: if the user exits his vehicle, the race will be aborted. (default=false)
void setLaps(int raceID, int laps)
Sets the amount of laps for a race.
void startRace(int raceID)
Starts a race.
int STATE_NotInRace
We're not racing at the moment.
RACE_EVENT_CALLBACK getCallback(string event)
Gets a callback funciton.
void addCancelPoint(int raceID, string objName, double[] v, RACE_EVENT_CALLBACK @callback)
This allows you to add an object with event boxes that will cause the race to be aborted.
bool obligatedFinish
if true: if you drive through the start checkpoint of another race, while racing, it will be ignored....
void saveRace(int raceID)
Saves a race.
int LAPS_Unlimited
Keep looping the race for an unlimited time.
void removeCallback(string event)
Remove a callback function.
bool showBestLap
if true: If a race is started or a new best lap is set, the best lap will be shown....
int LAPS_NoLaps
This race has a seperate start line and finish line.
int state
In which state are we?
void deleteCheckPoint(int raceID, int number, int instance)
This deletes a checkpoint from a race.
int ACTION_StopRace
Not used.
void raceCancelPointHandler(int trigger_type, string inst, string box, int nodeid)
event handler for cancel points
void setBestRaceTime(int raceID, double time)
Sets a best race time.
double getBestLapTime(int raceID)
Gets the best lap time of a certain race.
void saveRaces()
Saves all races.
void setStartNumber(int raceID, int startNum)
This allows you to change the startNumber of a race.
int ACTION_SuspendRace
Not used.
int addRace(string raceName, double[][] checkpoints, int laps, string objName_checkpoint)
Add a race to the terrain.
void addLapTime(int raceID, double time, bool &out newBestLap)
int getNewRaceID()
Creates a new free race ID.
int STATE_Waiting
A race is suspended, and we're waiting until the race continues.
void resetEventCallback()
Resets the race event callback.
int truckNum
The number of the (last) used truck in the race.
void setVersion(int raceID, string version)
This sets the version of your race.
void hideRace(int raceID)
This hides your race.
int addRace(string raceName, double[][] checkpoints, int laps, string objName_checkpoint, string objName_start_finish)
Add a race to the terrain.
void addCheckpoint(int raceID, int number, string objName, double[] coords)
Adds a checkpoint to a race.
void raceEvent(int trigger_type, string inst, string box, int nodeid)
This will get called when a truck is at a checkpoint You shouldn't call this manually (use the "Check...
bool showBestRace
if true: If a race is started or a new best race is set, the best race will be shown....
void setRaceName(int raceID, string raceName)
Sets the name for a race.
int ACTION_DoNothing
Not used.
int currentRace
the ID of the current race. (-1 is there's no race running at the moment)
void advanceCheckpoint(int raceID)
Advances a checkpoint.
void recalcArrow()
Recalculates where the arrow should point to.
bool submitScore
if true: If the user has a new best lap or new best race, this is submitted to the master server....
void removeArrow()
This hides the directional arrow.
int addNewEmptyRace()
Add a new empty race (advanced users only!)
bool silentMode
if true: No flashmessages will be shown. (default=false)
void finalize(int raceID)
Finalizes your (advanced) race.
int getLaps(int raceID)
Gets the amount of laps for a race.
void raceCancelPointHandler(int trigger_type, string inst, string box, int nodeid)
called when the user drives through a cancel point
funcdef void RACE_EVENT_CALLBACK(dictionary@)
A function signature for the callback pointers.
void raceEvent(int trigger_type, string inst, string box, int nodeid)
called when the user drives through a checkpoint
Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.