View Single Post
  #1  
Old 09-29-2008, 11:04 AM
AHO's Avatar
AHO AHO is offline
Approved Member
 
Join Date: Aug 2008
Location: Germany
Posts: 537
Default User defined mission tasks...

User defined mission tasks...

It is possilble to add new (user defined) mission tasks to every level.
Following will add a new test task to the level "Hotel". The aim is to kill the hotel manager.

Steps:
0. Unpack the content of the archive levels.vfs and rename the file to levels.vfs.org (You need of course the unpaker for vfs... Can be found in this board.)

1. Add task string to "MissionText -Array.
kill_manager = "Kill the hotel manager.";

2. Add the following task definition to the end of the function "Level.OnLoaded:

Level.AddMissionTask( MissionText.kill_manager, 'id_km', "levels\\hotel\\km.txt" );
Level.AddActionHandler( Level.AH_ACTOR_KILLED , "HM03" , "OnKilledManager");

3. Create-Event-Handler (New Funktion) at the end of the hotel.lua

function Level.OnKilledManager()
Level.CompleteMissionTask( "id_km" );
Level.RemoveMissionTask('id_km');
end

4. Create a briefing textfile "km.txt" with text.

Last edited by AHO; 09-29-2008 at 11:07 AM.
Reply With Quote