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
Game keeps crashing.
Khan Offline
Member

Posts: 61
Threads: 12
Joined: Aug 2011
Reputation: 0
#1
Game keeps crashing.

My game keeps crashing when I try to test something out, its a script related problem, I know, but I dont know wat is wrong, I cant find wat is causing the problem, I was making a key for a door, and when I tried to test it, it crashed.

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("MetalKey", "Door1", "Func01", false);
}

void Func01(string &in asItem, string &in asEntity)
{
RemoveItem(MetalKey);
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{


It crashes and sais MetalKey is not defined. wtf?

}
08-25-2011, 07:12 PM
Find
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#2
RE: Game keeps crashing.

Have you made your extra-english file for the key?

+

SetSwingDoorLocked(asEntity, false, true);
should be
SetSwingDoorLocked("Door1", false, true);

...
08-25-2011, 07:16 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#3
RE: Game keeps crashing.

You're wrong X4anco. Khan, try this:

void OnEnter()
{
     AddUseItemCallback("MetalKey", "Door1", "Func01", false);
}
void Func01(string &in asItem, string &in asEntity)
{
     RemoveItem(asItem);
     SetSwingDoorLocked(asEntity, false, true);
     PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
}

08-25-2011, 07:22 PM
Find
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#4
RE: Game keeps crashing.

Whooops Big Grin

...
08-25-2011, 07:25 PM
Find
Khan Offline
Member

Posts: 61
Threads: 12
Joined: Aug 2011
Reputation: 0
#5
RE: Game keeps crashing.

Still crashed Sad
08-25-2011, 09:44 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#6
RE: Game keeps crashing.

Alright, I know why, It's because there's no OnStart function. xD

void OnStart()
{
     AddUseItemCallback("MetalKey", "Door1", "Func01", false);
}
void Func01(string &in asItem, string &in asEntity)
{
     RemoveItem(asItem);
     SetSwingDoorLocked(asEntity, false, true);
     PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
}

08-25-2011, 10:10 PM
Find




Users browsing this thread: 1 Guest(s)