Doors

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 098.

Moderator: POL Developer

Post Reply
Basara
Novice Poster
Posts: 47
Joined: Fri Oct 13, 2006 6:37 am
Location: UK

Doors

Post by Basara » Fri Apr 09, 2010 2:42 am

Just had a search through the forums and couldn't find anything on this, I've got an old door package and for some reason when i try and use the half size doors, ie stable doors, low fence doors) theyre fine when shut but then display a totally wrong opened door graphic, usually appearing 2 tiles away.

Now I;ve looked at the distro door package and see its totally different to what I'm using but both use XMod and YMod props in itemdesc, is it something to do with those which is making them go crazy?

User avatar
CWO
POL Expert
Posts: 1148
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Doors

Post by CWO » Fri Apr 09, 2010 10:18 pm

If other doors are working fine, it may be the xmod/ymod. Post the itemdesc.cfg entries and I'll give them a look.

Basara
Novice Poster
Posts: 47
Joined: Fri Oct 13, 2006 6:37 am
Location: UK

Re: Doors

Post by Basara » Sat Apr 10, 2010 6:50 am

0x06af is a fullsize door that works fine
0x0870 is the half size version, the itemdesc entries are the same x/y as above but it goes crazy

Code: Select all

//
// Doors
//

// Metal Doors //

Door 0x0675
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06D4
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0677
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x067d
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x067f
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x06c5
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06c7
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06D2
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0679
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x06D0
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06CE
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06CB
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x067B
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06C9
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x067E
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0680
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0682
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0684
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06D1
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06C6
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06C8
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x06CA
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x06CC
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0683
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0681
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x067C
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x067A
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x06D3
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0678
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0676
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

// Barred metal doors //

Door 0x0685
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0687
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x068d
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x068f
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0692
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0690
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0694
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x068E
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0689
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FED
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FEF
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF1
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF3
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF6
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FFC
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF8
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x1FFA
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x068B
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}


Door 0x0691
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0688
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x068C
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x068A
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0693
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0686
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}


Door 0x1FEE
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF0
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF2
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF4
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}
Door 0x1FF5
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF7
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x1FF9
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x1FFB
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

// Wooden Doors //

Door 0x06a5
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06a7
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06ad
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06af
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06b5
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06b7
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06bd
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06bf
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06C0
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06AE
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06C4
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06C2
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06BE
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06A9
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06B0
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06B4
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06B2
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06BB
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06AB
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06B1
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06B3
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06B6
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06B8
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06BA
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06BC
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06AC
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06A8
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06AA
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06C1
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06C3
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06A6
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

//Light Wooden Doors//


Door 0x06d5
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06d7
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06dd
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06df
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06E4
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06DE
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06E2
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06E0
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06D9
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06DB
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06DA
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06DC
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06D6
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06D8
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06E1
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06E3
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

//Reinforced Wooden Doors//


Door 0x06e5
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06e7
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06ed
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06F0
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06F3
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06EF
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06F1
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06E9
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06EB
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06EA
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06E8
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06F2
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06E6
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

//Rattan Doors//


Door 0x0695
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x0697
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x069d
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x069f
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x06A4
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06A0
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x069E
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06A2
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x069B
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x069C
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x069A
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x06A3
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0696
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

//Tall Metal Gates//

Door 0x0828
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0824
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0825
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0826
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0827
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0829
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0831
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0833
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x082A
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0832
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0830
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x082F
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x082E
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x082D
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x082C
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x082B
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

//Short Metal Gates//


Door 0x084C
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0859
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x084D
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x084E
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x084F
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0850
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0852
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0854
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0855
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0856
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0858
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x085A
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x0853
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0851
{
    xmod +1
    ymod +1
    script door
    doortype metal
    lockable 1
}

Door 0x085B
{
    xmod +1
    ymod -1
    script door
    doortype metal
    lockable 1
}

Door 0x0857
{
    xmod -1
    ymod +1
    script door
    doortype metal
    lockable 1
}

//Dark Wooden Gates//


Door 0x0866
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0867
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0868
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0869
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x086A
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x086B
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x086C
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x086D
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x086E
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x086F
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0870
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0871
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x0872
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0873
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x0874
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0875
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

//Light Wooden Gates//


Door 0x0839
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x083A
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x083B
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x083C
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x083D
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x083E
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x083F
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0840
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x0841
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0842
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x0843
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0844
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x0845
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0846
{
    xmod +1
    ymod +1
    script door
    doortype wood
    lockable 1
}

Door 0x0847
{
    xmod +1
    ymod -1
    script door
    doortype wood
    lockable 1
}

Door 0x0848
{
    xmod -1
    ymod +1
    script door
    doortype wood
    lockable 1
}

User avatar
CWO
POL Expert
Posts: 1148
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Doors

Post by CWO » Sat Apr 10, 2010 9:51 pm

Hmm, its the same itemdesc entry as on my shard and it seems to work fine. Could you post the script here or in PM to me so I can have a look at if the script is the culprit?

Basara
Novice Poster
Posts: 47
Joined: Fri Oct 13, 2006 6:37 am
Location: UK

Re: Doors

Post by Basara » Sun Apr 11, 2010 2:37 am

Code: Select all

use polsys;
use os;
use basicio;
use uo;
use cfgfile;

/////////////////////////////////////////////////////////////////////////////
//
//  door.src - door doubleclick script, opens / closes doors
//           - autocloses still-open doors after 10 seconds
//           - plays open/close sounds
//
//  TODO: paired doors (double doors etc)
//
/////////////////////////////////////////////////////////////////////////////


include "include/client";

program use_door( chr, door )
     
     
     var itemdesc := ReadConfigFile( "itemdesc" );
     
     var closesound;
     var opensound;
     case (itemdesc[door.objtype].doortype)
          default:
          "wood":
               opensound := SFX_OPEN_WOODEN_DOOR;
               closesound := SFX_CLOSE_WOODEN_DOOR;
               
          "metal":
               opensound := SFX_OPEN_METAL_DOOR;
               closesound := SFX_CLOSE_METAL_DOOR;
		 endcase

		if (door.locked)
     	PrintTextAbovePrivate( door, "That is locked.", chr );
    else
     Detach();
     set_critical(1);
     var whenopened := ReadGameClock();
     if (door.isopen)
          PlaySoundEffect( door, closesound );
          door.close();
          EraseObjProperty( door, "#WhenOpened" );
     else
          SetObjProperty( door, "#WhenOpened", whenopened );
          PlaySoundEffect( door, opensound );
          door.open();
          sleep( 10 );
          if (GetObjProperty( door, "#WhenOpened" ) == whenopened)
               PlaySoundEffect( door, closesound );
               door.close();
               EraseObjProperty( door, "#WhenOpened" );
          endif
     endif
endif
endprogram

User avatar
CWO
POL Expert
Posts: 1148
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Doors

Post by CWO » Mon Apr 12, 2010 4:07 am

hmm.. try this

Code: Select all

include "include/client";

program use_door( chr, door )
     
     
     var itemdesc := ReadConfigFile( "itemdesc" );
     
     var closesound;
     var opensound;
     case (itemdesc[door.objtype].doortype)
          default:
          "wood":
               opensound := SFX_OPEN_WOODEN_DOOR;
               closesound := SFX_CLOSE_WOODEN_DOOR;
               
          "metal":
               opensound := SFX_OPEN_METAL_DOOR;
               closesound := SFX_CLOSE_METAL_DOOR;
       endcase

      if (door.locked)
        PrintTextAbovePrivate( door, "That is locked.", chr );
    else
     Detach();
     set_critical(1);
     var whenopened := ReadGameClock();
     if (door.isopen)
          PlaySoundEffect( door, closesound );
          door.graphic -= 1;
          door.movable := 1;
          MoveObjectToLocation(door, (door.x - CInt(itemdesc[door.objtype].xmod)), (door.y - CInt(itemdesc[door.objtype].ymod)), door.z, door.realm, MOVEOBJECT_FORCELOCATION);
          door.movable := 0;
          EraseObjProperty( door, "#WhenOpened" );
     else
          SetObjProperty( door, "#WhenOpened", whenopened );
          PlaySoundEffect( door, opensound );
          door.graphic += 1;
	  door.movable := 1;
	  MoveObjectToLocation(door, (door.x + CInt(itemdesc[door.objtype].xmod)), (door.y + CInt(itemdesc[door.objtype].ymod)), door.z, door.realm, MOVEOBJECT_FORCELOCATION);
	door.movable := 0;
          sleep( 10 );
          if (GetObjProperty( door, "#WhenOpened" ) == whenopened)
               PlaySoundEffect( door, closesound );
               door.graphic -= 1;
               door.movable := 1;
               MoveObjectToLocation(door, (door.x - CInt(itemdesc[door.objtype].xmod)), (door.y - CInt(itemdesc[door.objtype].ymod)), door.z, door.realm, MOVEOBJECT_FORCELOCATION);
               door.movable := 0;
               EraseObjProperty( door, "#WhenOpened" );
          endif
     endif
endif
endprogram

I basically just took your old code and replaced the door.open() and door.close() 4 lines of code doing it manually. This is how its done on my shard and I haven't seen problems with doors including testing with the door that you were having problems with.

Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am
Location: Livorno, Italy
Contact:

Re: Doors

Post by Gnafu » Mon Apr 12, 2010 3:58 pm

With pol 098 you can add MOVEITEM_IGNOREMOVABLE flag in MoveObjectToLocation() to avoid door.movable:=1 and door.movable:=0 steps.

Basara
Novice Poster
Posts: 47
Joined: Fri Oct 13, 2006 6:37 am
Location: UK

Re: Doors

Post by Basara » Tue Apr 13, 2010 1:23 pm

Ok, i just tested it and i makes the doors actually move (as in, coordinates):

1: Door closed
2: Door when opened......
3: Door when dbl clicked again to close.....

Image

It carries on moving up and across each time you use it and the door never auto closes after 10 secs.
Somethings not right there....lol
Last edited by Basara on Tue Apr 13, 2010 1:38 pm, edited 1 time in total.

Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am
Location: Livorno, Italy
Contact:

Re: Doors

Post by Gnafu » Tue Apr 13, 2010 1:38 pm

If you don't use door.open() and door.close() the door.isopen never changes, so you need to check the door status in another way.

Edit: In your images the door doesn't change graphic, does it? If not, the "door.graphic -= 1;" code is not working, check it.

Basara
Novice Poster
Posts: 47
Joined: Fri Oct 13, 2006 6:37 am
Location: UK

Re: Doors

Post by Basara » Tue Apr 13, 2010 2:59 pm

Cheers I will, for now I've found a door package from an older server I used to run that looks to do CWO wrote, but more lengthy, lol, but it worked right away on that problem door.
If i can get CWO's working, i'll change it back as his looks more streamlined.

If anyones interested here's the opendoor.src, usues a seperate one for closing for some reason

Code: Select all

use cfgfile;
use uo;
use os;

include "include/client";

program open_door(door)
  var doordesc := ReadConfigFile("itemdesc");
  var xmod := CInt(doordesc[door.objtype].xmod);
  var ymod := CInt(doordesc[door.objtype].ymod);
  var newx := (door.x + xmod);
  var newy := (door.y + ymod);
  var newz := door.z;
  var closesound, opensound;
  case (doordesc[door.objtype].doortype)
    "stone": opensound := SFX_OPEN_METAL_DOOR;
             closesound := SFX_CLOSE_METAL_DOOR;
    "wood":  opensound := SFX_OPEN_WOODEN_DOOR;
             closesound := SFX_CLOSE_WOODEN_DOOR;
    "metal": opensound := SFX_OPEN_METAL_DOOR;
             closesound := SFX_CLOSE_METAL_DOOR;
  endcase
  var opengraphic := GetObjProperty(door, "opengraphic");
  if((!opengraphic) || (opengraphic == ""))
    opengraphic := door.graphic + 1;
  endif
  var whenopened := ReadGameClock();
  if(GetObjProperty( door, "WhenOpened"))
    return;
  endif
  set_critical(1);
  PlaySoundEffect( door, opensound );
  door.graphic := opengraphic;
  door.movable := 1;
  MoveObjectToLocation(door, newx, newy, newz, door.realm, MOVEOBJECT_FORCELOCATION);
  door.movable := 0;
  SetObjProperty( door, "WhenOpened", whenopened );
  set_critical(0);
  sleep( 10 );
  if(GetObjProperty( door, "WhenOpened" ))
    start_script(":doors:closeDoor", door);
  endif
endprogram

User avatar
CWO
POL Expert
Posts: 1148
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: Doors

Post by CWO » Wed Apr 14, 2010 3:20 am

ahh thats right, you can't use += and -= directly on objects... I just noticed I copied that code from my unfinished development server instead of my live server and that seems to be the only thing I changed from the code I replaced. (Its really been a while since I've actively scripted POL)

Try this. I fixed that, added the MOVEITEM_IGNOREMOVABLE tag, removed the door.movable stuff, and replaced the door.isopen with a check for the #WhenOpened prop instead.

Code: Select all

include "include/client";

program use_door( chr, door )
     
     
     var itemdesc := ReadConfigFile( "itemdesc" );
     
     var closesound;
     var opensound;
     case (itemdesc[door.objtype].doortype)
          default:
          "wood":
               opensound := SFX_OPEN_WOODEN_DOOR;
               closesound := SFX_CLOSE_WOODEN_DOOR;
               
          "metal":
               opensound := SFX_OPEN_METAL_DOOR;
               closesound := SFX_CLOSE_METAL_DOOR;
       endcase

      if (door.locked)
        PrintTextAbovePrivate( door, "That is locked.", chr );
    else
     Detach();
     set_critical(1);
     var whenopened := ReadGameClock();
     if (GetObjProperty( door, "#WhenOpened") )
          PlaySoundEffect( door, closesound );
          door.graphic := door.graphic - 1;
          MoveObjectToLocation(door, (door.x - CInt(itemdesc[door.objtype].xmod)), (door.y - CInt(itemdesc[door.objtype].ymod)), door.z, door.realm, MOVEOBJECT_FORCELOCATION+ MOVEITEM_IGNOREMOVABLE);
          EraseObjProperty( door, "#WhenOpened" );
     else
          SetObjProperty( door, "#WhenOpened", whenopened );
          PlaySoundEffect( door, opensound );
          door.graphic := door.graphic + 1;
     MoveObjectToLocation(door, (door.x + CInt(itemdesc[door.objtype].xmod)), (door.y + CInt(itemdesc[door.objtype].ymod)), door.z, door.realm, MOVEOBJECT_FORCELOCATION + MOVEITEM_IGNOREMOVABLE);
          sleep( 10 );
          if (GetObjProperty( door, "#WhenOpened" ) == whenopened)
               PlaySoundEffect( door, closesound );
               door.graphic := door.graphic - 1;
               MoveObjectToLocation(door, (door.x - CInt(itemdesc[door.objtype].xmod)), (door.y - CInt(itemdesc[door.objtype].ymod)), door.z, door.realm, MOVEOBJECT_FORCELOCATION + MOVEITEM_IGNOREMOVABLE);
               EraseObjProperty( door, "#WhenOpened" );
          endif
     endif
endif
endprogram

Basara
Novice Poster
Posts: 47
Joined: Fri Oct 13, 2006 6:37 am
Location: UK

Re: Doors

Post by Basara » Fri Apr 16, 2010 9:44 am

Just tried your script and it works fine, thanks again

Post Reply