Frictional Games Forum (read-only)
Can anyone spot the problem? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Can anyone spot the problem? (/thread-13354.html)



Can anyone spot the problem? - QysteiN - 02-15-2012

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");

}



RE: Can anyone spot the problem? - palistov - 02-15-2012

You have two of the same function. Change the name of the second one and the second AddUseItemCallback line.


RE: Can anyone spot the problem? - QysteiN - 02-15-2012

(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


RE: Can anyone spot the problem? - jens - 02-15-2012

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);

}



RE: Can anyone spot the problem? - QysteiN - 02-15-2012

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


RE: Can anyone spot the problem? - flamez3 - 02-15-2012

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:


RE: Can anyone spot the problem? - Dexakita - 02-15-2012

(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? ._.


RE: Can anyone spot the problem? - QysteiN - 02-15-2012

Im working with her ^
We're both stupid D:


RE: Can anyone spot the problem? - jens - 02-15-2012

Check tutorials on wiki.frictionalgames.com you'll need some basic knowledge of how script works and how to work with it.



RE: Can anyone spot the problem? - Dexakita - 02-15-2012

(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 ^_^