Frictional Games Forum (read-only)
Can't find my Custom Story - Printable Version

+- Frictional Games Forum (read-only) (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: Can't find my Custom Story (/thread-10574.html)

Pages: 1 2 3


RE: Can't find my Custom Story - i3670 - 10-03-2011

(10-03-2011, 04:51 PM)Your Computer Wrote: You're missing a function definition for the third code block (line 13). A code block that isn't a function (a.k.a. nested code blocks) are only allowed within function code blocks.
I put in the definition:

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

Copy/paste from Frictional Games Script website. Gives me the same error message, except the numbers has changed to 55,2





RE: Can't find my Custom Story - Your Computer - 10-03-2011

(10-03-2011, 04:57 PM)i3670 Wrote: I put in the definition:

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

Copy/paste from Frictional Games Script website. Gives me the same error message, except the numbers has changed to 55,2

I meant change this:
Code:
{
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

To something like this:
Code:
void FunctionNameHere()
{
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}



RE: Can't find my Custom Story - i3670 - 10-03-2011

It's suppose to look like this?

void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
{
AddEntityCollideCallback("Player", "Sound_5", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Sound_3", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "Music_1", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

Or do you mean this one?
void MyFunc(string &in asParent, string &in asChild, int alState)


RE: Can't find my Custom Story - Your Computer - 10-03-2011

(10-03-2011, 05:02 PM)i3670 Wrote: Or do you mean this one?
void MyFunc(string &in asParent, string &in asChild, int alState)

Most likely this. Also, you're missing a comma on line 8 and a quotation mark on line 10.


RE: Can't find my Custom Story - i3670 - 10-03-2011

Got the error msg again

main (55,1) instead

Forget what I said about that msg.

Got a new one after the changes.

main (51,56): ERR: Expected '('
main (52,63): ERR: Expected '('
main (53,61): ERR: Expected '('


RE: Can't find my Custom Story - Your Computer - 10-03-2011

(10-03-2011, 05:07 PM)i3670 Wrote: Got the error msg again

main (55,1) instead

I've edited my previous post, and replace "bool abResume" with either true or false from this:
Code:
PlayMusic("general_piano03.snt", false, 1, 2, 1, bool abResume);
PlayMusic("player_react_guardian3.snt", false, 1, 2, 1, bool abResume);
PlayMusic("scare_male_terrified4.ogg", true, 1, 2, 1, bool abResume);



RE: Can't find my Custom Story - i3670 - 10-03-2011

Woho the map works! Big Grin almost. My key doesn't work on my door.



RE: Can't find my Custom Story - Your Computer - 10-03-2011

(10-03-2011, 05:18 PM)i3670 Wrote: Woho the map works! Big Grin almost. My key doesn't work on my door.

Try replacing your first MyFunc function with this:
Code:
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}



RE: Can't find my Custom Story - i3670 - 10-03-2011

Don't I need to "bind" the key to a specific door for it to work?


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

How it looks atm


RE: Can't find my Custom Story - Your Computer - 10-03-2011

(10-03-2011, 05:38 PM)i3670 Wrote: Don't I need to "bind" the key to a specific door for it to work?


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

How it looks atm

The AddUseItemCallback function is what "binds" it to a door (entity). In your case, the door has to be called "Bedroom" and the key "Bedroomkey". However, you have "Key" in the AddUseItemCallback function.