Resource:Assault: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 28: Line 28:
</syntaxhighlight>
</syntaxhighlight>


==Map Elements==
=Map Elements=
(may be changed)
(may be changed)


===assaultSettings===
==Assault Settings==
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<assaultSettings timelimit="(int=300)" finishType="(string)" finishObjective="(string)" time="(time=12:00)" weather="(int=0)"
<assaultSettings timelimit="(int=300)"
author="{string}" description="{string}" />
finishType="(string)" finishObjective="(string)"
time="(time=12:00)" weather="(int=0)"
author="{string=''}" description="{string=''}" />
</syntaxhighlight>
</syntaxhighlight>


Line 50: Line 52:
* '''description:''' map description ''(default: "")''
* '''description:''' map description ''(default: "")''


===objective===
 
==Objectives==
<syntaxhighlight lang="xml"><objective name="(string)" description="(string)" successText="(string)" id="(string)" req="(string)"
<syntaxhighlight lang="xml"><objective name="(string)" description="(string)" successText="(string)" id="(string)" req="(string)"
posX="(float)" posY="(float)" posZ="(float)" stay="{int=0}"
posX="(float)" posY="(float)" posZ="(float)" stay="{int=0}"
Line 77: Line 80:
** '''"foot":''' only while on foot
** '''"foot":''' only while on foot
** '''"vehicle":''' only while in a vehicle
** '''"vehicle":''' only while in a vehicle
* '''stay:''' number of seconds the player needs to stay in the objective
* '''stayText:''' the text that is shown above the progress bar while being in the objective


===spawngroup===
==Spawngroups==
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<spawngroup type="(string)" req="(string)">
<spawngroup type="(string)" req="(string)">
Line 95: Line 101:
* '''req:''' objective ids seperated by comma required for this checkpoint to work
* '''req:''' objective ids seperated by comma required for this checkpoint to work


===spawnarea===
 
==Spawnareas==
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<spawnarea posX="(float)" posY="(float)" posZ="(float)" sizeX="(int=2)" sizeY="(int=2)" skins="{int,int=0}" weapons="{int,int;int,int=''}" radius="{int=2}" shape="{string=circle}" />
<spawnarea posX="(float)" posY="(float)" posZ="(float)" sizeX="(int=2)" sizeY="(int=2)" skins="{int,int=0}" weapons="{int,int;int,int=''}" radius="{int=2}" shape="{string=circle}" />
Line 106: Line 113:


====Optional Attributes====
====Optional Attributes====
* '''sizeX, sizeY:''' the maximum number that will be added to the X or Y coordinate
* '''skins:''' list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)
* '''skins:''' random skin from,to (e.g. skins="20,24")
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..
* '''weapons:''' weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..
* '''radius:''' if shape="circle", radius of the circle
* '''shape'''
* '''shape'''
** '''"circle": (default)''' a circle
** '''"circle": (default)''' a circle
** '''"rectangle":''' a rectangle
** '''"rectangle":''' a rectangle
* '''sizeX, sizeY:''' if shape="rectangle", the maximum number that will be added to the X or Y coordinate
* '''radius:''' if shape="circle", radius of the circle


Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.


Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.


===camera===
==Cameras==
<syntaxhighlight lang="xml"><camera type="(string)" posX="(float)" posY="(float)" posZ="(float)" targetX="(float)" targetY="(float)" targetZ="(float)" /></syntaxhighlight>
<syntaxhighlight lang="xml"><camera type="(string)" posX="(float)" posY="(float)" posZ="(float)" targetX="(float)" targetY="(float)" targetZ="(float)" /></syntaxhighlight>


Line 128: Line 135:


====Optional Attributes====
====Optional Attributes====
(none)


==Example map==
==Example map==
Check out /resources/as-area51/ on the ftp.
Check out /resources/as-area51/ on the ftp.

Revision as of 18:41, 14 July 2007

Assault should be similiar to Unreal Tournament's Assault.

How a game should work

  • Waiting for players before each new round for a certain amount of seconds or if enough players have joined
    • Let players select their team
  • Spawn players according to their team
  • team1 has to attack and reach one or more objectives (marker), while team2 defends the objectives
    • if team1 reached an objective, teamspawns may be at another location, according to the next objective
  • if the final objective is reached, the first round ends and team2 has to attack (on the same map)
    • the timelimit for the second round should be the time team1 needed to reach the final objective

Winning

  • If team2 doesn't reach the objective in the timelimit, meaning team1 was faster, team1 wins.
  • If team2 is able to reach the objective in the timelimit, meaning team2 was faster, team2 wins.
  • If team1 and team2 aren't able to reach the objective within the timelimit, game ends tied.

Mapmanager

Assault should work with the mapmanager, so additional maps can easily be created. It also triggers events for map specific scripts and provides functions to trigger custom objectives (not really tested yet).

Events/Functions

onAssaultObjectiveReached ( table objectiveReached, table players ) -- triggers when an objective is successful (when it turns red)
onAssaultStartRound ( team attacker ) -- triggers when a round actually starts (player spawns), 'attacker' is the team that attacks
onAssaultCreateObjective ( table objectiveToCreate ) -- triggers when a custom objective can be created, instead of creating the marker when it would be a normal one
onAssaultEndRound( bool conquered ) -- triggers when the round ends (time up or base conquered), 'conquered' returns true if the base is conquered, otherwise false

bool triggerObjective( string objectiveId ) -- trigger an objective, returns false if it cant be triggered (yet)

Map Elements

(may be changed)

Assault Settings

<assaultSettings timelimit="(int=300)"
		 finishType="(string)" 	finishObjective="(string)"
		 time="(time=12:00)" 	weather="(int=0)"
		 author="{string=''}" 	description="{string=''}" />

Required Attributes

  • finishType: when will a team have conquered the base/reached the objective
    • "objective": when a certain objective is reached
    • "all": when all objectives are reached

Optional Attributes

  • timelimit: duration of one round in seconds (default: 300)
  • finishObjective: used when finishType is set to objective
  • time: time hours:minutes (default: 12:00)
  • weather: weather id (default: 0)
  • author: the map author (default: "")
  • description: map description (default: "")


Objectives

<objective name="(string)" description="(string)" successText="(string)" id="(string)" req="(string)"
		posX="(float)" posY="(float)" posZ="(float)" stay="{int=0}"
		forcedRespawn="{string=none}" markerType="{string=cylinder}" captureType="{string=foot}" />

The order of the objectives in the .map file matters. It is responsible for the order the objectives are displayed on the hud, as well as in the GUI.

Required Attributes

  • posX, posY, posZ: (required) position of the objective

Optional Attributes

  • name: the name of the objective, used for the objective list on the screen
  • description: may be used in the help windows
  • successText: shown when the objective is reached
  • id: unique identification for the objective
  • req: objectives required for this objective, ids seperated by comma, e.g. req="door,room1,room2"
  • type: the type of the objective
    • "checkpoint": (default) assault creates a checkpoint at the location, which has to be activated by the attacker by walking into it
    • "custom": assault does nothing about it except waiting for another script to trigger it (see other assault maps for how it's done)
  • forcedRespawn
    • "both": make all players respawn, as soon as the objective is created
    • other values may come
  • markerType: defines the type of the marker used to mark the objective (see CreateMarker for details on the values)
  • captureType: defines how the objective can be activated
    • "both": on foot and in a vehicle
    • "foot": only while on foot
    • "vehicle": only while in a vehicle
  • stay: number of seconds the player needs to stay in the objective
  • stayText: the text that is shown above the progress bar while being in the objective


Spawngroups

<spawngroup type="(string)" req="(string)">
- put spawnareas here -
</spawngroup>

A spawngroup is a collection of one or several spawnareas. One of the spawnareas will be randomly selected on spawn. You can use this to let attacking players attack from different sides or to let some players spawn with different weapons for example.

Required Attributes

  • type:
    • "attacker": a spawngroup for the attacking team
    • "defender": a spawngroup for the defending team

Optional Attributes

  • req: objective ids seperated by comma required for this checkpoint to work


Spawnareas

<spawnarea posX="(float)" posY="(float)" posZ="(float)" sizeX="(int=2)" sizeY="(int=2)" skins="{int,int=0}" weapons="{int,int;int,int=''}" radius="{int=2}" shape="{string=circle}" />

A spawnarea is a rectangle in which players are spawned randomly. It is defined by one point and two size values. This may change slightly soon.

Required Attributes

  • posX, posY, posZ: position

Optional Attributes

  • skins: list of skins of which one is randomly chosen, seperated by comma, range of skins seperated by hyphen (e.g. 10,14,20-24 would be 10,14,20,21,22,23,24)
  • weapons: weapon1,ammo1;weapon2,ammo2;weapon3,ammo3..
  • shape
    • "circle": (default) a circle
    • "rectangle": a rectangle
  • sizeX, sizeY: if shape="rectangle", the maximum number that will be added to the X or Y coordinate
  • radius: if shape="circle", radius of the circle

Always the last spawngroup (from the order in the mapfile) that meets the 'req' requirements is used to spawn players.


Cameras

<camera type="(string)" posX="(float)" posY="(float)" posZ="(float)" targetX="(float)" targetY="(float)" targetZ="(float)" />

Required Attributes

  • posX, posY, posZ, targetX, targetY, targetZ: position and look at
  • type: defines the type of the camera, when it will be used
    • "spawn": after selecting the team and before spawning
    • "selectTeam": select Team screen
    • "finish": when the last objective is reached

Optional Attributes

(none)

Example map

Check out /resources/as-area51/ on the ftp.