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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help (Request) Moving Shelf using Secrets Books
User01 Offline
Member

Posts: 97
Threads: 30
Joined: Feb 2013
Reputation: 0
#5
RE: (Request) Moving Shelf using Secrets Books

PHP Code: (Select All)
int bookCounter 1;

void OnStart() {
    for(
int i 14i++) {
        
AddEntityCollideCallback("book_"+i"area_book_"+i"PullBook"false1);
    }


void PullBook(string &in asParentstring &in asChildint alState) {
    if(
asParent == StringSub(asParent0asParent.length() - 1) + bookCounter) {
        
AddDebugMessage("Pulled the correct book. Number: " bookCounterfalse);
        
bookCounter++;
    } else {
        
AddDebugMessage("Pulled the wrong book. Number: " bookCounterfalse);
        
bookCounter 1;
    }

    if(
bookCounter 3) {
        
AddDebugMessage("Completed the puzzle!"false);
        
SetMoveObjectState("shelf_secret_door_1"1);
    }


In front of each book is a script area.
[Image: vkc85e7g.png]
(This post was last modified: 05-06-2017, 08:21 PM by User01.)
05-06-2017, 08:18 PM
Find


Messages In This Thread
RE: (Request) Moving Shelf using Secrets Books - by User01 - 05-06-2017, 08:18 PM



Users browsing this thread: 1 Guest(s)