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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting
Author Message
darkdamp Offline
Junior Member

Posts: 7
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
nickTs Offline
Junior Member

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

The .map file and .hps file need to have the same name.
09-19-2010 05:51 PM
Find all posts by this user Quote this message in a reply
darkdamp Offline
Junior Member

Posts: 7
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Akasu Offline
Member

Posts: 62
Joined: Aug 2010
Reputation: 2
Post: #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 all posts by this user Quote this message in a reply
darkdamp Offline
Junior Member

Posts: 7
Joined: Sep 2010
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Akasu Offline
Member

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

You're welcome. Just don't include the 'if(ScriptDebugOn())' anywhere.
09-19-2010 06:26 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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