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
I need help fast
MacKetchup Offline
Junior Member

Posts: 25
Threads: 10
Joined: Apr 2013
Reputation: 0
#1
I need help fast

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
04-17-2013, 08:58 PM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#2
RE: I need help fast

(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()
{
}

(This post was last modified: 04-17-2013, 09:09 PM by 7heDubz.)
04-17-2013, 09:07 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#3
RE: I need help fast

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]

[Image: signature-2.png]
(This post was last modified: 04-17-2013, 09:09 PM by Streetboat.)
04-17-2013, 09:07 PM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#4
RE: I need help fast

I'm Blank.

(This post was last modified: 01-12-2014, 08:47 AM by 7heDubz.)
04-17-2013, 09:10 PM
Find
MacKetchup Offline
Junior Member

Posts: 25
Threads: 10
Joined: Apr 2013
Reputation: 0
#5
RE: I need help fast

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
(This post was last modified: 04-18-2013, 04:10 PM by MacKetchup.)
04-18-2013, 04:05 PM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#6
RE: I need help fast

(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*

(This post was last modified: 09-03-2015, 05:39 AM by 7heDubz.)
04-28-2013, 10:05 PM
Find




Users browsing this thread: 2 Guest(s)