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
Can anyone spot the problem?
QysteiN Offline
Junior Member

Posts: 45
Threads: 6
Joined: Nov 2011
Reputation: 0
#1
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
Website Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
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
Find
QysteiN Offline
Junior Member

Posts: 45
Threads: 6
Joined: Nov 2011
Reputation: 0
#3
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? Smile

I make YouTube videos and I'm currently working on a Amnesia custom story.

02-15-2012, 11:42 AM
Website Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#4
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
Website Find
QysteiN Offline
Junior Member

Posts: 45
Threads: 6
Joined: Nov 2011
Reputation: 0
#5
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? Smile

I make YouTube videos and I'm currently working on a Amnesia custom story.

02-15-2012, 12:17 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
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
Find
Dexakita Offline
Junior Member

Posts: 11
Threads: 2
Joined: Jan 2012
Reputation: 0
#7
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
Find
QysteiN Offline
Junior Member

Posts: 45
Threads: 6
Joined: Nov 2011
Reputation: 0
#8
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
Website Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#9
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
Website Find
Dexakita Offline
Junior Member

Posts: 11
Threads: 2
Joined: Jan 2012
Reputation: 0
#10
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
Find




Users browsing this thread: 1 Guest(s)