Moving, Removing, or Delaying NPCs From Appearing In-Game

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
CorinthMaxwell
NSF
Posts: 79
Joined: Sat Oct 04, 2008 1:28 am

Moving, Removing, or Delaying NPCs From Appearing In-Game

Post by CorinthMaxwell »

For as long as I can remember, I've had a bit of an issue with the UNATCO troops that appear in the "shanty town" of Battery Park and outside of the 'Ton Hotel in Hell's Kitchen during the second mission. Their efforts to neutralize the NSF forces in these areas come into conflict with JC's attempts to use non-lethal force against them, and because of the way the game is designed, he always gets penalized for it by Sam Carter afterwards, even if he wasn't the one responsible for their deaths.

What I'm asking is, is there a way to move their starting positions elsewhere, remove them from the map entirely, or make them appear after all related and/or relevant objectives have been completed?
Robin: "Holy flying snotburgers, Batman!"
Batman: o_0 O_0 o.0 O.0
ggrotz
X-51
Posts: 780
Joined: Tue Nov 10, 2009 12:55 am

Re: Moving, Removing, or Delaying NPCs From Appearing In-Gam

Post by ggrotz »

CorinthMaxwell wrote:For as long as I can remember, I've had a bit of an issue with the UNATCO troops that appear in the "shanty town" of Battery Park and outside of the 'Ton Hotel in Hell's Kitchen during the second mission. Their efforts to neutralize the NSF forces in these areas come into conflict with JC's attempts to use non-lethal force against them, and because of the way the game is designed, he always gets penalized for it by Sam Carter afterwards, even if he wasn't the one responsible for their deaths.
Both really have storyline implications, chief of which is the teaching of lethal force to the UNATCO troops. The Ton Hotel more so, as it shows you how they are, wherein the only reward you'll get is their admiration if you kill a majority of them.

Battery Park is one where you get shown this and can determine the outcome. The answer is to go in the back way, because if you go in the front they'll assume you want their help. Go in the back way, and you'll get praised by Carter and chewed out by Navarre.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Moving, Removing, or Delaying NPCs From Appearing In-Gam

Post by Hanfling »

Write a Mutator. Or write Write a MissionScript and make the Mutator replace the MissionScript with your Custom Script.

Some snippet (about 1500 lines skipped), you might find helpful:

Code: Select all

//=============================================================================
// HXMutator.
//=============================================================================
class HXMutator extends Mutator
	native
	noexport;

// [..]

// ----------------------------------------------------------------------
// CheckReplacement()
// ----------------------------------------------------------------------

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	// [..]

	// Info
	else if ( Other.isA('Info') )
	{
		// DeusExLevelInfo
		if ( Other.isA('DeusExLevelInfo') )
		{
			SetupDeusExLevelInfo( DeusExLevelInfo( Other ) );
			return true;
		}
	}
	// [..]

	return true;
}

function SetupDeusExLevelInfo( DeusExLevelInfo LevelInfo )
{
	local class<MissionScript> Scr;

	// no missionscript, e.g. in DX.dx
	if ( LevelInfo.Script == None )
		return;

	if ( !ClassIsChildOf( LevelInfo.Script, class'HXMissionScript') )
	{
		Scr = class<MissionScript>( HXify( LevelInfo.Script ) );

		if ( Scr != none )
			LevelInfo.Script = Scr;
		else
			Log( "Failed to replace MissionScript " $ LevelInfo.Script );
	}
}

static function class<Actor> HXify(class<Actor> InClass)
{
	local string ClassName;

	if ( InClass == none )
		return none;

	ClassName = "HX.HX" $ StripPackage(InClass $ "");
	return class<Actor>(DynamicLoadObject(ClassName, class'Class'));
}

static function string StripPackage(string s)
{
	local int p;
	
	p = InStr(s, ".");

	if (p == -1)
		return s;

	return Right(s, Len(s) - p - 1);
}
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Post Reply