[Ikarus] Automatically Locking/Unlocking Doors 2061 1

O temacie

Autor Vic7im

Zaczęty 5.12.2015 roku

Wyświetleń 2061

Odpowiedzi 1

Vic7im

Vic7im

Użytkownicy
posty84
Propsy92
Profesjabrak
  • Użytkownicy
Hello there, good morning!

I'm trying to make a script where at night all doors automatically close and become locked, then in the morning they unlock and can be opened by NPCs, BUT after they're opened a small timer is set and after that they close again (not locking this time).

I wrote a code for one door and it works except for one thing. The door doesn't change "position" (open/closed), even though its state is changed.

Code:
func void DOORS_Loop()
{
     var int BDoor_ptr; BDoor_ptr = MEM_SearchVobByName("TESTDOOR");
     var oCMobDoor BDoor; BDoor = _^(BDoor_ptr);

if(Wld_IsTime(20,00,8,00))
{
BDoor._oCMobInter_rewind = 0;
BDoor._oCMobLockable_bitfield = true;
BDoor._oCMobInter_state = 0;
BDoor._oCMobInter_state_num = 0;
BDoor._oCMobLockable_pickLockStr = "LRRLLRLLRL";
}
else if(Wld_IsTime(8,01,19,59))
{
BDoor._oCMobLockable_bitfield = false;
BDoor._oCMobInter_state_num = 1;
};
if(Wld_GetMobState (hero, "TESTDOOR") == 1)
{
FF_ApplyOnceExt(CloseDoors,10000,1);
};
};

func void CloseDoors()
{
     var int BDoor_ptr; BDoor_ptr = MEM_SearchVobByName("TESTDOOR");
     var oCMobDoor BDoor; BDoor = _^(BDoor_ptr);
BDoor._oCMobInter_state_num = 0;
BDoor._oCMobInter_state = 0;
};

As I said, it works, the only exception is that if I open a door, it stays open, it doesn't close automatically =(
 

kaczka

kaczka

RaveN Studio
Definitely not kaczka!
posty2280
Propsy2392
NagrodyV
ProfesjaLvl designer
  • RaveN Studio
  • Definitely not kaczka!
Did you try to add for door object window in spacer func doors_loop? Maybe it works?
 


0 użytkowników i 1 Gość przegląda ten wątek.
0 użytkowników
Do góry