(Paul in Tong's base) How do I make NPCs become relevant?

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
Neveos
X-51
Posts: 875
Joined: Wed Mar 03, 2010 1:29 am

(Paul in Tong's base) How do I make NPCs become relevant?

Post by Neveos »

So I want to know if there is a way to have an NPC either disappear from a map via a trigger or appear via a trigger, and I've been analyzing Paul Denton's properties at Tong's base, but can't figure it out.

-edit- ok I'm digging around to figure this out and it has to do with the bInWorld property. But I am unfamiliar with unreal script. So could someone show me how to write up a very simple piece of script which checks for a flag to be true in the beginning of the map, and sets bInWorld to either false or true?

-edit- lol, I'm laughing thinking of how I could use movers to slam the NPCs into teleporters. (this didnt work)

-edit- DDL created a trigger for me that you can save as a .uc file:


Sure thing!

Setting bInworld=false means that at startup the pawn turns its collision to "off" for all settings, makes itself invisible and then hides itself 20000 uunits below its curret position. You probably grasped that, though.

Calling the function enterworld(); makes pawns switch between the states, either appearing or disappearing: it toggles the bool and also makes them jump up, start colliding (according to their initial collision settings, so bob page's hologram, which starts as non-colliding, jumps up and is STILL non colliding), and otherwise behave normally.

But, currently (i.e. given DX's existing build state) there are no triggers that actually call this function, which is..idiocy on the part of the devs, really.

Thus: either you make and compile one, or you script it. Now I could give you a long terrible discussion about the joys of missionscripts (there was one on DXE, but that died) or I could just post up code for a trigger. Latter sounds good?


Code: Select all

class PawnAppearTrigger extends Trigger;

enum EEntryType
{
   ENT_Enter,
   ENT_Leave,
   ENT_Toggle

};

var() EEntryType Appear;



function Touch(Actor Other)
{
local ScriptedPawn P;


    foreach AllActors(Class'ScriptedPawn',P, event)
       {
       if(Appear == ENT_Enter)
                 P.EnterWorld();
        else if(Appear == ENT_Leave)
             P.LeaveWorld();
        else
            {
            if(!P.bInWorld)
               P.EnterWorld();
            else
                P.LeaveWorld();
            }

       }

}

function Trigger(Actor other,Pawn instigator)
{
local ScriptedPawn P;


    foreach AllActors(Class'ScriptedPawn',P, event)
       {
       if(Appear == ENT_Enter)
                 P.EnterWorld();
        else if(Appear == ENT_Leave)
             P.LeaveWorld();
        else
            {
            if(!P.bInWorld)
               P.EnterWorld();
            else
                P.LeaveWorld();
            }

       }

}


defaultproperties
{
Appear=ENT_Toggle
}



So this'll find any pawns that match its event field, and either force entry, exit, or toggle of enterworld().
What I do in my other free time:
http://www.youtube.com/watch?v=e3FfPUKuGsQ
Post Reply