The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Rotating Bookshelf, Goblets move with it, but not books?
Ananaias Offline
Junior Member

Posts: 20
Threads: 7
Joined: Jun 2012
Reputation: 0
#1
Rotating Bookshelf, Goblets move with it, but not books?

In my custom story, I have a bookshelf that moves to reveal a secret doorway, that is activated by a switch being pulled. I had no items on it, and it looked really plain, so I added books and some Goblets to spice it up. However, I've come across an issue.

When the bookshelf rotates, the goblets go with it, but the books themselves don't. They just stay in their original position, but floating in the air.

[Image: Aesb]

Here's my script:

PHP Code: (Select All)
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever""func_shelf");
    
AddUseItemCallback("""MasterRoomKey""MasterRoomDoor""unlock_door"true);
}

void func_shelf(string &in asEntityint alState)
{
    if (
alState == 1)
{
AddTimer(""3"Forcelook");
    
SetSwingDoorClosed("MasterRoomDoor"truetrue);
    
SetLampLit("light1room2"falsetrue);
    
SetLampLit("light2room2"falsetrue);
    
SetLampLit("light3room2"falsetrue);
    
SetLampLit("light4room2"falsetrue);
    
SetLampLit("light5room2"falsetrue);
    
SetLampLit("light6room2"falsetrue);
    
SetLampLit("light7room2"falsetrue);
    
SetLampLit("light8room2"falsetrue);
    
SetLampLit("light9room2"falsetrue);
    
SetLampLit("light1hall1"falsetrue);
    
SetLampLit("light2hall1"falsetrue);
    
SetLampLit("light3hall1"falsetrue);
    
SetLampLit("light4hall1"falsetrue);
    
SetLampLit("light5hall1"falsetrue);
    
SetLampLit("light6hall1"falsetrue);
    
SetLampLit("light7hall1"falsetrue);
    
SetLampLit("light8hall1"falsetrue);
    
SetLampLit("light1room1"falsetrue);
    
SetLampLit("light2room1"falsetrue);
    
SetLampLit("light3room1"falsetrue);
    
SetLampLit("light4room1"falsetrue);
    
SetLampLit("light5room1"falsetrue);
    
SetLampLit("light6room1"falsetrue);
    
SetLampLit("light7room1"falsetrue);
    
SetLampLit("light8room1"falsetrue);
    
SetLightVisible("point1room2"false);
    
SetLightVisible("point2room2"false);
    
SetLightVisible("point3room2"false);
    
SetLightVisible("point4room2"false);
    
SetLightVisible("point5room2"false);
    
SetLightVisible("point6room2"false);
    
SetLightVisible("point7room2"false);
    
SetLightVisible("point8room2"false);
    
SetLightVisible("point9room2"false);
    
SetLightVisible("point1hall1"false);
    
SetLightVisible("point2hall1"false);
    
SetLightVisible("point3hall1"false);
    
SetLightVisible("point4hall1"false);
    
SetLightVisible("point5hall1"false);
    
SetLightVisible("point6hall1"false);
    
SetLightVisible("point7hall1"false);
    
SetLightVisible("point8hall1"false);
    
SetLightVisible("point1room1"false);
    
SetLightVisible("point2room1"false);
    
SetLightVisible("point3room1"false);
    
SetLightVisible("point4room1"false);
    
SetLightVisible("point5room1"false);
    
SetLightVisible("point6room1"false);
    
SetLightVisible("point6room1"false);
    
SetLightVisible("point8room1"false);
    
SetMoveObjectState("shelf"1.0f);
    
SetMoveObjectState("bookset1"1.0f);
    
SetMoveObjectState("bookset2"1.0f);
    
SetMoveObjectState("bookset3"1.0f);
    
SetMoveObjectState("bookset4"1.0f);
    
SetMoveObjectState("bookset5"1.0f);
    
SetMoveObjectState("bookset6"1.0f);
    
SetMoveObjectState("bookset7"1.0f);
    
SetMoveObjectState("bookset8"1.0f);
    
SetMoveObjectState("bookset9"1.0f);
    
SetMoveObjectState("bookset10"1.0f);
    
SetMoveObjectState("bookset11"1.0f);
    
SetMoveObjectState("openbook1"1.0f);
    
SetMoveObjectState("goblet1"1.0f);
    
SetMoveObjectState("goblet2"1.0f);
    
SetMoveObjectState("goblet3"1.0f);
    
SetMoveObjectState("goblet4"1.0f);
    
SetEntityActive("hallwaypoofer"true);
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("hallwaypoofer""PathNodeArea_9"2"");
    
PlaySoundAtEntity("""quest_completed.snt""rotatearea"0false);
        return;
    }
}
void Forcelook(string &in asTimer){StartPlayerLookAt("bedscare"1010"");      AddTimer(""1"ActivateScare");}
void ActivateScare(string &in asTimer){    SetEntityActive("deadbodya"true);
    
SetEntityActive("deadbodyb"true);
    
SetEntityActive("deadbodyc"true);
    
SetEntityActive("redlighta"true);
    
SetEntityActive("redlightb"true);
    
SetLightVisible("redlight"true); 
    
GiveSanityDamage(40true);
    
PlaySoundAtEntity("""react_breath.snt""Player"0false);
      
AddTimer(""2"ScareOver");}
void ScareOver(string &in asTimer){StopPlayerLookAt();
    
SetEntityActive("deadbodyb"false);
    
SetEntityActive("deadbodyc"false);
    
SetEntityActive("deadbodya"false);
    
SetEntityActive("redlighta"false);
    
SetEntityActive("redlightb"false);
    
SetLightVisible("redlight"false);} 
06-11-2012, 04:33 PM
Find


Messages In This Thread
Rotating Bookshelf, Goblets move with it, but not books? - by Ananaias - 06-11-2012, 04:33 PM



Users browsing this thread: 1 Guest(s)