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
Can't for the problem with the unexpected token [SOLVED]
Pinkamena Diane Pie Offline
Junior Member

Posts: 5
Threads: 2
Joined: Jun 2012
Reputation: 0
#1
Can't for the problem with the unexpected token [SOLVED]

This is solved, thank you.
I kind of just started scripting and map making yesterday, keep it clean and simple for a small newbie, thanks.



Anyway, In my map, I want to create a small door slam scare. But I keep getting an error when testing the map, I think its just a mishap somewhere in the script. I also have a key, and a crowbar function in here, possibly interfering? I hope that isnt the case.



The error ATM is saying: 40, 1: ERR: Unexpected Token {



From that, it sounds like just some stupid mistake, but the help would be appreciated.



Here is my hsp.:



///////////////////////////

// Run when the map starts

void OnStart()

{

AddUseItemCallback("", "crowbar", "crowbardoor", "UsedCrowbarOnDoor", true);

AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);

}





void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)

{

AddTimer("", 0.2, "TimerSwitchShovel");

RemoveItem("crowbar");

}



void TimerSwitchShovel(string &in asTimer)

{

PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);

SetEntityActive("crowbar_joint_1", true);

}





void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)

{

AddPlayerSanity(25);

PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);

SetSwingDoorLocked("crowbardoor", false, true);

AddPropImpulse("crowbardoor", 0, 0, -50, "World");

SetSwingDoorDisableAutoClose("crowbardoor", true);

SetSwingDoorClosed("crowbardoor", false, false);

SetMoveObjectState("crowbardoor", 1);

PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);

CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);

SetEntityActive("crowbar_joint_1", false);

SetLocalVarInt("Door", 1);

}



///////////////////////////



{

SetEntityPlayerInteractCallback("slamdoor", "func_slam", true);

}

void func_slam(string &in asParent, string &in asChild, int alState)

{

SetPropHealth("slamdoor", 0.0f);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);

}



////////////////////////////

// Run when entering map

void OnEnter()



{

AddUseItemCallback("", "key1", "lockeddoor1", "unlock", true);

}



void unlock(string &in item, string &in door)



{

SetSwingDoorLocked(door, false, true);

PlaySoundAtEntity("", "unlock_door", door, 0, false);

RemoveItem(item);

}



////////////////////////////

// Run when leaving map

void OnLeave()

{



}
(This post was last modified: 06-18-2012, 04:42 PM by Pinkamena Diane Pie.)
06-18-2012, 04:06 PM
Find


Messages In This Thread
Can't for the problem with the unexpected token [SOLVED] - by Pinkamena Diane Pie - 06-18-2012, 04:06 PM



Users browsing this thread: 1 Guest(s)