Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 105 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
OFP2
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Lua Scripting
Versions: You must be logged in to view history.

Lua Scripting

To access Lua for your mission you first have to place a script object on the game world.

  1. Create a new Mission file
  2. Insert a USMC Rifleman on to the Map
  3. Set the USMC Rifleman as Player controlled
  4. Click on the Systems tab, expand the Scripting folder and select the Level script entity.
  5. Click on the map to place the Level Script entity. You can move the Level script entity away from the map area.

There are two ways to access the script, firstly you will see that it has added an extra tab on top of the Map object, or by clicking on the Level script entity on the map and then in the Lua Script properties click on the Edit Script button as shown below the Map Editor tabs.

Lua scripts are organised in to sections called functions, which reference a particular event in the game. You can write functions that can cover a wide range of gameplay mechanics, for instance defining what happens when the player has destroyed a target, or entered a particular zone.

Functions can be called before the start of the mission, using a timer, on the press of a button or in a number of other ways.

A typical function and its format can be seen in the Figure below.

The function destroys a specific vehicle, which in this case is a vehicle called “destlav00”. This will cause the vehicle to be totally destroyed in the same way as if it had been hit by heavy munitions such as artillery. It will also cause damage to those who are nearby. This function is called when the mission is first started (onMissionStart).

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»