Перейти к содержимому

Фотография

illusionarly rug/pit trap


  • Пожалуйста, авторизуйтесь, чтобы ответить
8 ответов в этой теме

#1
Arianna0

Arianna0
  • Members
  • 20 сообщений

so   I scavenged a pit trap script   from  our  mod  hoping to  replicate  the Dungeon standard of the illusionary  floor/rug  

 

 

It works decently   as is  . . BUT   if you make your save you just walk on across the illusion  [ the area is really  too far to have reflexively jumped it   ]

 

is there some way to make is so that if  the save is  failed it pulls you back to a specific  WP at the edge of the  pit  ?

void main()
{
effect eDam;
object oPitvictim = GetEnteringObject(); //That's the PC who might fall
location lLoc = GetLocation(oPitvictim); //The initial place of the falling PC
object oWay = GetNearestObjectByTag("DST_RUGPIT"); //That's where he is going to land
effect eRock = EffectVisualEffect(137);
effect eDust = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION);

if(GetIsPC(oPitvictim) == TRUE) {


AssignCommand (oPitvictim, PlaySound("as_na_rockfalsm4"));
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, eRock, lLoc, 4.0 );
int rSave = ReflexSave(oPitvictim, 22, SAVING_THROW_TYPE_TRAP, OBJECT_SELF);

if (rSave==0)

    {
    AssignCommand(oPitvictim, ActionJumpToLocation(GetLocation(oWay)));
    FloatingTextStringOnCreature("The rug was an illusion and you've fallen into a pit!", oPitvictim, FALSE);
    PlayVoiceChat(13 + d3(), oPitvictim);
    eDam = EffectDamage(d6(2), DAMAGE_TYPE_BLUDGEONING); //The damage roll
    DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oPitvictim));

    ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), oPitvictim);
    AssignCommand(oPitvictim, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 10.0));
//      AssignCommand(oPitvictim, SetCommandable(0));
//      DelayCommand(10.0, SetCommandable(1, oPitvictim));
    FloatingTextStringOnCreature("ouch...", oPitvictim, FALSE);
    ApplyEffectToObject(DURATION_TYPE_INSTANT,eDust,oPitvictim);
    AssignCommand (oPitvictim, PlaySound("as_na_rockfalsm4"));
    DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), oPitvictim));
    DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_INSTANT,eDust,oPitvictim));
    DelayCommand(2.0, AssignCommand (oPitvictim, PlaySound("as_na_rockfalsm1")));
    }

else
    {
    FloatingTextStringOnCreature("You've managed to avoid falling into a pit!", oPitvictim, FALSE);
   DelayCommand(2.0, PlayVoiceChat(VOICE_CHAT_CUSS, oPitvictim));
    }
    }

This is the script I am working with  works  as is.. and is great for hazardous terrain  but not as well as I would like for the pit trap .

 

Any suggestions?



#2
kevL

kevL
  • Members
  • 4 052 сообщений
I'm tinkering with the script and a few questions come up:

1. is there an actual pit in the area, that PC falls into
2. Do you want PC to save vs. the illusory rug first, then save vs. Reflex (or just the first, or just the second)
3. since this isn't a rockslide, do you really want all that screenshake + rocks and dust and soundFX ?

#3
Arianna0

Arianna0
  • Members
  • 20 сообщений

I'm tinkering with the script and a few questions come up:

1. is there an actual pit in the area, that PC falls into
2. Do you want PC to save vs. the illusory rug first, then save vs. Reflex (or just the first, or just the second)
3. since this isn't a rockslide, do you really want all that screenshake + rocks and dust and soundFX ?

Yes there is a pit  - I have the  pit to the side of the area where the "rug" is  so  the  DST_  tag for where they fall into is important .

Basically I have a large room with  a rug to either side of a visual pit  the safe path is over a invisible bridge  across the visible pit while the rugs are suppose to be illusions that one will fall through.

saving vs the illusion would be ideal   and then the reflex if they  fail the  other save with ideally the successful Reflex save putting them back on the  start side of the pit .

and no the  rockslide  FX stuff is certainly not needed  but every time I tried to remove it    my script would not compile



#4
kevL

kevL
  • Members
  • 4 052 сообщений
ok, so ... after the PC lands at "DST_RUGPIT" when do you want him/her warped back to the start position?

After 10 seconds of writhing in the pit ?




that is, what can the PC do if they land in the pit, can they walk out, or where should they warp to?

#5
Arianna0

Arianna0
  • Members
  • 20 сообщений

once the  PCs land in the pit I already have  a  separate way for them to exit the pit  that does not need to be included in this script

 

 

I just want the PCs  moved to a  separate  WP  when they  make their Reflex save to NOT fall in the pit  rather then  be able to continue across the pit  which is what happens now 



#6
kevL

kevL
  • Members
  • 4 052 сообщений
ok, I want to run a few tests but CPU is very busy atm ...

#7
kevL

kevL
  • Members
  • 4 052 сообщений
well ... that took a few cigarettes.

place another waypoint w/ tag "DST_RUGPIT_START" where the PC should warp to if either save is successful,
// 'ari_pitfall'

#include "nw_i0_spells"

void play(object oPC, string sAnimation);
void finish(object oPC);
void saved(object oPC, string sWarning);

//
void main()
{
    object oPC = GetEnteringObject();

    if (GetIsPC(oPC))
    {
        // Show spell-resistance icon if PC's immunity is triggered:
        if (!MySavingThrow(SAVING_THROW_WILL, oPC, 22, SAVING_THROW_TYPE_MIND_SPELLS))
        {
            // Do not show resistance icon:
            if (!ReflexSave(oPC, 22, SAVING_THROW_TYPE_TRAP))
            {
                // Note that several of these AssignCommands() are required to maintain an unhindered sequence.
                AssignCommand(oPC, ClearAllActions());

                object oWp = GetNearestObjectByTag("DST_RUGPIT");
                AssignCommand(oPC, JumpToObject(oWp));

                AssignCommand(oPC, SpeakString("The rug is an illusion and you've fallen into a pit!"));
                AssignCommand(oPC, DelayCommand(2.9, SpeakString("ouch...")));

                AssignCommand(oPC, PlaySound("as_na_rockfalsm4")); // should change this to a "thud"

                effect eBludgeon = EffectDamage(d6(2), DAMAGE_TYPE_BLUDGEONING);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eBludgeon, oPC);

                effect eDust = EffectNWN2SpecialEffectFile("fx_wooden_explosion");
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eDust, oPC);

                AssignCommand(oPC, play(oPC, "pronedamageB"));

                int iVoice = Random(3);
                switch (iVoice)
                {
                    case 0: iVoice = VOICE_CHAT_PAIN1; break;
                    case 1: iVoice = VOICE_CHAT_PAIN2; break;
                    case 2: iVoice = VOICE_CHAT_PAIN3;
                }
                AssignCommand(oPC, DelayCommand(0.23, PlayVoiceChat(iVoice, oPC)));
                // The voice-chat won't play if its delay is too short; likely a conflict with PlaySound() above.

                DelayCommand(7.6, finish(oPC));
                AssignCommand(oPC, SetCommandable(FALSE, oPC));
            }
            else // saved vs Reflex!
            {
                saved(oPC, "The rug conceals a pit.");
            }
        }
        else // saved vs Mind Spells!
        {
            saved(oPC, "The rug is an illusion.");
        }
    }
}

//
void play(object oPC, string sAnimation)
{
    PlayCustomAnimation(oPC, sAnimation, TRUE);
}

//
void finish(object oPC)
{
    SetCommandable(TRUE, oPC);
    PlayCustomAnimation(oPC, "%", TRUE); // idle
}

//
void saved(object oPC, string sWarning)
{
    AssignCommand(oPC, ClearAllActions());

    AssignCommand(oPC, SpeakString(sWarning));
    AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_CUSS, oPC));

    object oWp = GetNearestObjectByTag("DST_RUGPIT_START");
    AssignCommand(oPC, JumpToObject(oWp));
}


#8
Arianna0

Arianna0
  • Members
  • 20 сообщений

Awesome !!!  Thank you this works  wonderfully



#9
kevL

kevL
  • Members
  • 4 052 сообщений
sweet, i can imagine it looks better than my test-area
  • Это нравится: Sabranic