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
Scripting
darkdamp Offline
Junior Member

Posts: 7
Threads: 4
Joined: Sep 2010
Reputation: 0
#1
Scripting

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.
09-19-2010, 05:35 PM
Find
nickTs Offline
Junior Member

Posts: 12
Threads: 3
Joined: Sep 2010
Reputation: 0
#2
RE: Scripting

The .map file and .hps file need to have the same name.
09-19-2010, 05:51 PM
Find
darkdamp Offline
Junior Member

Posts: 7
Threads: 4
Joined: Sep 2010
Reputation: 0
#3
RE: Scripting

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 ^^
09-19-2010, 05:54 PM
Find
Akasu Offline
Member

Posts: 62
Threads: 6
Joined: Aug 2010
Reputation: 2
#4
RE: Scripting

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");
}
09-19-2010, 05:56 PM
Find
darkdamp Offline
Junior Member

Posts: 7
Threads: 4
Joined: Sep 2010
Reputation: 0
#5
RE: Scripting

thanks it worked!! Big Grin

EDIT: Btw, how do i know which script i should write since in not in "dev-mode"
09-19-2010, 06:10 PM
Find
Akasu Offline
Member

Posts: 62
Threads: 6
Joined: Aug 2010
Reputation: 2
#6
RE: Scripting

You're welcome. Just don't include the 'if(ScriptDebugOn())' anywhere.
09-19-2010, 06:26 PM
Find




Users browsing this thread: 2 Guest(s)