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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Level Editor Help New Question: How to create a door
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#21
RE: 3 Questions: Cave In and Destroying bookshelf

After a bit of trial and error, I made a test map and I see what your problem is. Do the following:
Open the model editor
Open the shelf you want(under amnesia root>entities>storage)
Go to setting and user defined variables
at the top, change the type from static object to object, with the subtype static.
save as, make a new folder in your custom story named "entities" and save it inside
in level editor, select your shelf and under entity file, browse to your custom story and select the new made shelf.
That's it! however, i forgot to add a SetEntityActive("shelf02_1, false);
So, place it under the playsound function.
06-21-2012, 01:28 PM
Find Reply
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#22
RE: 3 Questions: Cave In and Destroying bookshelf

(06-21-2012, 01:28 PM)FastHunteR Wrote: After a bit of trial and error, I made a test map and I see what your problem is. Do the following:
Open the model editor
Open the shelf you want(under amnesia root>entities>storage)
Go to setting and user defined variables
at the top, change the type from static object to object, with the subtype static.
save as, make a new folder in your custom story named "entities" and save it inside
in level editor, select your shelf and under entity file, browse to your custom story and select the new made shelf.
That's it! however, i forgot to add a SetEntityActive("shelf02_1, false);
So, place it under the playsound function.


I'm getting this FATAL ERROR when I start my custom story (image attached)
Here is the script with the SetEntityActive added:

Quote:void OnStart()
{
AddUseItemCallback("", "stone_hammer_1", "shelf02_1", "DestroyShelf", true);
}
void DestroyShelf(string &in asItem, string &in asEntity)
{
//Do your stuff, whatever you want to do, here. Example:
FadeOut(2);
AddTimer("Timer_1", 2, "PlaySound");
}
void PlaySound(string &in asTimer)
{
PlaySoundAtEntity("", "break_wood.snt", "shelf02_1", 0, false);
SetEntityActive("shelf02_1, false);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}


Attached Files
.png   FATAL ERROR.png (Size: 39.89 KB / Downloads: 28)

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
06-21-2012, 02:15 PM
Find Reply
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#23
RE: 3 Questions: Cave In and Destroying bookshelf

SetEntityActive("shelf02_1, false);
missing" after shelf02_1
06-21-2012, 02:19 PM
Find Reply
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#24
RE: 3 Questions: Cave In and Destroying bookshelf

(06-21-2012, 02:19 PM)FastHunteR Wrote: SetEntityActive("shelf02_1, false);
missing" after shelf02_1
It works now! I just had to change of my shelf to 'shelf' in the level editor, script and the .ent name.
How can I make so that everything on the bookshelf fall or just disappear after the shelf is destroyed?

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
06-21-2012, 02:33 PM
Find Reply
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#25
RE: 3 Questions: Cave In and Destroying bookshelf

they fall automatically as of now, but for them to dissapear you have to set them inactive as well
06-21-2012, 02:37 PM
Find Reply
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#26
RE: 3 Questions: Cave In and Destroying bookshelf

(06-21-2012, 02:37 PM)FastHunteR Wrote: they fall automatically as of now, but for them to dissapear you have to set them inactive as well
They are not falling :S
I have 3 candles and many books.

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
06-21-2012, 02:41 PM
Find Reply
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#27
RE: 3 Questions: Cave In and Destroying bookshelf

if those are book piles and book rows, they are static and can not fall. You could try to set them moveable in the model editor, but it doesn't look nice when you can drag so many books together. Use single books instead.
06-21-2012, 02:45 PM
Find Reply
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#28
RE: 3 Questions: Cave In and Destroying bookshelf

(06-21-2012, 02:45 PM)FastHunteR Wrote: if those are book piles and book rows, they are static and can not fall. You could try to set them moveable in the model editor, but it doesn't look nice when you can drag so many books together. Use single books instead.
I'll try that, thanks. Smile

EDIT:
In the meanwhile, what script do I have to use to make the 'cave_in' appear when I step an area?

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
(This post was last modified: 06-21-2012, 02:53 PM by Nervly.)
06-21-2012, 02:48 PM
Find Reply
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#29
RE: 3 Questions: Cave In and Destroying bookshelf

Same as the bookshelf, just with true.
SetEntityActive("nameofcavein", true);
If you don't look directly to the cave in when you enter that area, you can leave it by that and a PlaySoundAtEntity function for the cave in sound. If you do look directly though, use FadeOut() and FadeIn() just like for that bookshelf.
06-21-2012, 02:56 PM
Find Reply
Nervly Offline
Junior Member

Posts: 40
Threads: 2
Joined: Feb 2012
Reputation: 0
#30
RE: 3 Questions: Cave In and Destroying bookshelf

(06-21-2012, 02:56 PM)FastHunteR Wrote: Same as the bookshelf, just with true.
SetEntityActive("nameofcavein", true);
If you don't look directly to the cave in when you enter that area, you can leave it by that and a PlaySoundAtEntity function for the cave in sound. If you do look directly though, use FadeOut() and FadeIn() just like for that bookshelf.
Ok, thanks a lot for all your help! ^^
I'll set the books, etc. to inactive now that I know the command, and I'll take care of the cave_in.
+1 Rep again Smile

EDIT:
The books, etc. are not disappearing. I copied their names, so I guess that's not the problem.
Here is the script:

Quote:void OnStart()
{
AddUseItemCallback("", "stone_hammer_1", "shelf", "DestroyShelf", true);
}
void DestroyShelf(string &in asItem, string &in asEntity)
{
//Do your stuff, whatever you want to do, here. Example:
FadeOut(2);
AddTimer("Timer_1", 2, "PlaySound");
}
void PlaySound(string &in asTimer)
{
PlaySoundAtEntity("", "break_wood.snt", "shelf", 0, false);
SetEntityActive("shelf", false);
SetEntityActive("book_row02_1", false);
SetEntityActive("book_row01_2", false);
SetEntityActive("book_pile01_1", false);
SetEntityActive("candlestick01_4", false);
SetEntityActive("book_row03_1", false);
SetEntityActive("book_open_1", false);
SetEntityActive("book_row02_2", false);
SetEntityActive("book_pile02_1", false);
SetEntityActive("book_pile01_2", false);
SetEntityActive("book_row02_3", false);
SetEntityActive("candlestick01_2", false);
SetEntityActive("candlestick01_3", false);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}

Check it out!
http://www.youtube.com/Nervly

Please?
[Image: please-please-please.jpg]
(This post was last modified: 06-21-2012, 03:28 PM by Nervly.)
06-21-2012, 03:06 PM
Find Reply




Users browsing this thread: 1 Guest(s)