Frictional Games Forum (read-only)
[SCRIPT] Help With Script Functions Not Working - 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: [SCRIPT] Help With Script Functions Not Working (/thread-16733.html)



Help With Script Functions Not Working - heyitsrobert97 - 07-04-2012

Hi, I've been making a part of my map but i cannot pass it as some parts of the script are not working.

-------------------------------------
When You Place the Jar in the Area it Unsticks the wheel and then you can turn it. then there is a flash and oil filled the jar. then you pick it up. However when i place the jar, i can move the wheel but it doesn't do anything :/

void placeemptyjar(string &in asItem, string &in asEntity)
{
SetEntityActive("glass_container_static", true);
SetEntityInteractionDisabled("glass_container_static", true);
SetEntityConnectionStateChangeCallback("iron_crank_1", "openoil");
SetWheelInteractionDisablesStuck("iron_crank_1", true);
}

void openoil(string &in asEntity, int alState)
{
if (alState == 1)
{
StartEffectFlash(0.8f, 0.6f, 3.5f);
PlaySoundAtEntity("", "16_oil_drip.snt", "special_shrine_altar_1", 0.0f, false);
SetEntityActive("glass_container_static", false);
SetEntityActive("glass_container_oil", true);
return;
}
}

------------------------------
3: i'm unsure if this will work becuse i haven't been upto it because of scripts before it failing but. You Use Item On Pipe. It removes from inventory and adds local var int 1. and what i want to happen is a message saying' one more item to go' when there is 1 variable and 'thats all items' when there are 2 variables.

void sendoil(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("drop_oil", false);
AddLocalVarInt("items", 1);
func01();
}

void sendmeat(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("drop_meat", false);
AddLocalVarInt("items", 1);
func01();
}

void func01()
{
if(GetLocalVarInt("items") == 1)
{
PlaySoundAtEntity("", "george_test_1_half.snt", "Player", 0, true);
}

else

if(GetLocalVarInt("items") == 2)
{
PlaySoundAtEntity("", "george_test_1_complete.snt", "Player", 0, true);
AddTimer("oildrop", 9.0f, "spawnoil");
SetEntityInteractionDisabled("chest_lantern", true);
}
}
----------------------


RE: Help With Script Functions Not Working - Cruzore - 07-04-2012

For your first problem, there is nothing wrong with it, I tested it myself(the InteractionDisabled part only of course). Make sure you chose the "fresh_meat" under entites>item, and make sure the name matches.


RE: Help With Script Functions Not Working - heyitsrobert97 - 07-04-2012

(07-04-2012, 05:06 PM)FastHunteR Wrote: For your first problem, there is nothing wrong with it, I tested it myself(the InteractionDisabled part only of course). Make sure you chose the "fresh_meat" under entites>item, and make sure the name matches.
Yeah I don't think you can reverse the InteractionDisabled so i just made anotherone appear for the 6 seconds then it disappears and the real one shows up without Interaction Disabled. Smile


RE: Help With Script Functions Not Working - Cruzore - 07-04-2012

for me it worked, I placed 1 meat somewhere, used it with the fireplace, that meat dissapears and a new one appears over the fire, with interaction disabled, and after some seconds you can pick it up.

for your second problem, you should delete the
return;
and make sure the wheel starts in state 0