Frictional Games Forum (read-only)
Use item in other levels - 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: Use item in other levels (/thread-15019.html)

Pages: 1 2


RE: Use item in other levels - FlawlessHappiness - 04-24-2012

I tried what you did, with no luck... Now there is only the use script in the level where it is used
I looked in the engine scripts and in the:
Quote:GiveItem("", "glass_container_mix_done", "fiskeolie", "glass_container_mix_done.tga", 1);
I made the subItemType "fiskeolie" and that was what i used in the scripts... guess that was wrong...
i tried with "glass_container_mix_done" and made it look like this:
Quote:void OnStart ();
{
AddUseItemCallback("", "glass_container_mix_done", "gryde1", "UseItemOnArea", true);
}

void UseItemOnArea(string &in asItem, string &in asEntity)
{
SetEntityActive("Fiskeolie_static_1", true);
SetSwingDoorLocked("mansion_5", true, true);
StartPlayerLookAt("mansion_8", 10, 10, "");
AddTimer("", 0.3, "LookAtDoor_1");
RemoveItem("glass_container_mix_done ");
}
Still it doesnt work...



RE: Use item in other levels - Cranky Old Man - 04-24-2012

(04-24-2012, 06:51 PM)beecake Wrote:
Quote:void OnStart*1()*2
{
AddUseItemCallback("", "glass_container_mix_done", "gryde1", "UseItemOnArea", true);
}

void UseItemOnArea(string &in asItem, string &in asEntity)
{
SetEntityActive("Fiskeolie_static_1", true);
SetSwingDoorLocked("mansion_5", true, true);
StartPlayerLookAt("mansion_8", 10, 10, "");
AddTimer("", 0.3*3, "LookAtDoor_1");
RemoveItem("glass_container_mix_done*4");
}
Still it doesnt work...
*1 = Remove space.
*2 = Remove the semi-colon here!
*3 = Add f when dealing with floating numbers.
*4 = Remove space.




RE: Use item in other levels - FlawlessHappiness - 04-24-2012

Sorry 1, 2 and 4 was just fails i did when i wrote it here... I changed the 3... it still says: "Cannot use item this way"...


RE: Use item in other levels - Cranky Old Man - 04-24-2012

(04-24-2012, 07:37 PM)beecake Wrote: Sorry 1, 2 and 4 was just fails i did when i wrote it here... I changed the 3... it still says: "Cannot use item this way"...
You WROTE it here?? Have you heard of Ctrl-C and Ctrl-V?

Edit: I can't figure out what's wrong. If it says that you can't use the item that way, then that means that the parameters in the callback is wrong. Grammatically they check out, so I'm thinking it has to be that you haven't named the entities "glass_container_mix_done" or "gryde1".

Edit 2: Are you sure that the callback works for interacting with an AREA? It's mainly designed for entities.


RE: Use item in other levels - FlawlessHappiness - 04-24-2012

No no i didn't write it all... Just the top thingy, void OnStart()

Anyway i solved in another way. By making a pickup-able item appear when you use the item on an entity, instead of making the script give the item to the player... then i could add an item name, and subtype name myself Smile

EDIT: Okay i got what i did wrong.
My script was:
GiveItem("", "glass_container_mix_done", "fiskeolie", "glass_container_mix_done.tga", 1);
But hey i missed a spot!
GiveItem("[MISSING SPOT]", "glass_container_mix_done", "fiskeolie", "glass_container_mix_done.tga", 1);

I should have put the internal name in there... then the function would work! Big Grin