Frictional Games Forum
[SOLVED!] Custom story wont show up - Printable Version

+- Frictional Games Forum (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SOLVED!] Custom story wont show up (/thread-15283.html)

Pages: 1 2


[SOLVED!] Custom story wont show up - HeavenSh0ck - 05-06-2012

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()
{

}


RE: Custom story wont show up - Cranky Old Man - 05-06-2012

StartMap = "The Castle of the Evil.map"


RE: Custom story wont show up - Xanthos - 05-06-2012

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.


RE: Custom story wont show up - Cranky Old Man - 05-06-2012

(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.


RE: Custom story wont show up - Xanthos - 05-06-2012

(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


RE: Custom story wont show up - HeavenSh0ck - 05-06-2012

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)'


RE: Custom story wont show up - Xanthos - 05-06-2012

(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);

}


RE: Custom story wont show up - HeavenSh0ck - 05-06-2012

////////////////////////////
// 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.


RE: Custom story wont show up - Xanthos - 05-06-2012

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


That CallBack B needs to be lower case.


RE: Custom story wont show up - HeavenSh0ck - 05-06-2012

(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?