Opening Doors with scripts

Discussion in 'General Modification' started by Mellonril, Dec 3, 2022.

Remove all ads!
  1. Mellonril

    Mellonril Member

    Joined:
    Apr 6, 2008
    Messages:
    13
    Likes Received:
    22
    Hi!
    Is there a way to open a door with scripts?
    (I'm using C08Modpack and Temple+)
    By "open," I mean with the animation included.

    I would like to create a situation where a door in front of the party opens by itself at a particular moment.

    Code:
    obj.portal_flag_set(toee.OPF_OPEN)
    It appears to work only on visibility.The door remains closed, but the party is allowed to see through it.

    Code:
    obj.portal_toggle_open()
    This open or close the portal. It seems to start the opening animation but just for a frame.
    The door remains closed, but the party or npc characters are allowed to pass through it.

    Code:
    obj.portal_flag_unset(toee.OPF_LOCKED)
    Work as intented and I can lock and unlock the door with no issues.
     
    Buffed Rabbit likes this.
  2. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    I've been ruminating on this... I would add a time delay before it happens, say 0.1 seconds, and see if that works.

    EDIT: That is, fire obj.portal_toggle_open() from a delayed script.
     
  3. Mellonril

    Mellonril Member

    Joined:
    Apr 6, 2008
    Messages:
    13
    Likes Received:
    22
    Thanks, Ted. I think I have already tried the timevent method too.
    I wasn't able to find a proper solution, so I decided to change the design and have the rat swarm break down the doors.
    I am using Anatoliy's mods as a learning ground and starting point for a remake of the A Dark Stormy Knight adventure, but I am making some changes to the adventure design to better fit the gameplay.

    Here's a quick video of the latest progress on the first encounter:

     
    Buffed Rabbit likes this.
  4. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
Our Host!