Question about Mission scripts

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
Bogie
UNATCO
Posts: 201
Joined: Fri Jul 10, 2015 1:23 am
Location: Canada

Question about Mission scripts

Post by Bogie »

Are there any decent tutorials on mission scripts? I can't figure it out for the life of me. I understand that certain flags either spawn or destroy objects in a map, but it just doesn't work for me.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Question about Mission scripts

Post by Cybernetic pig »

I don't believe there is one, but try some extensive google searching.

MissionScript frequently checks specified conditions (e.g how many NSF the player killed, or whether a flag is true/false), and if the condition/s are met it then carries out the desired task (like spawns in some NPC or sets another flag true/false to then be used by missionscript later).
Flags can also be set true/false via triggers in UnrealEd.

If you cannot code you're going to have to learn how if you want to make use of mission scripts. An alternative to mission scripts is a system of triggers and events via UnrealEd, but you are limited in what you can do, most notably you cannot make changes to other maps other than the one the player is on.

Maybe I'll code a mission script trigger/event system for level designers once I finish GMDX, just to keep on point with coding.
User avatar
Bogie
UNATCO
Posts: 201
Joined: Fri Jul 10, 2015 1:23 am
Location: Canada

Re: Question about Mission scripts

Post by Bogie »

Yeah, like a mission script editor, where it would code events as you press buttons (Like ConEDIT).
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Question about Mission scripts

Post by Hanfling »

Well the basic point on missionscripts is to actually do things which would just require a hard to manage trigger and stuff setup as missionscripts do an awful lot of flag checking and a lot of stuff you can't easily do with a trigger and especially that they often share functionality for different maps, which you would otherwise setup for each individual map on the mission. Imho the missionscripts should stay missionscripts, they are perfectly fit for their task. However their current form is not particular great and I did a lot of code cleanup on them for HX, also adding functions for common tasks, which do make missionscripts far easier to read and to write, although I can still continue cleaning it up. I can zip and uploade my HX missionscript code if there if someone is interessted.

But if one would really intend to go to a more abstract way, maybe sth. like kismet would be an option. Maybe this is of some use:
http://www.oldunreal.com/cgi-bin/yabb2/ ... 1434715925

As an example, out of oceanlab script:

Code: Select all

// Deus Ex.
function Timer()
{
	local int count;
	local HowardStrong Howard;
	local BlackHelicopter chopper;
	local MiniSub sub;
	local ScubaDiver diver;
	local GarySavage Gary;
	local WaltonSimons Walton;
	local Actor part;
	local BobPage Bob;

	Super.Timer();

	if (localURL == "14_VANDENBERG_SUB")
	{
		// when the mission is complete, unhide the chopper and Gary Savage,
		// and destroy the minisub and the welding parts
		if (!flags.GetBool('MS_DestroySub'))
		{
			if (flags.GetBool('DL_downloaded_Played'))
			{
				foreach AllActors(class'MiniSub', sub, 'MiniSub2')
					sub.Destroy();

				foreach AllActors(class'Actor', part, 'welding_stuff')
					part.Destroy();

				foreach AllActors(class'BlackHelicopter', chopper, 'BlackHelicopter')
					chopper.EnterWorld();

				foreach AllActors(class'GarySavage', Gary)
					Gary.EnterWorld();

				flags.SetBool('MS_DestroySub', True,, 15);
			}
		}
	}
	else if (localURL == "14_OCEANLAB_LAB")
	{
		// when the mission is complete, unhide the minisub and the diver team
		if (!flags.GetBool('MS_UnhideSub'))
		{
			if (flags.GetBool('DL_downloaded_Played'))
			{
				foreach AllActors(class'WaltonSimons', Walton)
					Walton.EnterWorld();

				foreach AllActors(class'MiniSub', sub, 'MiniSub2')
					sub.EnterWorld();

				foreach AllActors(class'ScubaDiver', diver, 'scubateam')
					diver.EnterWorld();

				flags.SetBool('MS_UnhideSub', True,, 15);
			}
		}
	}
	else if (localURL == "14_OCEANLAB_SILO")
	{
		// when HowardStrong is dead, unhide the helicopter
		if (!flags.GetBool('MS_UnhideHelicopter'))
		{
			count = 0;
			foreach AllActors(class'HowardStrong', Howard)
				count++;

			if (count == 0)
			{
				foreach AllActors(class'BlackHelicopter', chopper, 'BlackHelicopter')
					chopper.EnterWorld();

				Player.StartDataLinkTransmission("DL_Dead");
				flags.SetBool('MS_UnhideHelicopter', True,, 15);
			}
		}
	}
	else if (localURL == "14_OCEANLAB_UC")
	{
		// when a flag is set, unhide Bob Page
		if (!flags.GetBool('MS_UnhideBobPage') &&
			flags.GetBool('schematic_downloaded'))
		{
			foreach AllActors(class'BobPage', Bob)
				Bob.EnterWorld();

			flags.SetBool('MS_UnhideBobPage', True,, 15);
		}

		// when a flag is set, hide Bob Page
		if (!flags.GetBool('MS_HideBobPage') &&
			flags.GetBool('PageTaunt_Played'))
		{
			foreach AllActors(class'BobPage', Bob)
				Bob.LeaveWorld();

			flags.SetBool('MS_HideBobPage', True,, 15);
		}
	}
}

Code: Select all

// HX.
function Timer()
{
	Super.Timer();

	//
	// 14_VANDENBERG_SUB
	//
	if ( LocalURL=="14_VANDENBERG_SUB" )
	{
		// When the mission is complete, unhide the chopper and Gary Savage and destroy the minisub and the welding parts.
		if ( !GetBoolFlag('MS_DestroySub') && GetBoolFlag('DL_downloaded_Played') )
		{
			DestroyActors( MiniSubClass, 'MiniSub2' );
			DestroyActors( Class'Actor', 'welding_stuff' );
			
			DecorationsEnterWorld( BlackHelicopterClass, 'BlackHelicopter' );
			PawnsEnterWorld( GarySavageClass );

			SetBoolFlag( 'MS_DestroySub', True, True, 15 );
		}
	}

	//
	// 14_OCEANLAB_LAB
	//
	else if ( LocalURL=="14_OCEANLAB_LAB" )
	{
		// When the mission is complete, unhide the minisub and the diver team.
		if ( !GetBoolFlag('MS_UnhideSub') && GetBoolFlag('DL_downloaded_Played') )
		{
			DecorationsEnterWorld( MiniSubClass, 'MiniSub2' );
			PawnsEnterWorld( WaltonSimonsClass );
			PawnsEnterWorld( ScubaDiverClass, 'scubateam' );

			SetBoolFlag( 'MS_UnhideSub', True, True, 15 );
		}
	}

	//
	// 14_OCEANLAB_SILO
	//
	else if ( LocalURL=="14_OCEANLAB_SILO" )
	{
		// When HowardStrong is dead, unhide the helicopter.
		if ( !GetBoolFlag('MS_UnhideHelicopter') )
		{
			if ( !PawnsExist(HowardStrongClass) )
			{
				DecorationsEnterWorld( BlackHelicopterClass, 'BlackHelicopter' );
				StartDataLinkTransmission( "DL_Dead" );

				SetBoolFlag( 'MS_UnhideHelicopter', True, True, 15 );
			}
		}
	}

	//
	// 14_OCEANLAB_UC
	//
	else if ( LocalURL=="14_OCEANLAB_UC" )
	{
		// When a flag is set, unhide Bob Page.
		if ( !GetBoolFlag('MS_UnhideBobPage') && GetBoolFlag('schematic_downloaded') )
		{
			PawnsEnterWorld( BobPageClass );
			SetBoolFlag( 'MS_UnhideBobPage', True, True, 15 );
		}

		// When a flag is set, hide Bob Page.
		if ( !GetBoolFlag('MS_HideBobPage') && GetBoolFlag('PageTaunt_Played') )
		{
			PawnsLeaveWorld( BobPageClass );
			SetBoolFlag( 'MS_HideBobPage', True, True, 15 );
		}
	}
}
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Post Reply