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
Nervly Offline
Junior Member

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

(06-20-2012, 02:56 PM)FastHunteR Wrote: 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


The custom_story_settings file its already configured by me, I just don't have the extra_english.lang file.
So, since I have to name the script the same as the name of the map, I can only have one script per map?

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

Please?
[Image: please-please-please.jpg]
06-20-2012, 07:35 PM
Find
Cruzore Offline
Senior Member

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

Yes, and only 1 script is needed, since you can put everything you need in 1 script.
06-20-2012, 07:39 PM
Find
Nervly Offline
Junior Member

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

(06-20-2012, 07:39 PM)FastHunteR Wrote: Yes, and only 1 script is needed, since you can put everything you need in 1 script.
Oh, nice. So I can have many scripts in 'test.hps' for 'test.map', for example, and that scripts are only for 'test.map', and for a 'test_2.map' I need a 'test_2.hps' with the scripts I want only for that 'test_2.map', right?

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

Please?
[Image: please-please-please.jpg]
06-20-2012, 07:49 PM
Find
Cruzore Offline
Senior Member

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

Yes, exactly. and if you need a way to script over the maps, store numbers in global variables, and check for them in the other script. This way you can, let's say, get a lever to be turned in 1 map and let it open a door on the other.
06-20-2012, 07:51 PM
Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#15
RE: 3 Questions: Cave In and Destroying bookshelf

Make like a little shake as if the castle or the whole building you are in is shaking and then the wind blows and you hear steps, "PickAFileInTheSoundFolder.snt" so the player looks backwards, then it would be perfect time to deactivate the bookshelf in condition and activate the ruined bookshelf.

Hi.
06-20-2012, 10:29 PM
Website Find
Nervly Offline
Junior Member

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

(06-20-2012, 10:29 PM)CrazyArts Wrote: Make like a little shake as if the castle or the whole building you are in is shaking and then the wind blows and you hear k, "PickAFileInTheSoundFolder.snt" so the player looks backwards, then it would be perfect time to deactivate the bookshelf in condition and activate the ruined bookshelf.
That sounds nice, but it would be somewhat weird, because since you have the hammer in your hand and you smash the bookshelf, it would be like, you are destroying it while looking back. I guess I'll use the FadeIn/Out option. But thank you Smile

+1 Rep to you Wink

So, I have the script in the .txt file and I saved it as a .hps file, it has the same name of the map and it is in the /maps folder. How do I activate the script in-game/level editor?

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

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

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

You can't activate the script in the level editor, start the game and start it in either custom stories option or use the development environment to start it immediatly, then you use your hammer on your shelf and it should work.
06-21-2012, 01:05 PM
Find
Nervly Offline
Junior Member

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

(06-21-2012, 01:05 PM)FastHunteR Wrote: You can't activate the script in the level editor, start the game and start it in either custom stories option or use the development environment to start it immediatly, then you use your hammer on your shelf and it should work.
It's no working :/
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);
AddTimer("Timer_2", 1, "FadeInFunction");
}
void FadeInFunction(string &in asTimer)
{
FadeIn(2);
}

Here is the script. I replaced the sound, the name of the shelf and of the hammer.

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

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

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

What exactly is not working? it won't start your custom story, it doens't appear in your custom stories option or it won't destroy the shelf?
06-21-2012, 01:11 PM
Find
Nervly Offline
Junior Member

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

(06-21-2012, 01:11 PM)FastHunteR Wrote: What exactly is not working? it won't start your custom story, it doens't appear in your custom stories option or it won't destroy the shelf?
The shelf is not destroying. I select the hammer from the inventory, and click the shelf but: No object to use item on!

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

Please?
[Image: please-please-please.jpg]
06-21-2012, 01:15 PM
Find




Users browsing this thread: 1 Guest(s)