Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Something I'm missing about using script files?
Author Message
graykin Offline
Senior Member

Posts: 309
Joined: Oct 2008
Reputation: 4
Post: #1
Something I'm missing about using script files?
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.

09-22-2010 11:55 PM
Find all posts by this user Quote this message in a reply
MulleDK19 Offline
Senior Member

Posts: 511
Joined: Jun 2009
Reputation: 8
Post: #2
RE: Something I'm missing about using script files?
(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?

[Image: 16455.png]
09-23-2010 01:31 AM
Find all posts by this user Quote this message in a reply
graykin Offline
Senior Member

Posts: 309
Joined: Oct 2008
Reputation: 4
Post: #3
RE: Something I'm missing about using script files?
Aye, script debugging is indeed on.

09-23-2010 01:59 AM
Find all posts by this user Quote this message in a reply
jens Offline
Frictional Games

Posts: 3,107
Joined: Apr 2006
Reputation: 103
Post: #4
RE: Something I'm missing about using script files?
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
09-23-2010 06:20 AM
Visit this user's website Find all posts by this user Quote this message in a reply
graykin Offline
Senior Member

Posts: 309
Joined: Oct 2008
Reputation: 4
Post: #5
RE: Something I'm missing about using script files?
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

09-23-2010 11:44 PM
Find all posts by this user Quote this message in a reply
Nippew Offline
Junior Member

Posts: 11
Joined: Feb 2008
Reputation: 0
Post: #6
RE: Something I'm missing about using script files?
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.
09-24-2010 12:52 PM
Find all posts by this user Quote this message in a reply
MulleDK19 Offline
Senior Member

Posts: 511
Joined: Jun 2009
Reputation: 8
Post: #7
RE: Something I'm missing about using script files?
(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.

[Image: 16455.png]
09-24-2010 01:18 PM
Find all posts by this user Quote this message in a reply
Nippew Offline
Junior Member

Posts: 11
Joined: Feb 2008
Reputation: 0
Post: #8
RE: Something I'm missing about using script files?
So how can i make my scripts on maps working?
09-24-2010 01:31 PM
Find all posts by this user Quote this message in a reply
gosseyn Offline
Member

Posts: 63
Joined: Sep 2010
Reputation: 1
Post: #9
RE: Something I'm missing about using script files?
put everything where amnesia.exe is, this is somewhat your redist folder( i read that on the wiki i think)
09-24-2010 01:46 PM
Find all posts by this user Quote this message in a reply
Nippew Offline
Junior Member

Posts: 11
Joined: Feb 2008
Reputation: 0
Post: #10
RE: Something I'm missing about using script files?
Still no affect. Has anybody even here managed to get it working on steam version?
09-24-2010 03:00 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)