Frictional Games Forum (read-only)

Full Version: New Question: How to create a door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
Hello again Cruzore/FastHunteR or new helper [Image: tongue.gif]
Well, my new question is, how do I create a door?
Like, I want to make a mirror a door, so I went to the ModelEditor, opened a door file, and replaced the door with a mirror, and that colored boxes are still there and joints, etc.
But when I go on the LevelEditor and place the Mirror Door, ingame the hand doesn't show up, so I cant open it. :/
How do I make the mirror a door?

Quote:"
Open your model in the ModelEditor, go to "User Defined Variables" in Settings (I think), and there should be a drop-down arrow at the top of the new window. Look through there, and use "SwingDoor". "
I did that too, but it didn't work.

Thanks for taking your time to help me Smile
For 1 & 2:
Under Entities>Special, there is the cave_in as an entity. So it has a active checkbox. This way you can set it inactive, set it active when you need to, add some sound and you got your cave in.
For the 3rd:
Under Entities>storage, you can use all bookshelves. Just use a AddUseItemCallback(look on the engine scripts page on the wiki for details) and you can set the shelf inactive as a result. Might want to either let the player fadeout, or force him to watch somewhere else, since seeing a shelf disappear is not that good.
I am pretty sure there are other soultions for 3, but this is one.
(06-20-2012, 01:22 PM)FastHunteR Wrote: [ -> ]For 1 & 2:
Under Entities>Special, there is the cave_in as an entity. So it has a active checkbox. This way you can set it inactive, set it active when you need to, add some sound and you got your cave in.
For the 3rd:
Under Entities>storage, you can use all bookshelves. Just use a AddUseItemCallback(look on the engine scripts page on the wiki for details) and you can set the shelf inactive as a result. Might want to either let the player fadeout, or force him to watch somewhere else, since seeing a shelf disappear is not that good.
I am pretty sure there are other soultions for 3, but this is one.

Thank you so much, FastHunteR Smile
1st and 2nd are solved.
Is it possible to make Smoke on the bookshelf when it is destroyed, so the player doesn't see it disappearing because of the smoke?


EDIT:
Quote:void AddUseCallback(std:Confusedtring asItem, std:Confusedtring asEntity, std:Confusedtring asFunction);
Add a callback that is called when the player uses the item on en entity
The syntax for the callback function is:
void MyFunction(string asItem, string asEntity), the prefix ”@” (ie ”@Func()”) shows that the function is in the global script.
asItem The name of the item.
asEntity The name of the entity.
asFuntion The name of the function called.

I think this is the one I have to use for the bookshelf.
What do I do with it now?
Dissapearing, probably not. I myself couldn't find smoke thick enough for it to dissapear AND being able to deactivate it. You can just use a small fadeout() or make him look somewhere else. Maybe someone else finds a fitting thing.
(06-20-2012, 01:45 PM)FastHunteR Wrote: [ -> ]Dissapearing, probably not. I myself couldn't find smoke thick enough for it to dissapear AND being able to deactivate it. You can just use a small fadeout() or make him look somewhere else. Maybe someone else finds a fitting thing.
I guess I'll take on of the options Smile
Thanks once again. I editted my last post, if you could give it a look.
Sorry for being bothering you btw :/
Bothering? I have fun helping people Smile
So, that callback you stated, I couldn't even find it in the engine scripts page. Where did you get that one from? I would suggest use AddUseItemCallback. Go to the Engine scripts page on the wiki(http://wiki.frictionalgames.com/hpl2/amn..._functions) and search for that callback to understand which is for what. Here's an example script:

void OnStart()
{
AddUseItemCallback("", "hammer", "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("", "YOURBREAKSOUNDHERE.snt", "shelf", 0, false);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}

This script basically makes you fade out for 2 seconds after you used the hammer on the shelf, plays the sound you wish for, and after 1 second it fades back in for 2 seconds.
(06-20-2012, 02:08 PM)FastHunteR Wrote: [ -> ]Bothering? I have fun helping people Smile
So, that callback you stated, I couldn't even find it in the engine scripts page. Where did you get that one from? I would suggest use AddUseItemCallback. Go to the Engine scripts page on the wiki(http://wiki.frictionalgames.com/hpl2/amn..._functions) and search for that callback to understand which is for what. Here's an example script:

void OnStart()
{
AddUseItemCallback("", "hammer", "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("", "YOURBREAKSOUNDHERE.snt", "shelf", 0, false);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}

This script basically makes you fade out for 2 seconds after you used the hammer on the shelf, plays the sound you wish for, and after 1 second it fades back in for 2 seconds.
That's good to hear Smile
Now I see why I couldn't find the AddUseItemCallback, I was in this website: http://wiki.frictionalgames.com/hpl1/doc..._reference
Thanks for the script, where do I put it for it to work?
put the AddUseItemCallBack under void OnStart(), the rest comes somewhere not inside a function. Make sure to replace "hammer", "shelf" and "YOURBREAKSOUNDHERE.snt" with the name of your hammer/shelf and the name of the break sound. You'll have to search through the sound filder in the amnesia root for a good breaking sound.

By the way, you were under hpl1, which is for penumbra games. This is why you got the wrong functions.
(06-20-2012, 02:16 PM)FastHunteR Wrote: [ -> ]put the AddUseItemCallBack under void OnStart(), the rest comes somewhere not inside a function. Make sure to replace "hammer", "shelf" and "YOURBREAKSOUNDHERE.snt" with the name of your hammer/shelf and the name of the break sound. You'll have to search through the sound filder in the amnesia root for a good breaking sound.

By the way, you were under hpl1, which is for penumbra games. This is why you got the wrong functions.
What I meant was where do I have to place it? Like in a notepad++ .txt file, or in-game in the hammer or something. I can't find a place where I can put it Confused
use a .txt file, write it inside(youn can use notepad++) and save it as a .hps file with the name of your map it should work on. Example:
map: test01.map
script file:test01.hps
you have to add the basic functions:
OnStart()
{
}
OnEnter()
{
}
OnLeave()
{
}
Then you can put the stuff inside and let wonders happen.
You have to either use the developer environment and place the .map and .hps files under amnesia the dark descent>maps>yourcustomstorynamehere>maps
Or make a custom story straight away, but you will also need a custom_story_settings.cfg file and possibly the extra_english.lang file(idk if that's optional or not). If you don't know how to make any of the both, you can either ask again or go to http://wiki.frictionalgames.com/hpl2/amn...stom_story

Edit: .lang file is not optional Smile
Pages: 1 2 3 4 5 6 7 8