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");
}
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)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?
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);
}
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?
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:
(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? ._.
Im working with her ^
We're both stupid D:
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)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 ^_^