Frictional Games Forum (read-only)

Full Version: Scripting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i have a problem i have a map called awesomeness.map
I took a script from the official maps that was .hps and edited it its not called awesomeness.hps
I made this easy script on it

////////////////////////////
// Run first time starting map
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()
{

}


But! i have no lantern when i start (awesomness.map and .hps and .map_cache are on the same folder /custom_stories/Test Maps/maps

Please i don“t know what to do.
The .map file and .hps file need to have the same name.
they have both has the name awesomeness

EDIT: my custom story settings looks like this

<Main
ImgFile = "story.png"
Name = "Haunted"
Author = "Osukaru"

MapsFolder = "maps"
StartMap = "Awesomeness.map"
StartPos = ""
/>
if it makes any difference ^^
If you aren't running in dev-mode use this instead:

void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
thanks it worked!! Big Grin

EDIT: Btw, how do i know which script i should write since in not in "dev-mode"
You're welcome. Just don't include the 'if(ScriptDebugOn())' anywhere.