Frictional Games Forum (read-only)
Something I'm missing about using script files? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Something I'm missing about using script files? (/thread-4672.html)

Pages: 1 2


Something I'm missing about using script files? - graykin - 09-22-2010

Okay, so I have a map that I saved in the custom_stories folder, called "my_first.map". I created a basic HPS file for it ("my_first.HPS"), saved in the same location, but it does not actually do anything.

For reference, this is what my HPS looks like--it's the tutorial one in the wiki:
Quote:void OnStart()
{
//Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
It doesn't work, and my dev environment has been properly set up. I'm assuming you need to place a script area--or SOMETHING--in the map to get it to access the script, but I'm at a loss, and the wiki hasn't clarified it for me. I'm sure the answer will be face-palm inducing, but any assistance would be appreciated.


RE: Something I'm missing about using script files? - MulleDK19 - 09-23-2010

(09-22-2010, 11:55 PM)graykin Wrote: Okay, so I have a map that I saved in the custom_stories folder, called "my_first.map". I created a basic HPS file for it ("my_first.HPS"), saved in the same location, but it does not actually do anything.

For reference, this is what my HPS looks like--it's the tutorial one in the wiki:
Quote:void OnStart()
{
//Add the Lantern and 10 Tinderboxes when in Debug mode, always good to have light!
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
It doesn't work, and my dev environment has been properly set up. I'm assuming you need to place a script area--or SOMETHING--in the map to get it to access the script, but I'm at a loss, and the wiki hasn't clarified it for me. I'm sure the answer will be face-palm inducing, but any assistance would be appreciated.

Are you sure you turned on script debugging?


RE: Something I'm missing about using script files? - graykin - 09-23-2010

Aye, script debugging is indeed on.


RE: Something I'm missing about using script files? - jens - 09-23-2010

So when the map starts you do not have a lantern nor 10 tinderboxes? You load the correct level and it does not complain about anything? Post the hpl.log after having launched the level


RE: Something I'm missing about using script files? - graykin - 09-23-2010

Aha! I got it!

I decided to check the hpl.log myself, and discovered the cause. Like I thought, it was something stupid I forgot to do (namely, save both the HPS and the map file in the "maps" folder of "redist"). I wouldn't have thought to check the log myself had you not mentioned it, so thank you Jens for your assistance. Big Grin


RE: Something I'm missing about using script files? - Nippew - 09-24-2010

What ''redist''? I don't have that specific folder in my whole computer (i'm having steam version)
My map and script file are in ''amnesia the dark descent\\maps\\My maps and it still doesn't work. I have checked everything.


RE: Something I'm missing about using script files? - MulleDK19 - 09-24-2010

(09-24-2010, 12:52 PM)Nippew Wrote: What ''redist''? I don't have that specific folder in my whole computer (i'm having steam version)
My map and script file are in ''amnesia the dark descent\\maps\\My maps and it still doesn't work. I have checked everything.

Steam version has no redist folder.


RE: Something I'm missing about using script files? - Nippew - 09-24-2010

So how can i make my scripts on maps working?


RE: Something I'm missing about using script files? - gosseyn - 09-24-2010

put everything where amnesia.exe is, this is somewhat your redist folder( i read that on the wiki i think)


RE: Something I'm missing about using script files? - Nippew - 09-24-2010

Still no affect. Has anybody even here managed to get it working on steam version?