Jump to content

Racing system


Azelat

Recommended Posts

  • Developer
 

Feature Showcase: Racing System

 

In order to diversify the activities offered to players, and to give a more interesting context to some of them, the racing system appears!

Reserved for a particular type of business and the administration, this system will allow everyone to have the chance to design their own circuit and to have all motor racing fans compete there, under the eyes of spectators who will be able to follow the progression of the ranking.
 

 

 


I The conditions of creation.

In this initial version, the script is limited to people with a particular permission, assigned by a flag (RACING), that only administration can provide.
This property allows anyone with the flag to have full access to the system, even in dimension 0. (Useful for events)

For others, and therefore for most of the people who will use this script, the system is limited to other dimensions, therefore to interiors, with a business type created especially for the occasion: Racing business.

 

 

 

 

II. Creating a circuit

Creating a circuit is quite simple. It is simply based on the checkpoint position along your route.

To get started, you need to create your race with /createrace [name] [nb laps]
You can specify a number of laps, but it is not required. by default this is 1.

You must be near your business to create a circuit. The rest of the operations can be done regardless of the position of your business, but you will only be able to create a circuit in the dimension in which you used /createrace.

When the race is created, you can start setting up your checkpoints. To do this, simply use /createracepoint [race ID] [Order]

 

Some instructions:

  • The race ID can be found in /raceslist, which is the command that allows you to find all your created races.
    • MXOvwVR.png
  • Order allows you to determine the order in which checkpoints are passed. So, naturally, you start by placing point 1, then point 2, etc. Be careful to respect the order of your checkpoints and not skip any steps. A circuit with checkpoints whose order is not precise will not be usable (forgetting a checkpoint, going from point 1 to point 3, etc.)
  • You must be at the exact position where you wish to place your checkpoint before using the command.



You can find all the checkpoints of your race with /pointsofrace [race ID] or in the race manager, which makes it easy to know if you missed a step or not, and to retrieve checkpoints Ids.

3kP8MP3.png


It is possible to change the order of checkpoints with /changeracepointorder (/crpp) [point ID] or with the race Manager.
It is possible to change the position of a checkpoint with /changeracepointposition (/crpp) [point ID]

 

 

 

 

III. Race Manager

In order to make the system more user friendly for players who wants to create a race, this includes a UI specific to race management. You'll be able to edit the race easily and edit some characteristics of the race, as well as checkpoints.

The race owner can use /managerace [ID Race] to open the UI.

 

This UI can be used to:

  • Rename the race
  • Change the number of laps
  • Change the radius of checkpoints
  • Activate or deactivate the visibility of checkpoints
  • Activate or deactivate the sound when racer crosses checkpoint.
  • Decide if the individual timer should be started at the start of the race or when passing the first checkpoint
  • Activate or deactivate the freeze during countdown at start race.

 

On the other hand, the owner can modifies order of checkpoints, since they are displayed in the UI. The owner can preview the checkpoint, delete it from the race, or change the order. 

When owner saves, the race manager automaticly repairs circuit errors (checkpoints missing, wrong order, etc...)

 

mxaEGjO.png

 

 

 

IV. Initialize the race

To initiate a race, you will need to be near your business and use /initrace [race ID]. A notification will be sent to all players present in the dimension to specify that your race is now open for registration.

You can use /endrace to terminate it prematurely.

You can only run one race at a time.
Initializing a race does not prevent you from joining it as a runner or spectator.

 

 

 

 

V. Join the race – Pilot and Spectator

All players present in the dimension are alerted by a notification when a race is available. Just use the following commands:

  • /joinrace [race ID] to join the race as a driver.
  • /spectaterace [race ID] to join the race as a spectator.


A spectator is a player who will have real-time information from the race, with a designed UI that summarizes the drivers' overall time and their position in the leaderboard.
As for the drivers, the UI will display their lap time, their total time, their ranking, the lap they are on.

For both UIs, the leaderboard will display when a player finishes the race or forfeits.

A driver can use /leaverace to leave the race before the start.
At any time, a spectator can use /stopspectaterace to stop following the race.

 

lajBzep.png

Here an example of racing UI, with chronometer at the bottom, and leaderboard on the right.

 

 

 

 

VI. Course of the race

Drivers will see their time and ranking in real time, as the race progresses. The ranking and times are updated as soon as a player passes a checkpoint. Indicators will be used to show who has finished the race or who has withdrawn.

A driver can use /forfeit if he wants to leave the race midway.

When all the drivers have finished their race (finish line crossed or withdrawn), the UI disappears. Spectators keep their UI until the organizer definitively ends the race.

At this moment, all racers and spectators can see the final leaderboard, with /leaderboard

 

 

joU9Ej2.png

 

 


In any case, it is up to the organizer to definitly end the race with /endrace. The goal is to be able to keep the results for as long as necessary after the last driver crosses the line.
Once /endrace is performed, all results are permanently lost, because the command resets all race data.

 

7mVDf3M.png

 

 

 

 

VII. Example

 

 

 

 

 

VIII. All commands

  • /createrace [name] – Create a race with specific name
  • /deleterace [id] – Delete a race with its ID.
  • /raceslist – List of race created by the player.
  • /racemanager [ID] - Open the race manager for the specific race.

 

  • /createracepoint [race ID] [Order] – Create a checkpoint for the specified race.
  • /deleteracepoint [point ID] – Delete a checkpoint with its ID.
  • /changeracepointposition (/crpp) [point ID] – Moove a specific checkpoint to player location.
  • /changeracepointorder (/crpp) [point ID] – Change order of passage of checkpoint.
  • /pointsofrace [race ID] – List all checkpoint of specified race.

 

  • /initrace [race ID] – Init the race.
  • /joinrace [race ID] – Join the rase as driver
  • /leaverace – Leave the race (Before it’s started)
  • /forfeit – Leave the race while it’s in progress.
  • /endrace - End the race (owner command only)

 

  • /spectaterace [race ID] – Join the race as spectator.
  • /stopspectaterace – Stop watching race.
  • /leaderboard - See the final leaderboard after all racers crossed the finish line.
  • Upvote 14
  • Thanks 2
  • Applaud 1
Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...