Frictional Games Forum
Help Please with Scripting - Printable Version

+- Frictional Games Forum (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: Help Please with Scripting (/thread-14380.html)

Pages: 1 2


RE: Help Please with Scripting - abe.lloyd - 03-31-2012

it says cannotuseItem this way


RE: Help Please with Scripting - flamez3 - 03-31-2012

You are not understanding what I am saying.

void OnStart()

{

AddUseItemCallback("", "key_1", "level_celler_1", "UnlockLevelDoor", true);

}


void UnlockLevelDoor(string &in asItem,string &in asEntity)

{

SetLevelDoorLocked(asEntity, false);

RemoveItem(asItem);

}


That's his correct code. But if he puts the function in void OnLeave() (like he did) instead of void OnStart the function won't be linked the the callback in void OnStart.
(03-31-2012, 04:43 PM)abe.lloyd Wrote: it says cannotuseItem this way
If it says cannot use item this way it means you have not saved it or are not naming the things correctly. It works perfectly on my computer.


RE: Help Please with Scripting - abe.lloyd - 03-31-2012

il check all the names

Do i have t reaname things then



RE: Help Please with Scripting - flamez3 - 03-31-2012

Rename your key to
key_1 and the door to
level_celler_1


RE: Help Please with Scripting - abe.lloyd - 04-01-2012

still saying cannotuseItem this way do i need to change the customitemsubname


RE: Help Please with Scripting - flamez3 - 04-01-2012

No you don't. Delete any .map_cache's and make sure that you have set up the correct folders for the maps.


RE: Help Please with Scripting - abe.lloyd - 04-01-2012

do u have skype