Some newbie scripting help needed.
Hi,
I've recently been getting into making custom stories for Amnesia, since i'm still learning I'm just making maps for experimental purposes and so that I can learn all of the elements needed to make a full-fledged custom story.
However, this is the first time I've had to use scripting and I've been - although I can hold my own thanks to the amount of tutorials out there - stuck on this one issue that I've had for quite some time now.
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "endlevelkey_1", "enddoor_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("enddoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "enddoor_1", 0, false);
RemoveItem("endlevelkey_1");
}
AddEntityCollideCallback("Player", "teleportscript", "teleport", true, 1);
void teleport(string& asParent, string &in asChild, int alStates)
{
SetEntityActive("teleportingnakedguy", true);
AddPropForce("teleportingnakedguy", 0, 0, -10000, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "teleportingnakedguy", 0, false);
}
As you can see, I have scripting for a door+key, and a teleporting naked guy trap, these two both work on their own, however when I put them together I get this error;
FATAL ERROR: Could not load script file 'custom_stories/Corridor/maps/00_Corridor_1.hps'!
main (13,25): ERR : Expected identifier.
I've toyed with it somewhat and this is the best I've come up with.
Can anybody help me fix my mistake and possibly teach me how to have two or more scripts in the same file operate correctly?
Thanks.
(This post was last modified: 07-11-2012, 08:26 PM by HandsomeGaren.)
|