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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED!] Custom story wont show up
Author Message
HeavenSh0ck Offline
Junior Member

Posts: 6
Joined: May 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 925
Joined: Apr 2012
Reputation: 37
Post: #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 all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 322
Joined: Mar 2012
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 925
Joined: Apr 2012
Reputation: 37
Post: #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 all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 322
Joined: Mar 2012
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
HeavenSh0ck Offline
Junior Member

Posts: 6
Joined: May 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 322
Joined: Mar 2012
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
HeavenSh0ck Offline
Junior Member

Posts: 6
Joined: May 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 322
Joined: Mar 2012
Reputation: 8
Post: #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 all posts by this user Quote this message in a reply
HeavenSh0ck Offline
Junior Member

Posts: 6
Joined: May 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: