Global

The global entity is a unique abstract entity that represents the entire game. As an abstract entity, it can only modify some global settings in the game settings. You can also use scripts to obtain the property values of the global game, or modify the property values that can be modified. In this article, we will introduce the global entity properties that you can modify in the settings, and how to use the meta script to obtain global property values.

Although the global entity is an abstract entity and cannot be directly operated in CraftLand, we have opened some commonly used setting options for players.

First, we click Setting in the upper left corner of the interface to open the settings border and select GamePlay Settings.

SeaTalk_IMG_20241119_172252

Click Edit Gameplay Rules to enter the settings interface.

In the Mode class, we provide some settings that can change the global flow of the game.

It should be noted that each mode has slightly different settings available depending on the needs of the mode.

The most important settings that are common to all modes are:

  • Preparation time: The waiting time for players to enter the game at the beginning of the game is called preparation time.
  • Game duration: After the preparation time is over, the total time of a single round after the round starts is the game duration.
  • Number of teams: The number of teams that will be created in the current map. Each team needs to have a birth point configured.
  • Number of players per team: The maximum number of players that can participate in each team.
  • Minimum number of players: The minimum number of players required to start the game when creating it.

Global Scripts

A global script will be created by default in the primitive editor. In the global script, we can make certain changes to the global mechanism of the game by writing primitive logic.

Operation poison circle

By programming logic through graphics elements, you can turn on or off the poison circle or modify the parameters of the poison circle.

image-20241120142402764

Enable poison circle: The safe zone is initially generated with the center point as the center, and the radius is set. After waiting for the configured length of time, it moves smoothly towards the midpoint during the duration until it disappears. Players outside the safe zone will receive damage equal to the damage amount per second.
Close poison circle: cancel the poison circle that continuously loses blood. This interface only closes the poison circle generated by the system, and is invalid for the poison circle generated by the custom safe zone object in the scene. However, the implementation of this interface is to create a huge safe zone, so the player will be in the safe zone and will not be harmed by other poison circles. Therefore, it is not recommended to use the system poison circle and the custom safe zone object at the same time.

Moving the poison circle and opening the poison circle interface will set up a new safe zone, replacing the previous one.
After the moving poison circle and opening the poison circle start executing in the script, the execution will continue downward. Please pay attention to the logic of the connection between the front and the back.

Pause and resume the game

image-20241120143130346

These two nodes only affect the triggering of events when the fixed frame is updated.

image-20241120143146800

The event is no longer thrown when the fixed frame is updated after pausing the game, but continues to be thrown after resuming the game.

Pausing and resuming the game will also trigger two events: when the game is paused and when the game is resumed:

image-20241120143209033

The command to pause the game is invalid during the pause, and the same applies to resuming the game.