Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Help With Script Functions Not Working
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#1
Help With Script Functions Not Working

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

This Darn House! , Four Doors, Youtube
(This post was last modified: 07-04-2012, 05:05 PM by heyitsrobert97.)
07-04-2012, 04:43 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Help With Script Functions Not Working

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.

Think, before you speak Google, before you post
07-04-2012, 05:06 PM
Find
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#3
RE: Help With Script Functions Not Working

(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

This Darn House! , Four Doors, Youtube
07-04-2012, 05:14 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#4
RE: Help With Script Functions Not Working

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

Think, before you speak Google, before you post
(This post was last modified: 07-04-2012, 05:32 PM by Cruzore.)
07-04-2012, 05:23 PM
Find




Users browsing this thread: 1 Guest(s)