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
[SOLVED!] Custom story wont show up
HeavenSh0ck Offline
Junior Member

Posts: 6
Threads: 1
Joined: May 2012
Reputation: 0
#1
[SOLVED!] Custom story wont show up

I'm working on a custom story, I've finished the map, I've already scripted so theres a key to a door. But when I wanna test run the custom story doesn't show up in the list.
Heres my extra_english.lang




You wake up inside a jail cell, you can't remember how you got inside. You don't even remember your name. As you explore the Castle of the Evil, things start to slowly get back to you.


"This must open the cell door."
Cell Key



Heres custom_story settings.cfg

ImgFile = "story.png"
Name = "The Castle of the Evil"
Author = "HeavenSh0ck"

MapsFolder = "maps/"
StartMap = "The Castle of the Evil"
StartPos = "PlayerStartArea1"
/>
My map .hps file

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallBack("", "celldoorkey", "celldoor", "UsedKeyOnDoor", true);
}

void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("celldoor", false, true);
PlaySoundAtEntity("", "unlock_door", "celldoor", "0", false);
RemoveItem(celldoorkey);
}

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

}
(This post was last modified: 05-06-2012, 12:48 PM by HeavenSh0ck.)
05-06-2012, 10:29 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#2
RE: Custom story wont show up

StartMap = "The Castle of the Evil.map"

Noob scripting tutorial: From Noob to Pro

05-06-2012, 11:13 AM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#3
RE: Custom story wont show up

MapsFolder = "maps/"
StartMap = "The Castle of the Evil.map"

ImgFile = "story.png"

I thought it only worked with jpg, but I haven't really tested it with png.

Also I want to fix the Key script
{
AddUseItemCallBack("", "celldoorkey", "celldoor", "UsedKeyOnDoor", true);
}

void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("celldoor", false, true);
PlaySoundAtEntity("", "unlock_door", "celldoor", "0", false);
RemoveItem(celldoorkey);
GiveSanityBoostSmall(); //This is an optional script function
}


Those two bolded have to correspond with each other.

(This post was last modified: 05-06-2012, 11:49 AM by Xanthos.)
05-06-2012, 11:47 AM
Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#4
RE: Custom story wont show up

(05-06-2012, 11:47 AM)Xanthos Wrote: MapsFolder = "maps/"
StartMap = "The Castle of the Evil.map"

ImgFile = "story.png"

I thought it only worked with jpg, but I haven't really tested it with png.
The MapsFolder works just fine with "maps/", and while I think that "story.png" works fine, the engine will just skip showing a picture if it cannot find one, so that's not a problem.

Noob scripting tutorial: From Noob to Pro

05-06-2012, 11:53 AM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#5
RE: Custom story wont show up

(05-06-2012, 11:53 AM)Cranky Old Man Wrote:
(05-06-2012, 11:47 AM)Xanthos Wrote: MapsFolder = "maps/"
StartMap = "The Castle of the Evil.map"

ImgFile = "story.png"

I thought it only worked with jpg, but I haven't really tested it with png.
The MapsFolder works just fine with "maps/", and while I think that "story.png" works fine, the engine will just skip showing a picture if it cannot find one, so that's not a problem.
Thanks,

How do you know all of this if you don't make custom stories? XD

05-06-2012, 11:55 AM
Find
HeavenSh0ck Offline
Junior Member

Posts: 6
Threads: 1
Joined: May 2012
Reputation: 0
#6
RE: Custom story wont show up

Thanks, it worked I see it on my list - but when I run the custom story, this is the new error I get:FATAL ERROR: Could not load script file 'custom_stories/The Castle of the Evil/custom_stories/The Castle of the Evil/maps/The Castle of the Evil.hps'!
main (5,1):ERR : No matching signatures to
'AddUseItemCallBack(string@&, string@&, string@&, string@&, const
bool)'
05-06-2012, 12:06 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#7
RE: Custom story wont show up

(05-06-2012, 12:06 PM)HeavenSh0ck Wrote: Thanks, it worked I see it on my list - but when I run the custom story, this is the new error I get:FATAL ERROR: Could not load script file 'custom_stories/The Castle of the Evil/custom_stories/The Castle of the Evil/maps/The Castle of the Evil.hps'!
main (5,1):ERR : No matching signatures to
'AddUseItemCallBack(string@&, string@&, string@&, string@&, const
bool)'
Move
AddUseItemCallBack("", "celldoorkey", "celldoor", "UsedKeyOnDoor", true);


From "OnEnter" To "Onstart"
Onstart()
{
AddUseItemCallBack("", "celldoorkey", "celldoor", "UsedKeyOnDoor", true);

}

05-06-2012, 12:07 PM
Find
HeavenSh0ck Offline
Junior Member

Posts: 6
Threads: 1
Joined: May 2012
Reputation: 0
#8
RE: Custom story wont show up

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

void OnStart()
{
AddUseItemCallBack("", "celldoorkey", "celldoor", "UsedKeyOnDoor", true);
}

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

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

}

Heres the script I am still having the same error.
05-06-2012, 12:13 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#9
RE: Custom story wont show up

AddUseItemCallBack("", "celldoorkey", "celldoor", "UsedKeyOnDoor", true);


That CallBack B needs to be lower case.

05-06-2012, 12:15 PM
Find
HeavenSh0ck Offline
Junior Member

Posts: 6
Threads: 1
Joined: May 2012
Reputation: 0
#10
RE: Custom story wont show up

(05-06-2012, 12:15 PM)Xanthos Wrote: AddUseItemCallBack("", "celldoorkey", "celldoor", "UsedKeyOnDoor", true);


That CallBack B needs to be lower case.
That does it, just one thing - the custom story description won't show... Do you have a fix for this?
05-06-2012, 12:18 PM
Find




Users browsing this thread: 1 Guest(s)