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
Error Hps
ZIEGMEBALLEN Offline
Junior Member

Posts: 18
Threads: 4
Joined: Feb 2014
Reputation: 1
#1
Error Hps

Amnesia says that Script not Valid
Error ( 10,1) Unexpected token.. How to fix this ?

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "SecondRoomKey_1", "SecondRoom_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "Corridorkey_1", "Level_2", "UsedKeyOnDoor", true);
}

void Teleport1(string &in asParent, string &in asChild, int alStates);
{

AddEntityCollideCallback("Player", "Script_1", "Teleport1", true, 1);
SetEntityActive("TeleportingNG_1", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportingNG_1", 0, false);
AddPropForce("TeleportingNG_1", -10000, 0, 0, "world");

}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("SecondRoom_1", false, true);
SetSwingDoorLocked("Level_2", false, true);
PlaySoundAtEntity("", "unlock_door", "SecondRoom_1", 0, false);
PlaySoundAtEntity("", "unlock_door", "Level_2", 0, false);
RemoveItem("SecondRoomKey_1");
RemoveItem("Corridorkey_1");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Sad
02-26-2014, 10:00 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Error Hps

You have a semi-colon at the end of this contructor:
void Teleport1(string &in asParent, string &in asChild, int alStates);

Remove that.

Also, this thread should be in CS Development > Development Support.

02-26-2014, 10:06 AM
Find
ZIEGMEBALLEN Offline
Junior Member

Posts: 18
Threads: 4
Joined: Feb 2014
Reputation: 1
#3
RE: Error Hps

(02-26-2014, 10:06 AM)Mudbill Wrote: You have a semi-colon at the end of this contructor:
void Teleport1(string &in asParent, string &in asChild, int alStates);

Remove that.

Also, this thread should be in CS Development > Development Support.

Yes! Thank you. It finally worked, but my jump scare didn't it's on the script.

void Teleport1(string &in asParent, string &in asChild, int alStates)
{
AddEntityCollideCallback("Player", "Script_1", "Teleport1", true, 1);
SetEntityActive("TeleportingNG_1", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportingNG_1", 0, false);
AddPropForce("TeleportingNG_1", -10000, 0, 0, "Player");
}

How do i make this work ? And by the way i loved your videos , i subscribed you Smile
02-26-2014, 10:18 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Error Hps

You can't call the collision callback within itself or else it never starts. You need to move the AddEntityCollideCallback somewhere else, probably to OnStart.

02-26-2014, 10:50 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#5
RE: Error Hps

At the end of your void, remove the s from the "states", so it becomes:

PHP Code: (Select All)
void Teleport1(string &in asParentstring &in asChildint alState

And as Mudbill said:
You should also put that AddEntityCollideCallback in your OnStart()

Discord: Romulator#0001
[Image: 3f6f01a904.png]
02-26-2014, 10:52 AM
Find
ZIEGMEBALLEN Offline
Junior Member

Posts: 18
Threads: 4
Joined: Feb 2014
Reputation: 1
#6
RE: Error Hps

(02-26-2014, 10:50 AM)Mudbill Wrote: You can't call the collision callback within itself or else it never starts. You need to move the AddEntityCollideCallback somewhere else, probably to OnStart.

Okay it worked now, my jumpscare appear.. Anyway sorry if i keep giving you problem at my script and i hope you'll have a best video and more subscribers.. Thanks Big Grin Big Grin .. if i have another problem please help me next time ... I'll rate your reputation
02-26-2014, 10:57 AM
Find




Users browsing this thread: 2 Guest(s)