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
Can't get this script working
FaintedPhantom Offline
Junior Member

Posts: 2
Threads: 1
Joined: May 2012
Reputation: 0
#1
Can't get this script working

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
(This post was last modified: 05-20-2012, 08:48 AM by FaintedPhantom.)
05-20-2012, 07:12 AM
Find
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#2
RE: Can't get this script working

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.

Dark Seclusion Here
05-20-2012, 07:57 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#3
RE: Can't get this script working

(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

05-20-2012, 08:42 AM
Find
FaintedPhantom Offline
Junior Member

Posts: 2
Threads: 1
Joined: May 2012
Reputation: 0
#4
RE: Can't get this script working

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







Thanks man, you solved my problem Smile
(This post was last modified: 05-20-2012, 08:50 AM by FaintedPhantom.)
05-20-2012, 08:48 AM
Find




Users browsing this thread: 2 Guest(s)