The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Something I'm missing about using script files?
graykin Offline
Senior Member

Posts: 317
Threads: 12
Joined: Oct 2008
Reputation: 4
#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


Messages In This Thread
Something I'm missing about using script files? - by graykin - 09-22-2010, 11:55 PM



Users browsing this thread: 1 Guest(s)