Khan
Member
Posts: 61
Threads: 12
Joined: Aug 2011
Reputation:
0
|
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 |
|
X4anco
Member
Posts: 157
Threads: 66
Joined: Apr 2011
Reputation:
0
|
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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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 |
|
X4anco
Member
Posts: 157
Threads: 66
Joined: Apr 2011
Reputation:
0
|
RE: Game keeps crashing.
Whooops
...
|
|
08-25-2011, 07:25 PM |
|
Khan
Member
Posts: 61
Threads: 12
Joined: Aug 2011
Reputation:
0
|
RE: Game keeps crashing.
Still crashed
|
|
08-25-2011, 09:44 PM |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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 |
|
|