Author Topic: Actions on door/placeables slowed a lot  (Read 1476 times)

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #15 on: January 13, 2012, 08:58:13 pm »


               

Failed.Bard wrote...

 Do doors have action queues?  Has anyone tried a ClearAllActions call first to see if that affects this issue, it's a bit of a longshot but likely worth trying.

they have but their action queve is clean, clear actions was my first thought too, unfortunately no effect
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #16 on: January 14, 2012, 01:14:51 pm »


                 If the issue may be that it's an action, skip the ActionCloseDoor entirely.  I just tested this with a door, and it worked, at least in my test right at 10 seconds.  For dual placeable/door use you'd need an object check assigning the proper placeable or door animation before running it, but that's simple enough.

void main()
{
 DelayCommand (10.0, PlayAnimation (ANIMATION_DOOR_CLOSE));
 DelayCommand (10.0, SetLocked (OBJECT_SELF, TRUE));
}
               
               

               
            

Legacy_wyldhunt1

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #17 on: January 14, 2012, 05:05:00 pm »


               I'm not sure if that'll help with the rest of the placeables and traps though.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #18 on: January 15, 2012, 03:54:23 am »


               

Failed.Bard wrote...

  If the issue may be that it's an action, skip the ActionCloseDoor entirely.  I just tested this with a door, and it worked, at least in my test right at 10 seconds.  For dual placeable/door use you'd need an object check assigning the proper placeable or door animation before running it, but that's simple enough.

void main()
{
 DelayCommand (10.0, PlayAnimation (ANIMATION_DOOR_CLOSE));
 DelayCommand (10.0, SetLocked (OBJECT_SELF, TRUE));
}

perfect, I havent realized there is different way how to open or close doors

since this solution doesnt need anything it is very suitaible for the door issue, though its not a fix but a workaround

still need something for projectile traps
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #19 on: January 15, 2012, 12:07:00 pm »


               

ShaDoOoW wrote...

Failed.Bard wrote...

  If the issue may be that it's an action, skip the ActionCloseDoor entirely.  I just tested this with a door, and it worked, at least in my test right at 10 seconds.  For dual placeable/door use you'd need an object check assigning the proper placeable or door animation before running it, but that's simple enough.

void main()
{
 DelayCommand (10.0, PlayAnimation (ANIMATION_DOOR_CLOSE));
 DelayCommand (10.0, SetLocked (OBJECT_SELF, TRUE));
}

perfect, I havent realized there is different way how to open or close doors

since this solution doesnt need anything it is very suitaible for the door issue, though its not a fix but a workaround

still need something for projectile traps

  I didn't know you could either, I had to look at the animations constants to even see if it'd work with PlayAnimation since I didn't know if door and placeable animations could work with the standard call.
  I'd actually been planning to test out how well DoDoorAction and DoPlaceableObjectAction worked in comparison to ActionCloseDoor, but wanted a non-action based alternative to those to try as well.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #20 on: February 09, 2012, 11:52:12 am »


               Update:

I found wrong behavior of the "PlayAnimation (ANIMATION_DOOR_CLOSE)" method of closing doors. This method does not fire OnClosed event and does not automatically close connected doors.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #21 on: February 09, 2012, 12:41:18 pm »


                Yes, you have to close both doors. Here's a snippet from my code that doesn't allow possessed familiars to open doors.

object oDoor     = OBJECT_SELF;
object oDest     = GetTransitionTarget(oDoor);

PlayAnimation(ANIMATION_DOOR_CLOSE);
if(GetObjectType(oDest)==OBJECT_TYPE_DOOR)
{
    AssignCommand(oDest, PlayAnimation(ANIMATION_DOOR_CLOSE));
}

               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Actions on door/placeables slowed a lot
« Reply #22 on: February 09, 2012, 02:31:50 pm »


               

ShaDoOoW wrote...

Update:

I found wrong behavior of the "PlayAnimation (ANIMATION_DOOR_CLOSE)" method of closing doors. This method does not fire OnClosed event and does not automatically close connected doors.


  I don't think there's a non-nwnx method of checking what scripts an object has, but if you're always using the same named OnClosed script with the OnOpen one, you can just execute it manually.  Otherwise, it'd be a messy work-around needed involving storing the OnClosed event script name as a variable on the door.