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
Script problem!
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#1
Script problem!

Uhmm... sorry to disturb but i dont know what is wrong now?

void OnEnter()
{
AddUseItemCallback("", "Office Key", "Office Door", "KeyOnDoor", true);
}

Actual Functions ////

-> line 46,1 void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Office Door", false, true);
RemoveItem("Office Key");
PlaySoundAtEntity("", "unlock_door.snt", "Office Door", 0.0f, true);
}

void scareactivate(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Waterlurker" , true);
AddEnemyPatrolNode("Waterlurker", "PathNodeArea_1", 0.0f, "true");
}

I get error main (46,1) ERROR: Expected '(' Where is that?

Im confused..

“Life is a game, play it”
12-24-2010, 05:58 PM
Find
adamhun Offline
Junior Member

Posts: 34
Threads: 4
Joined: Dec 2010
Reputation: 0
#2
RE: Script problem!

Try to put the // BEFORE the comment, not after Smile
like this:
// Actual functions

-Retired-
12-24-2010, 06:05 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#3
RE: Script problem!

WHY YOU NO GOT NOTEPAD++

There has to be a syntax error somewhere above line 46, so you better post that part of the script because all the stuff you posted now seems to be correct.

Welp, I thought that Actual Functions-part didn't even belong to the script. adamhun is right, the game now thinks Actual Functions is something script related and now waits for the variables it should use in the ()-brackets, like in a normal void function()-syntax, I think.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
(This post was last modified: 12-24-2010, 06:07 PM by Frontcannon.)
12-24-2010, 06:05 PM
Find
Dark88 Offline
Junior Member

Posts: 48
Threads: 6
Joined: Dec 2010
Reputation: 0
#4
RE: Script problem!

(12-24-2010, 05:58 PM)HumiliatioN Wrote: Uhmm... sorry to disturb but i dont know what is wrong now?

void OnEnter()
{
AddUseItemCallback("", "Office Key", "Office Door", "KeyOnDoor", true);
}

Actual Functions ////

-> line 46,1 void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Office Door", false, true);
RemoveItem("Office Key");
PlaySoundAtEntity("", "unlock_door.snt", "Office Door", 0.0f, true);
}

void scareactivate(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Waterlurker" , true);
AddEnemyPatrolNode("Waterlurker", "PathNodeArea_1", 0.0f, "true");
}

I get error main (46,1) ERROR: Expected '(' Where is that?

Im confused..

One thing, you have true in quotations in your AddEnemyPatrolNode. That might be causing you're error I always get weird explanations for errors that are entirely for a different reason.

EDIT: And of course what the previous two posters said.
(This post was last modified: 12-24-2010, 06:09 PM by Dark88.)
12-24-2010, 06:06 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#5
RE: Script problem!

(12-24-2010, 06:05 PM)Frontcannon Wrote: WHY YOU NO GOT NOTEPAD++

There has to be a syntax error somewhere above line 46, so you better post that part of the script because all the stuff you posted now seems to be correct.

Welp, I thought that Actual Functions-part didn't even belong to the script. adamhun is right, the game now thinks Actual Functions is something script related and now waits for the variables it should use in the ()-brackets, like in a normal void function()-syntax, I think.

Just asking frontcannon you are always mad peoples who are in trouble this is helping forum for christ sake! People learn slow... everybody is not like you.. Pro at scripting.. But thanks anyway i will try it! PS: I have Notepad++
(12-24-2010, 06:05 PM)adamhun Wrote: Try to put the // BEFORE the comment, not after Smile
like this:
// Actual functions

Lol im stupid thanks!! Wink It works now!

“Life is a game, play it”
(This post was last modified: 12-24-2010, 06:13 PM by HumiliatioN.)
12-24-2010, 06:10 PM
Find
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#6
RE: Script problem!

It's just frustrating to see how many 'scripting' problems come down to a missed comma / semicolon /...

Good to hear that you started to use Notepad++ now, but it won't be of great use until you did this. Trust me, it is well worth it.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
12-24-2010, 06:29 PM
Find
Dark88 Offline
Junior Member

Posts: 48
Threads: 6
Joined: Dec 2010
Reputation: 0
#7
RE: Script problem!

(12-24-2010, 06:29 PM)Frontcannon Wrote: It's just frustrating to see how many 'scripting' problems come down to a missed comma / semicolon /...

Good to hear that you started to use Notepad++ now, but it won't be of great use until you did this. Trust me, it is well worth it.

I've been using Notepad++ this entire time and didn't know I could add the stuff from your link. Thanks for pointing it out. Big Grin Much better than what I was doing which was just using C++ language selection just to help things show up.
12-24-2010, 07:18 PM
Find
Mardukpainkiller Offline
Junior Member

Posts: 6
Threads: 0
Joined: Jul 2011
Reputation: 0
#8
RE: Script problem!

Well I have this proplem with this script at the start it works fine but at the end...


void OnStart()
{
CheckPoint ("player", "GoToPrison_1", "WakeUp", "Hints", "HintUn"); <-Works
StopMusic(2, 0); <-Works
PlayMusic("06_amb.ogg", true, 0.7, 5, 0, false); <-Works
AddEntityCollideCallback("Player", "HuntStart_1", "Hunt_Monster", true, 1);
AddUseItemCallback("", "crowbar_1", "prison_1","UseCrowbarOnDoor", true);
AddUseItemCallback("", "Cyrle_Wood_1", "safety_large_vert_1","OpenBigDoor1", true);
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
}
THIS Part DOES NOT WORK!!HELP!!!!
void Endstart_1(string &in asParent, string &in asChild, int alState)
{
AddTimer("Endstart_timer_1", 0.2, "Endstart_timer_1_End");
}
void Endstart_timer_1_End(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
SetEntityActive("servant_grunt_2", false);
SetEntityActive("castle_gate_arched01_1", true);
SetEntityActive("castle_gate_arched01_open_1", false);
PlaySoundAtEntity("","close_gate", "castle_gate_arched01_1", 0, false);
StopMusic(2, 0);
PlayMusic("29_amb_end_soft.ogg", true, 0.7, 5, 0, false);
}

void Endclose_2(string &in asParent, string &in asChild, int alState)
{
AddTimer("Endclose_timer_2", 0.2, "Endclose_timer_2_End");
}
void Endclose_timer_2_End(string &in asTimer)
{
StartCredits("29_event_end.ogg", false, "End", "Credits", 1);
}
void GruntFind(string &in asParent, string &in asChild, int alState)
{
ShowEnemyPlayerPosition("servant_grunt_1");
ShowEnemyPlayerPosition("servant_grunt_2");
}

void Hunt_Monster(string &in asParent, string &in asChild, int alState)
{
ShowEnemyPlayerPosition("servant_brute_1");
SetSwingDoorClosed("mansion_1", false,false);
StopMusic(2, 0);
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.1, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.1, "");
GiveSanityDamage(5, true);
PlayGuiSound("react_scare", 1.0f);
PlayMusic("08_amb.ogg", true, 0.7, 5, 1, false);

}
void WakeUp(string &in asName, int alCount)
{
AddEntityCollideCallback("player", "Try_escape_1", "GruntFind", true, 1);
AddEntityCollideCallback("player", "End_start_1", "Endstart_1", true, 1);
AddEntityCollideCallback("player", "End_end_1", "Endclose_2", true, 1);
StopMusic(2, 0);
StopMusic(2, 1);
PlayMusic("Diablo_II_Caves.ogg", true, 0.7, 5, 0, false);
RemoveItem("lantern_1");
}
void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer(asEntity, 0.2, "TimerSwitchShovel");
PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);
RemoveItem("crowbar_1");
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("attachshovel","puzzle_place_jar.snt", "Player", 0, false);

SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
GiveSanityBoostSmall();


SetSwingDoorLocked("prison_1", false, false);
SetSwingDoorDisableAutoClose("prison_1", true);
SetSwingDoorClosed("prison_1", false,false);

PlaySoundAtEntity("","break_wood_metal", "prison_1", 0, false);
AddPropImpulse("prison_1", 0, -3, 0, "world");

SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_dyn_1", true);
}
void TimerPushDoor(string &in asTimer)
{
AddPropImpulse("prison_1", -1, -4, 2, "world");
AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}

void TimerDoorCanClose(string &in asTimer)
{
SetSwingDoorDisableAutoClose("prison_1", false);
}
void OpenBigDoor1(string &in asItem, string &in asEntity)
{
ConnectEntities("","elevator_lever_1","safety_large_vert_1", true, -1, "OpenBigdoor");
AddUseItemCallback("", "Cyrle_Wood_1", "safety_large_vert_1","OpenBigDoor2", true);
PlaySoundAtEntity("safety_large_vert_1","crank_old_stuck.snt", "Player", 0, false);
RemoveItem("Cyrle_Wood_1");
}
void OpenBigdoor(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "Cell_Guard_Path_4", 0.1, "");
AddEnemyPatrolNode("servant_grunt_1", "Cell_Guard_Path_3", 0.1, "");
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "Cell_Guard_Path_2", 0.1, "");
AddEnemyPatrolNode("servant_grunt_2", "Cell_Guard_Path_3", 0.1, "");
SetSwingDoorClosed("safety_large_vert_1", false, true);
SetLeverStuckState("elevator_lever_1", -1, true);
SetMessage("Hints", "HintEscape", 10.0f);
}
(This post was last modified: 07-17-2011, 05:15 PM by Mardukpainkiller.)
07-17-2011, 05:09 PM
Find




Users browsing this thread: 2 Guest(s)