Unexpected Token - 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: Unexpected Token (/thread-20682.html) |
Unexpected Token - ZeMaster091 - 03-10-2013 This is my .hps //////////////////////////// // Run first time starting map void OnStart() { AddUseItemCallback(""e, "hollow_needle_1", "First_Door", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("First_Door", false, true); PlaySoundAtEntity("", "unlock_door", "First_Door", 0, false); RemoveItem("hollow_needle_1"); } { AddEntityCollideCallback("Player", "SlamDoor", "CollideRoomTwo", true, 1); } void CollideRoomTwo(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("First_Door", true, true); } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } How can I fix this? RE: Unexpected Token - PutraenusAlivius - 03-10-2013 You put the AddEntityCollideCallback part to the void OnStart() section. RE: Unexpected Token - ZeMaster091 - 03-10-2013 I'm confused. I'm trying to do what you say but I'm still getting errors RE: Unexpected Token - PutraenusAlivius - 03-10-2013 (03-10-2013, 12:52 AM)ZeMaster091 Wrote: I'm confused. I'm trying to do what you say but I'm still getting errors In the script, there should be a part that say PHP Code: void OnStart() Put the PHP Code: { PHP Code: void OnStart() For Example: Tutorial says AddEntityCollideCallback to spawn a monster when you collide with it. Script on tutorial (in the void OnStart() part.) says this. PHP Code: AddEntityCollideCallback("Player", "Door", "PlayerCollide", true, 1); PHP Code: AddUseItemCallback("", "Jar of Acid", "Door2", "DestroyDoor", true); Since you can't have to void OnStart()'s, just put the AddEntityCollideCallback and AddUseItemCallback to your void OnStart() part. RE: Unexpected Token - ZeMaster091 - 03-10-2013 (03-10-2013, 01:12 AM)JustAnotherPlayer Wrote:(03-10-2013, 12:52 AM)ZeMaster091 Wrote: I'm confused. I'm trying to do what you say but I'm still getting errors OH. I get it now. Thanks a lot! RE: Unexpected Token - PutraenusAlivius - 03-10-2013 (03-10-2013, 01:15 AM)ZeMaster091 Wrote:I also edited my post with good explanation. Check it out.(03-10-2013, 01:12 AM)JustAnotherPlayer Wrote:(03-10-2013, 12:52 AM)ZeMaster091 Wrote: I'm confused. I'm trying to do what you say but I'm still getting errors RE: Unexpected Token - ExpectedIdentifier - 03-10-2013 You have an AddEntityCollideCallback inbetween brackets with no function before the bracket. You have a random e outside two "" under OnStart(). Learn the basics of scripting before trying to script. RE: Unexpected Token - PutraenusAlivius - 03-10-2013 (03-10-2013, 02:14 AM)sonataarctica Wrote: You have an AddEntityCollideCallback inbetween brackets with no function before the bracket. You just posted this without seeing the posts above you. RE: Unexpected Token - ExpectedIdentifier - 03-10-2013 (03-10-2013, 02:16 AM)JustAnotherPlayer Wrote:(03-10-2013, 02:14 AM)sonataarctica Wrote: You have an AddEntityCollideCallback inbetween brackets with no function before the bracket. Oh yeah. It's been a long day, I'm tired. Sorry. |