Author Topic: Ducking the issue  (Read 358 times)

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Ducking the issue
« on: February 04, 2012, 06:12:56 pm »


                <jumping...>

The Deal: I am trying to improve Pen's Duck Duck Duck trap. What she gave me works, but... *big* but. <careful, boss!> Er, I mean to say, *I* have issues with it. She set it up so that there are three triggers with associated waypoints running  down a corridor. When a PC enters a trigger, it (among other things) spawns a placeable, delays 4 seconds and destroys the placeable.

It's actually a pretty clever idea. The placeable is an "Action Icon™":
'Image
That exists just to give the PC a chance to duck... something. And it works.

The issue: action_duck is a *huge* model! Spawning it in causes about a 3/4 second stutter on my laptop. Each time. So I decided (with permission) to try a different approach. I created a hidden room off to the side. Put in WP_DUCK0 and placed an action_duck there waiting. Then I changed the trigger scripts so they would jump action_duck from WP_DUCK0 to WP_DUCK1 (or 2 or 3, depending), wait 4 seconds and jump it back into hiding.

Doesn't work.

action_duck never shows up. Rest of trigger script (that "activates" the trap model for a 3 second anim) doesn't fire. It did before and I did not change that part.

Trig_duck1

void main(){
  // on_Enter tr_duck1
  // Get entering object
  object oPC = GetEnteringObject();
  object oWP0 = GetObjectByTag("WP_DUCK0");
  object oWP1 = GetObjectByTag("WP_DUCK1");
  object oAct_Duck = GetObjectByTag("action_duck");
  location lLoc = GetLocation(oWP1);
  object oDuckTrap =(GetObjectByTag("PLC_DUCKTRAP"));

  // Check if PC
  if (GetIsPC(oPC))  {
     // Stop PC
     AssignCommand(oPC,ClearAllActions());

     // Move action_duck to WP_DUCK1
     AssignCommand(oAct_Duck,JumpToLocation(lLoc));

     // Move action_duck back after 4 seconds
     lLoc = GetLocation(oWP0);
     DelayCommand(4.0f,AssignCommand(oAct_Duck,JumpToLocation(lLoc)));

     // DelayCommand 4seconds Activate plc_ducktrap
     DelayCommand(4.0f,AssignCommand(oDuckTrap, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)));

     // destroy trigger (self)
     DestroyObject (OBJECT_SELF, 6.0f);
  }
}

Ideas?


<...from topic to topic>
               
               

               


                     Modifié par Rolo Kipp, 04 février 2012 - 06:16 .
                     
                  


            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Ducking the issue
« Reply #1 on: February 04, 2012, 07:24:12 pm »


               I've did not know placeables could do a JumpToLocation.  As far as I know you can only really create them in a specific location and/or destroy them (giving the illusion of movement).

The placeable could be modified to add on/off animations, with the off state far below the ground level, and on in the normal position.  The script could turn the placeables on, delay 4 seconds, and turn them off.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Ducking the issue
« Reply #2 on: February 04, 2012, 07:37:32 pm »


               <looks quite...>

Well. That certainly explains what's happening :-/
Guess I live with the clunky feeling until she adds anims to the things.

Edit: Sad thing is, I knew this from when I was trying to get ships moving... *sigh* Too many things going at once.

<...disgruntled>
               
               

               


                     Modifié par Rolo Kipp, 04 février 2012 - 07:41 .
                     
                  


            

Legacy_Vibrant Penumbra

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Ducking the issue
« Reply #3 on: February 04, 2012, 07:53:13 pm »


                <Looks a little nervous...>

That's easy!
Anims coming up, candyman. Be in your dropbox by morning '<img'>

And I do not have a big but! :ph34r:Watch it, fella.

<...to be in scripting territory>