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
Rotate secret book shelf with moveable book
Efendi Offline
Junior Member

Posts: 13
Threads: 7
Joined: Sep 2013
Reputation: 0
#1
Rotate secret book shelf with moveable book

Hello. I have a problem when i want to rotate the secret book shelf using a moveable book. The problem is that the shelf is not moving at all.

Here is the script:

Spoiler below!
void OnStart();

{

AddEntityCollideCallback("Book", "Book_Area", "func_shelf", true, 1);

}

void func_shelf(string &in asEntity, int alState)

{
if (alState == 1)
{
SetMoveObjectState("Shelf", 1);

}

}

I have named the moveable book to "Book", and placed a area near the book, and i have named it "Book_Area". The shelf name is "Shelf", and i have places a area near the corner of the shelf, where i want it to rotate, and named it "RotateShelf, and i have named the "RotateShelf" in the AngularOffsetArea on the Shelf.

Any help would be highly appreciated! Thanks in advance! Smile
(This post was last modified: 11-08-2013, 09:29 AM by Efendi.)
11-08-2013, 08:24 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#2
RE: Rotate secret book shelf with moveable book

Your function func_shelf have wrong arguments, you need two strings and one integer.

Like this:
void func_shelf ( string &in as p, string &in c, int i )

(This post was last modified: 11-08-2013, 03:02 PM by Daemian.)
11-08-2013, 03:02 PM
Find
Efendi Offline
Junior Member

Posts: 13
Threads: 7
Joined: Sep 2013
Reputation: 0
#3
RE: Rotate secret book shelf with moveable book

(11-08-2013, 03:02 PM)Amn Wrote: Your function func_shelf have wrong arguments, you need two strings and one integer.

Like this:
void func_shelf ( string &in as p, string &in c, int i )

Thanks for the answer Amn! I figured out my problem few days back, this is my code now:

Spoiler below!
AddEntityCollideCallback("Book_1", "BookArea_1", "func_shelf", true, 0);


void func_shelf (string &in asParent, string &in asChild, int alState)

{
if(alState == 1)
if(asParent == "Book_1" && GetLocalVarInt("Move") == 0)



{
SetMoveObjectState("Shelf", 1);
SetLocalVarInt("Move", 1);
PlayMusic("10_puzzle02.ogg", false, 0.7, 0.1, 2, false);
GiveSanityBoostSmall();
}

}

I have tried to add few more books, when you have all books drawn, then the secret shelf will rotate. It doesn't require any given order, just that when all books have been drawn. I have tried many hours to try to get it to work, but with no results. I know the problem is simple, just that i don't seem to get the hang of it.

Thanks for any answer in advance! Smile
(This post was last modified: 11-11-2013, 08:51 PM by Efendi.)
11-11-2013, 04:21 PM
Find
daortir Offline
Senior Member

Posts: 422
Threads: 9
Joined: Sep 2013
Reputation: 18
#4
RE: Rotate secret book shelf with moveable book

What is the exact name of the shelf you are using ? I mean not the one you gave to the shelf, but the one it has in the level editor.

(This post was last modified: 11-11-2013, 07:20 PM by daortir.)
11-11-2013, 07:20 PM
Find
Efendi Offline
Junior Member

Posts: 13
Threads: 7
Joined: Sep 2013
Reputation: 0
#5
RE: Rotate secret book shelf with moveable book

(11-11-2013, 07:20 PM)daortir Wrote: What is the exact name of the shelf you are using ? I mean not the one you gave to the shelf, but the one it has in the level editor.

The shelf name is shelf_secret_door.ent

I actually didn't get the shelf to rotate, with any kind of shelf entitys. It only goes sideways, but i figured that will do.

The main issue for me is still that i don't get the shelf to move, when i try to combine more books to the script. I will be back to write some updates, if i manage to get it to work.

Thanks for the reply daortir!
11-11-2013, 08:51 PM
Find




Users browsing this thread: 1 Guest(s)