The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Some newbie scripting help needed.
HandsomeGaren Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jul 2012
Reputation: 0
#1
Question  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.)
07-11-2012, 04:25 PM
Find


Messages In This Thread
Some newbie scripting help needed. - by HandsomeGaren - 07-11-2012, 04:25 PM
RE: Some newbie scripting help needed. - by Vyzor - 07-11-2012, 10:49 PM



Users browsing this thread: 2 Guest(s)