QysteiN
Junior Member
Posts: 45
Threads: 6
Joined: Nov 2011
Reputation:
0
|
Can anyone spot the problem?
The first key is working but the second aint.
Can anyone spot what ive done wrong?
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "castle_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("awesomekey_1");
}
AddUseItemCallback("", "Awesomekey_2", "Level_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Level_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("Awesomekey_2");
}
I make YouTube videos and I'm currently working on a Amnesia custom story.
|
|
02-15-2012, 11:28 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Can anyone spot the problem?
You have two of the same function. Change the name of the second one and the second AddUseItemCallback line.
|
|
02-15-2012, 11:32 AM |
|
QysteiN
Junior Member
Posts: 45
Threads: 6
Joined: Nov 2011
Reputation:
0
|
RE: Can anyone spot the problem?
(02-15-2012, 11:32 AM)palistov Wrote: You have two of the same function. Change the name of the second one and the second AddUseItemCallback line. Excuse me, I dont really get what your trying to say :p
Mind giving me an example?
I make YouTube videos and I'm currently working on a Amnesia custom story.
|
|
02-15-2012, 11:42 AM |
|
jens
Frictional Games
Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation:
202
|
RE: Can anyone spot the problem?
This should work.
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "castle_1", "KeyOnDoor", true);
AddUseItemCallback("", "Awesomekey_2", "Level_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}
|
|
02-15-2012, 11:49 AM |
|
QysteiN
Junior Member
Posts: 45
Threads: 6
Joined: Nov 2011
Reputation:
0
|
RE: Can anyone spot the problem?
thanks the key worked.
Okay, so I want to use my second map when they enter that door.
Do you by any chance know how to script it?
I make YouTube videos and I'm currently working on a Amnesia custom story.
|
|
02-15-2012, 12:17 PM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: Can anyone spot the problem?
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded
c:
(This post was last modified: 02-15-2012, 12:30 PM by flamez3.)
|
|
02-15-2012, 12:30 PM |
|
Dexakita
Junior Member
Posts: 11
Threads: 2
Joined: Jan 2012
Reputation:
0
|
RE: Can anyone spot the problem?
(02-15-2012, 12:30 PM)flamez3 Wrote: ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded
c: What..? D: Again, I'm stupid, so.. I don't understand what you meant? ._.
Quote:The logic is erratic, potato in a jacket, toys in the attic.
|
|
02-15-2012, 12:43 PM |
|
QysteiN
Junior Member
Posts: 45
Threads: 6
Joined: Nov 2011
Reputation:
0
|
RE: Can anyone spot the problem?
Im working with her ^
We're both stupid D:
I make YouTube videos and I'm currently working on a Amnesia custom story.
|
|
02-15-2012, 12:50 PM |
|
jens
Frictional Games
Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation:
202
|
RE: Can anyone spot the problem?
Check tutorials on wiki.frictionalgames.com you'll need some basic knowledge of how script works and how to work with it.
|
|
02-15-2012, 12:56 PM |
|
Dexakita
Junior Member
Posts: 11
Threads: 2
Joined: Jan 2012
Reputation:
0
|
RE: Can anyone spot the problem?
(02-15-2012, 12:56 PM)jens Wrote: Check tutorials on wiki.frictionalgames.com you'll need some basic knowledge of how script works and how to work with it. Thank you! We'll read a bit more then bother you another time ^_^
Quote:The logic is erratic, potato in a jacket, toys in the attic.
|
|
02-15-2012, 01:18 PM |
|
|