1C Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official 1C Company forum > 1C Publishing > Death to Spies

Death to Spies Stealth action. Professional spy working for the Soviet counterintelligence service executes dangerous operations in the heart of German territory.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-29-2008, 10: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 10:07 AM.
Reply With Quote
  #2  
Old 10-01-2008, 08:47 PM
AHO's Avatar
AHO AHO is offline
Approved Member
 
Join Date: Aug 2008
Location: Germany
Posts: 537
Default

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 08:47 PM. Reason: Corr
Reply With Quote
  #3  
Old 10-04-2008, 10:14 AM
Pizzadvl Pizzadvl is offline
Senior Member
 
Join Date: Mar 2008
Posts: 139
Default

Quote:
Originally Posted by AHO View Post
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...

You can't make new levels can you?
Reply With Quote
  #4  
Old 10-06-2008, 12:26 PM
AHO's Avatar
AHO AHO is offline
Approved Member
 
Join Date: Aug 2008
Location: Germany
Posts: 537
Default

Quote:
Originally Posted by Pizzadvl View Post
You can't make new levels can you?
No, just mission tasks inside a level!
Reply With Quote
  #5  
Old 06-02-2012, 04:01 PM
ryan221b ryan221b is offline
Junior Member
 
Join Date: May 2012
Posts: 4
Default

Quote:
Originally Posted by AHO View Post
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.
I've managed to add the new task to the mission but if I save and load the task gets duplicated every time. I had a look at the OnSave function but didn't know how to modify it. Could someone help me solve this problem?
Reply With Quote
  #6  
Old 06-07-2012, 02:02 PM
OSS OSS is offline
Approved Member
 
Join Date: Oct 2007
Posts: 113
Default

Quote:
Originally Posted by ryan221b View Post
I've managed to add the new task to the mission but if I save and load the task gets duplicated every time. I had a look at the OnSave function but didn't know how to modify it. Could someone help me solve this problem?
In what function did you insert the code to add new tasks?
Reply With Quote
  #7  
Old 06-10-2012, 10:48 PM
AHO's Avatar
AHO AHO is offline
Approved Member
 
Join Date: Aug 2008
Location: Germany
Posts: 537
Default

Quote:
Originally Posted by ryan221b View Post
I've managed to add the new task to the mission but if I save and load the task gets duplicated every time. I had a look at the OnSave function but didn't know how to modify it. Could someone help me solve this problem?
Hi,
could you post your lua code?
Reply With Quote
  #8  
Old 08-15-2012, 10:45 AM
ryan221b ryan221b is offline
Junior Member
 
Join Date: May 2012
Posts: 4
Default

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 09:51 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:19 PM.

Based on a design by: Miner Skinz.com

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 2007 1C Company. All rights reserved.