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 doesnt work once again.
kartanonperuna Offline
Posting Freak

Posts: 755
Threads: 44
Joined: Oct 2011
Reputation: 8
#1
Script doesnt work once again.

Sorry for bothering all the time but reading all those scripting tutorials doesnt really help me.



////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("crowbar_joint_2", "crowcollide", "crowopen_func", true, 1);
AddUseItemCallback("", "crowbar_1", "prison_locked", "activatecrowdoor", true);
AddUseItemCallback("", "key_tomb_rusty", "cellar_wood01_slow", "KeyOnDoor", true);
AddUseItemCallback("", "key_torture_chamber_1", "hatch_metal01_1", "KeyOnDoor2", true);
AddUseItemCallback("", "key_study_1", "cellar_wood01_1", "KeyOnDoor3", true);
PlayMusic("humming ambient.ogg", true, 1.0f, 1.0f, 1, false);
AddEntityCollideCallback("Player", "TriggerArea1", "TriggerMonster", true, 1);
AddEntityCollideCallback("Player", "TriggerArea2", "TriggerMonster2", true, 1);
AddEntityCollideCallback("Player", "VoiceTrigger", "Prisoner", true, 1);
}

void Prisoner(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("prisoner edited.snt", "prisoner edited.snt", "Player", 94, true);
}

void TriggerMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_suitor_1", true);
}

void TriggerMonster2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_silent_1", true);
}

void KeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_1", 0, false);
RemoveItem("key_study_1");
}

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

}

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

}

It says "expected )" or something in somewhere 18th line.
01-09-2012, 09:11 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Script doesnt work once again.


I tried this script myself, it works fine. I only see 1 problem (if it is one that is) you would need to put _ in the spaces of prisoner edited.snt (this means in the actual files as well). Two more things:

1. Did you download a torrented version of Amnesia (sorry if I asked you this before, can't remember Smile )

2. I used notepad ++ and in two seconds I can find anything that is wrong with a script (to an extent), you should consider using it.

01-09-2012, 09:23 AM
Find
kartanonperuna Offline
Posting Freak

Posts: 755
Threads: 44
Joined: Oct 2011
Reputation: 8
#3
RE: Script doesnt work once again.

I use notepad +++ yes.I did pirate Amnesia at first but then I bought it.
01-09-2012, 09:25 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Script doesnt work once again.

Are you sure you are using the right version of Amnesia (the one you bought), cause I didn't get an error at all.

Also, in the menu of Notepad ++ go to Language, go to C and C++

(This post was last modified: 01-09-2012, 09:29 AM by flamez3.)
01-09-2012, 09:28 AM
Find
BlueFury Offline
Senior Member

Posts: 470
Threads: 30
Joined: May 2011
Reputation: 9
#5
RE: Script doesnt work once again.

You probably copied it wrong or you renamed/removed something in the editor.

Sticks and stones may break our bones, but words will break our hearts. – Robert Fulghum
01-09-2012, 09:53 AM
Find
kartanonperuna Offline
Posting Freak

Posts: 755
Threads: 44
Joined: Oct 2011
Reputation: 8
#6
RE: Script doesnt work once again.

Nah it works now.Thanks.
01-09-2012, 10:22 AM
Website Find




Users browsing this thread: 1 Guest(s)