|
Death to Spies Stealth action. Professional spy working for the Soviet counterintelligence service executes dangerous operations in the heart of German territory. |
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
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. |
#2
|
||||
|
||||
Does anybody has an idea what kind of task I could add to which level of the game?
Condition is it should fit to the game and the historical background...
__________________
Last edited by AHO; 10-01-2008 at 09:47 PM. Reason: Corr |
#3
|
|||
|
|||
Quote:
You can't make new levels can you? |
#4
|
||||
|
||||
No, just mission tasks inside a level!
__________________
|
#5
|
|||
|
|||
Quote:
|
#6
|
|||
|
|||
In what function did you insert the code to add new tasks?
|
#7
|
||||
|
||||
Quote:
could you post your lua code?
__________________
|
#8
|
|||
|
|||
Sorry about the late answer. I re read the post, followed the instructions,
and it worked! I must have put it in the wrong function the last time. But now I have another problem: I can't leave the Hotel! I've poked around the script and i've made the task appear after you kill the traitor. Another problem is that if I get the docs and then kill the traitor the mission ends then and there, no "Kill the Manager" or even "Leve the Hotel". Here are the functions i've changed: When the traitor is killed function Level.OnKilledGad() if (Level.IsMissionFailed() != false) then return; end if (Level.IsMissionTaskCompleted( 'FNDS' ) == false) then Level.FailedMission( MissionText.Failed_GadKilled ); return; end -- Deleted to make sure Manager is killed before leaving -- if (Level.IsMissionTaskCompleted( 'DOCS' ) ) then -- Level.SetupLeaveTask(); -- end Level.CompleteMissionTask( 'KILL', 15.0 ); Level.EnableLevelMark('POOL', false); -- Custom Manager task added when traitor is killed Level.AddMissionTask( MissionText.kill_manager, 'id_km', "levels\\hotel\\km.txt" ); Level.AddActionHandler( Level.AH_ACTOR_KILLED , "HM03" , "OnKilledManager"); Level.AddSmallMessage( MissionText.Clues, 15.0, 255, 255, 255 ); Level.AddLargeMessage( MissionText.TaskChanged, 15.0, 255, 255, 255 ); -- END if (Level.IsPlayerAtLibrary()) then local gad = AI.FindNPC('HG42'); if (gad != nil) then AI.SetGameFlag(gad, AI.F_ENABLE_ALWAYS, true); end end end When the manager is killed function Level.OnKilledManager() Level.CompleteMissionTask( "id_km" ); Level.RemoveMissionTask('id_km'); -- Check if docs have been retrived if (Level.IsMissionTaskCompleted( 'DOCS' ) ) then Level.SetupLeaveTask(); end end I added this to MissionText: kill_manager = "Kill the hotel manager."; Clues = "It looks like the manager helped him."; Any help would be greatly appreciated Last edited by ryan221b; 08-30-2012 at 10:51 AM. |
|
|