Page 1 of 1

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

Posted: Wed Aug 13, 2014 8:30 pm
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?

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

Posted: Thu Aug 14, 2014 6:59 am
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.

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

Posted: Thu Aug 14, 2014 7:59 am
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);
}