Frictional Games Forum (read-only)

Full Version: Can't get this script working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, I've been working on a costum story for like already a week, but I can't get this script working...
I've been watching 4 youtubers, but I just can't seem to get it working..
Could someone please help?
My .HPS file :


void OnStart()
{
AddUseItemCallback("", "Keyone", "doorone", "UsedKeyOnDoor", true);
AddUseItemCallback("", "Keytwo", "doortwo", "UsedKeyOnDooor", true);
SetEntityPlayerInteractCallback("lantern", "ActivateMonster", true);
AddUseItemCallback("", "knifeone", doorthree", "buyone", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("doorone", false, true);
PlaySoundAtEntity("", "unlock_door", "doorone", 0, false);
RemoveItem("Keyone");
}

void UsedKeyOnDooor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("doortwo", false, true);
PlaySoundAtEntity("", "unlock_door", "doortwo", 0, false);
RemoveItem("Keytwo");
}

void ActivateMonster(string &in item)
{
SetEntityActive("enemyone", true);
}

void buyone(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("doorthree", false, true);
PlaySoundAtEntity("", "unlock_door", "doorthree", 0, false);
RemoveItem("knifeone");
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

my custom_story_settings.cfg



Name = "StoryOfAPhantom"
Author = "FaintedPhantom"
Imgfile = "Image.JPG"

Startmap = "Eigenmap.MAP"
Startpos = "PlayerStartArea_1"
/>


The custom story won't show up..
Yesterday it still did, but then it gave me an error, about FATAL ERROR: something something (47,2)
or something..
Thanx already
Exception-handling needs to be covered in a wiki entry.

The example (47,2) is "Line 47, Character 2", but you really only need to look at the line to spot your typo.

If the map is simply not showing up, something is either wrong with where you placed your .cfg file, or something is wrong inside of it. I'm not sure if it will matter, but .MAP extension may be recognized as something different from the usual .map (Case may matter, but I'm not sure on that). Same goes for other extensions you may use (.hps, .cfg., jpg, etc.).

AddUseItemCallback("", "knifeone", doorthree", "buyone", true);
You are missing a "

It's a lot easier to catch when you are using Notepad++ with the language set to C#/C++, as it colors things.
(05-20-2012, 07:57 AM)FragdaddyXXL Wrote: [ -> ]Exception-handling needs to be covered in a wiki entry.
Actually a really good idea; almost half of all posts on this forum are about common exceptions. Someone should get on that. :o
FragdaddyXXL Wrote:
AddUseItemCallback("", "knifeone", doorthree", "buyone", true);
You are missing a "







Thanks man, you solved my problem Smile