# HG changeset patch # User EroSennin # Date 1297544145 -3600 # Node ID 45b5bc70fc080e5cc7d9152cf3d333029015a96a # Parent c1d716188ea5f715a6cfc91cd39fc678a72d0dde StoneDoor: Now may be used horizontally and vertically. Use StoneDoor#SetR(90) to use horizontally. diff -r c1d716188ea5 -r 45b5bc70fc08 planet/Objects.c4d/Structures.c4d/StoneDoor.c4d/DefCore.txt --- a/planet/Objects.c4d/Structures.c4d/StoneDoor.c4d/DefCore.txt Sat Feb 12 17:37:42 2011 +0100 +++ b/planet/Objects.c4d/Structures.c4d/StoneDoor.c4d/DefCore.txt Sat Feb 12 21:55:45 2011 +0100 @@ -1,6 +1,6 @@ [DefCore] id=StoneDoor -Version=4,10,0,0 +Version=4,10,0,1 Category=C4D_Structure Width=10 Height=40 @@ -9,3 +9,4 @@ Value=10 Mass=1000 Components=Rock=10; +Rotate=1 diff -r c1d716188ea5 -r 45b5bc70fc08 planet/Objects.c4d/Structures.c4d/StoneDoor.c4d/Script.c --- a/planet/Objects.c4d/Structures.c4d/StoneDoor.c4d/Script.c Sat Feb 12 17:37:42 2011 +0100 +++ b/planet/Objects.c4d/Structures.c4d/StoneDoor.c4d/Script.c Sat Feb 12 21:55:45 2011 +0100 @@ -22,27 +22,59 @@ protected func FxIntMoveGateUpTimer(object target) { - if (GBackSolid(0, -20)) + var backSolidX; // hitting coordinate x of the door + var backSolidY; // hitting coordinate y of the door + if (GetR() == 90 || GetR() == 270){ + backSolidX = -20; + backSolidY = 0; + } + else{ + backSolidX = 0; + backSolidY = -20; + } + if (GBackSolid(backSolidX, backSolidY)) // stop the door if it hits something { Sound("GateHit.ogg"); SetYDir(0); + SetXDir(0); return -1; } - SetYDir(-5); + if(GetR() == 90 || GetR() == 270){ + SetXDir(-5); + } + else{ + SetYDir(-5); + } return 1; } protected func FxIntMoveGateDownTimer(object target) { - if (GBackSolid(0, 19)) + var backSolidX; // hitting coordinate x of the door + var backSolidY; // hitting coordinate y of the door + if (GetR() == 90){ + backSolidX = 20; + backSolidY = 0; + } + else{ + backSolidX = 0; + backSolidY = 19; + } + + if (GBackSolid(backSolidX, backSolidY)) // stop the door if it hits something { Sound("GateHit.ogg"); SetYDir(0); + SetXDir(0); return -1; } - - SetYDir(5); + if(GetR() == 90){ + SetXDir(5); + } + else{ + SetYDir(5); + } return 1; }