Frictional Games Forum (read-only)
I need help fast - 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: I need help fast (/thread-21197.html)



I need help fast - MacKetchup - 04-17-2013

void OnStart()
{
AddUseItemCallback("", "nyckel", "mansion_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", true, false);
PlaySoundAtEntity("","unlock_door.snt", "mansion_1" ,0 ,false);
RemoveItem("nyckel");
GiveSanityBoostSmall();
}

void OnEnter(){
{
}


void OnLeave()
{
}


void OnGameStart(){ }
{
}

Whats wrong with the code , i could need some help i have tried this now for over 3 hours


RE: I need help fast - 7heDubz - 04-17-2013

(04-17-2013, 08:58 PM)MacKetchup Wrote: void OnStart()
{
AddUseItemCallback("", "nyckel", "mansion_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", true, false);
PlaySoundAtEntity("","unlock_door.snt", "mansion_1" ,0 ,false);
RemoveItem("nyckel");
GiveSanityBoostSmall();
}

void OnEnter(){
{
}


void OnLeave()
{
}


void OnGameStart(){ }
{
}

Whats wrong with the code , i could need some help i have tried this now for over 3 hours

VERY basic scripting error

void OnEnter(){
{
}


void OnLeave()
{
}


void OnGameStart(){ }
{
}

The highlighted text does not belong here. delete it from script. Your new script should look like this.

void OnStart()
{
AddUseItemCallback("", "nyckel", "mansion_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", true, false);
PlaySoundAtEntity("","unlock_door.snt", "mansion_1" ,0 ,false);
RemoveItem("nyckel");
GiveSanityBoostSmall();
}

void OnEnter()
{
}


void OnLeave()
{
}


void OnGameStart()
{
}


RE: I need help fast - Streetboat - 04-17-2013

void OnEnter() doesn't need that extra { after it, and void OnGameStart() is unnecessary, you can remove that whole section.

Ninja'd!
[Image: ninja.jpg]


RE: I need help fast - 7heDubz - 04-17-2013

I'm Blank.


RE: I need help fast - MacKetchup - 04-18-2013

The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.

Reguards MacKetchup

(04-18-2013, 04:05 PM)MacKetchup Wrote: The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.

Reguards MacKetchup
I Was stupid enough to change the hps to a diffrent name then the actual map , that was the problem, but thanks for the help

Reguards MacKetchup


RE: I need help fast - 7heDubz - 04-28-2013

(04-18-2013, 04:05 PM)MacKetchup Wrote: The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.

Reguards MacKetchup

(04-18-2013, 04:05 PM)MacKetchup Wrote: The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.

Reguards MacKetchup
I Was stupid enough to change the hps to a diffrent name then the actual map , that was the problem, but thanks for the help

Reguards MacKetchup

Haha, its okay i'm sure i've done something along those lines before as well Big Grin

Regards*