Frictional Games Forum (read-only)

Full Version: cogwheel/elevatormachine
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi
in my map, i have a elevator machine which put elevator working.
That needs 3 cogwheels, but cogwheel mounted 2 not working it dosen,t stick on the machine please help i wanted the machine working and my custom story ready for release.Big Grin
Could you post some screenshots from your level and the script you tried? Remember that you need to use Sticky Areas to attach a cogwheel to the machine.
here is the script
void OnStart()


{
AddEntityCollideCallback("cogwheel01_dyn", "cogwheel02", "CollideWrongWheel", false, 1);
AddEntityCollideCallback("cogwheel01_dyn", "cogwheel03", "CollideWrongWheel", false, 1);
AddEntityCollideCallback("cogwheel02_dyn", "cogwheel01", "CollideWrongWheel", false, 1);
AddEntityCollideCallback("cogwheel02_dyn", "cogwheel03", "CollideWrongWheel", false, 1);
AddEntityCollideCallback("cogwheel03_dyn", "cogwheel01", "CollideWrongWheel", false, 1);
AddEntityCollideCallback("cogwheel03_dyn", "cogwheel02", "CollideWrongWheel", false, 1);
//SetLocalVarInt("WheelOK", 3);
//SetLocalVarInt("CoalOK",3);
//SetLocalVarInt("GuideOK",1);
//SetLocalVarInt("SticksOK",1);
for(int i=1;i<=12;i++){
AddEntityCollideCallback("coal_"+i, "AreaBurner", "CollideCoalInBurner", true, 1);
SetPropEffectActive("coal_"+i, false, false);
}

//---- INTERACT CALLBACKS ----//
for(int i=1;i<=3;i++) for(int j=1;j<=3;j++)
AddUseItemCallback("guiding_rod0"+i+"0"+j, "guiding_rod0"+i, "ra0"+j, "UseRod", false);
}

void AttachWheel(string &in asArea, string &in asBody)
{
AddTimer(asArea, 0.5f, "TimerWheel");

AddLocalVarInt("WheelOK", 1);
AddLocalVarInt(asArea, 1); //asChild in CollideWrongWheel, to not display message as spoke is taken

//DO PARTICLE
SetLocalVarString("WheelSound", asBody);
PlaySoundAtEntity(GetLocalVarString("WheelSound"), "scrape_metal.snt", asArea, 0.1f, false);
PlaySoundAtEntity(GetLocalVarString("WheelSound"), "13_attach_wheel.snt", asArea, 0.2f, false);

AddDebugMessage("Attach "+asArea+"_dyn", false);

SetEntityActive("AreaSpokes", false); //Turns off the missing spokes message.
}
void TimerWheel(string &in asTimer)
{
StopSound(GetLocalVarString("WheelSound"), 0.5f);

SetEntityActive(asTimer+"_dyn", false);
SetEntityActive(asTimer+"_mounted", true);
}
/*Message that it is not the correct spoke for the wheel
*/
void CollideWrongWheel(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt(asChild) != 1){
SetMessage("Ch01Level13", "WheelNoFit", 0);

PlaySoundAtEntity("clank", "impact_metal_low", asChild, 0.05f, false);
}
}

how to post images please tell me?
I would recommend an app like ShareX, but if that's too difficult:
1. Take a screenshot (you can use the PrintScreen key, paste it in Paint and save it).
2. Go to https://imgur.com and drop the image in there (you can drag it from a folder into the window).
3. Copy the link you get to your image and put it here.
okay i will do that

http://imgur.com/a/qmWTv

http://imgur.com/a/5yUmR


http://imgur.com/a/b64iZ

are these images and script okay?
It's usually a good idea to get as much information into the images as possible, like entity names and other objects nearby. It looks like you based this scene off the original in the Machine Room? Did you add to the Sticky Area the name of the entity you want to attach?
it worked the machine work now but more question to mudbil sorry i want the puzzle lever machine fork own puzzle how to chance and what i chance in script
I'm not 100% sure what you're asking, but you want to use the lever for another puzzle somewhere else?

Perhaps this will help you.



not this, you remember in singleplayer are 5 levers called lever machine that i want to own
Oh, you mean the levers that you pull up or down to make up a total number?

That one should be very easy, and I think the video here explains it almost exactly in the last quarter.
Pages: 1 2