Checkpoints
Un article de Wiki-Mapping.
Checkpoints
C'est un exemple pour une map capture the flag avec 3-checkpoint.
D'abord construisez une pièce simple avec un info_player_start et une entité de scénario
(clic droit et choisir le script > multiplayer_script).
Placez-y alors 3 team_wolf_checkpoint. Cliquez droit et choisissez-les ensuite dans la catégorie team. M
aintenant votre carte doit être comme cela :
Sélectionnez maintenant le premier des checkpoints et appuyez sur 'N'.
Entrez toutes les configurations comme j'ai fait.
Le modèle est le point drapeau qui est employé dans chaque carte officielle pour checkpoints/spawnpoints.
Répétez cela pour les 3 points de contrôle avec bien sûr d'autre scriptnames - ceux-ci sont cp2 et cp3.
Voilà pour la carte, maintenant vient le scénario, n’ayez pas peur,
ça à l’air d’avoir demandé beaucoup de travail mais c’est tout le temps pareil.
Si vous ne comprenez pas ce qui se passe alors vous avez le droit poser des questions sur le forum d'easymapping.
//checkpoint_tutorial
//Map: checkpoint_tutorial.map
//done by the muffinman //
game_manager
{
spawn
{
wm_axis_respawntime 30
wm_allied_respawntime 30
wm_number_of_objectives 4
wm_set_round_timelimit 10
// Les nazi controlent l’objectif 1 au début
wm_setwinner -1
wm_set_objective_status 1 -1
wm_set_objective_status 2 -1
wm_set_objective_status 3 -1
// Accum 1-3 seront les états des checkpoints, -1 signifie que personne controle le drapeau
accum 1 set -1
accum 2 set -1
accum 3 set -1
// Accum 4 tracks the tide of battle
accum 4 set 0
}
// The following functions are called from the checkpoints when either team takes control of it
trigger cp1_blue
{
// Allied takes control of checkpoint #1
wm_set_objective_status 1 1
// First update winner based on number of flags held by both teams
trigger game_manager adjustwinner_cp1_blue
// Change the variable within the script so that we can check if someone wins the round
accum 1 set 1
// Message d’alerte pour dire aux joueurs que l’objectif à été pris
wm_announce "Allies take the checkpoint 1!"
// appelle la fonction pour voir si le round a été gagné
trigger game_manager checkgame_blue
}
trigger cp1_red
{
wm_set_objective_status 1 0
// First update winner based on number of flags held by both teams
trigger game_manager adjustwinner_cp1_red
// Change the variable within the script so that we can check if someone wins the round
accum 1 set 0
// Message d’alerte pour dire aux joueurs que l’objectif à été pris
wm_announce "Axis take the Checkpoint 1!"
// appelle la fonction pour voir si le round a été gagné
trigger game_manager checkgame_red
}
trigger cp2_blue
{
// Allied takes control of checkpoint #1
wm_set_objective_status 2 1
// First update winner based on number of flags held by both teams
trigger game_manager adjustwinner_cp1_blue
// Change the variable within the script so that we can check if someone wins the round
accum 2 set 1
// Message d’alerte pour dire aux joueurs que l’objectif à été pris
wm_announce "Allies take the checkpoint 2!"
// appelle la fonction pour voir si le round a été gagné
trigger game_manager checkgame_blue
}
trigger cp2_red
{
wm_set_objective_status 2 0
// First update winner based on number of flags held by both teams
trigger game_manager adjustwinner_cp1_red
// Change the variable within the script so that we can check if someone wins the round
accum 2 set 0
// Some kind of UI pop-up to alert players
wm_announce "Axis take the Checkpoint 2!"
// Call function to check if the round has been won
trigger game_manager checkgame_red
}
trigger cp3_blue
{
// Allied takes control of checkpoint #1
wm_set_objective_status 3 1
// First update winner based on number of flags held by both teams
trigger game_manager adjustwinner_cp1_blue
// Change the variable within the script so that we can check if someone wins the round
accum 3 set 1
// Some kind of UI pop-up to alert players
wm_announce "Allies take the checkpoint 3!"
// Call function to check if the round has been won
trigger game_manager checkgame_blue
}
trigger cp3_red
{
wm_set_objective_status 3 0
// First update winner based on number of flags held by both teams
trigger game_manager adjustwinner_cp1_red
// Change the variable within the script so that we can check if someone wins the round
accum 3 set 0
// Some kind of UI pop-up to alert players
wm_announce "Axis take the Checkpoint 3!"
// Call function to check if the round has been won
trigger game_manager checkgame_red
}
// Keep winner set to team with most flags
trigger checkwinner
{
wm_setwinner -1
accum 4 abort_if_equal 0
wm_setwinner 1
accum 4 abort_if_greater_than 0
wm_setwinner 0
}
trigger adjustwinner_cp1_blue
{
accum 4 inc 1
trigger game_manager checkwinner
accum 1 abort_if_not_equal 0
accum 4 inc 1
trigger game_manager checkwinner
}
trigger adjustwinner_cp1_red
{
accum 4 inc -1
trigger game_manager checkwinner
accum 1 abort_if_not_equal 1
accum 4 inc -1
trigger game_manager checkwinner
}
trigger adjustwinner_cp2_blue
{
accum 4 inc 1
trigger game_manager checkwinner
accum 2 abort_if_not_equal 0
accum 4 inc 1
trigger game_manager checkwinner
}
trigger adjustwinner_cp2_red
{
accum 4 inc -1
trigger game_manager checkwinner
accum 2 abort_if_not_equal 1
accum 4 inc -1
trigger game_manager checkwinner
}
trigger adjustwinner_cp3_blue
{
accum 4 inc 1
trigger game_manager checkwinner
accum 3 abort_if_not_equal 0
accum 4 inc 1
trigger game_manager checkwinner
}
trigger adjustwinner_cp3_red
{
accum 4 inc -1
trigger game_manager checkwinner
accum 3 abort_if_not_equal 1
accum 4 inc -1
trigger game_manager checkwinner
}
// Check for game-winning condition
trigger checkgame_blue
{
// Check all for checkpoints and see if they have been set to '1' - allied
accum 1 abort_if_not_equal 1
accum 2 abort_if_not_equal 1
accum 3 abort_if_not_equal 1
// Set the round winner: 0 == AXIS, 1 == ALLIED
wm_setwinner 1
// End the round
wm_endround
}
trigger checkgame_red
{
// Check all for checkpoints and see if they have been set to '0' - axis
accum 1 abort_if_not_equal 0
accum 2 abort_if_not_equal 0
accum 3 abort_if_not_equal 0
// Set the round winner: 0 == AXIS, 1 == ALLIED
wm_setwinner 0
// End the round
wm_endround
}
}
cp1
{
trigger axis_capture
{
trigger game_manager cp1_red
}
trigger allied_capture
{
trigger game_manager cp1_blue
}
}
cp2
{
trigger axis_capture
{
trigger game_manager cp2_red
}
trigger allied_capture
{
trigger game_manager cp2_blue
}
}
cp3
{
trigger axis_capture
{
trigger game_manager cp3_red
}
trigger allied_capture
{
trigger game_manager cp3_blue
}
}
Voilà pour le script