[CHAOS] Setting up the elevator machine - 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: [CHAOS] Setting up the elevator machine (/thread-21426.html) |
Setting up the elevator machine - serbusfish - 05-07-2013 Ive attempted looking for a youtube tutorial on this but all I get are walkthoughs for the elevator part in the main game. My scenario; The map is filled with water. There is a lever that will open the drainage system and release all the water, however the machine that powers this is currently missing its cogs and coal. You need to replace the cogs, put a piece of coal in the machine, and then you'll be able to pull the lever and drain the water. Here is all I have so far: I know sticky areas need placing on the places where the cogs go, and of course those cogs need to be de-activated and scripted to activate when you place the actual cogs in place, but apart from that im pretty clueless. Any help on this would be really appreciated, in fact rest assured anyone who can help me with this will get a their own section in the end credits! RE: Setting up the elevator machine - Tomato Cat - 05-07-2013 What do you have written so far? Post it and I can help guide you through everything. I would much prefer to help someone who is actively trying rather than just asking for a script on the forums. RE: Setting up the elevator machine - Rapture - 05-07-2013 Do you plan to have a moving elevator or just using one as a "level door"? RE: Setting up the elevator machine - serbusfish - 05-07-2013 (05-07-2013, 02:42 AM)Tomato Cat Wrote: What do you have written so far? Post it and I can help guide you through everything. I would much prefer to help someone who is actively trying rather than just asking for a script on the forums. I dont have anything so far as I dont know where to begin. I'm not asking for anyone to write the entire thing out for me, I simply need to know where to start, what commands are needed, etc. I have only been scripting since January but I know my way around most of the basic commands, but when it comes to something as complex (I think?) as this machine im a little out of my depth. (05-07-2013, 03:09 AM)Rapture Wrote: Do you plan to have a moving elevator or just using one as a "level door"? There is no actual elevator in my map, just the machine. What im planning is having the next level door down a flight of stairs, but because of the water you cant get down to it until its been drained. I'll put a black box in front of the staircase so you cant go down it, then when the water has gone i'll make it deactivate the black box. RE: Setting up the elevator machine - Tomato Cat - 05-07-2013 (05-07-2013, 03:14 AM)serbusfish Wrote: I dont have anything so far as I dont know where to begin. Oh, no problem. =) So, you want the player to replace 3 cogwheels, put some coal in and then pull the lever? Not terribly difficult once you get the hang of it. I'll give you a general idea and you can adjust it to your liking. Let's start with the coal. I assume you're using the default elevator machine's coal burner. Spawn in some coal pieces and keep the default names. Next, create a script area. Name it area_coal and place it inside the burner. Then add a collide callback. The callback function will known as "CoalBurner." PHP Code: AddEntityCollideCallback("coal_*","area_coal","CoalBurner",false,1); You'll also need this local variable: PHP Code: SetLocalVarInt("CoalCheck",0); Now the function! What it essentially does is increment a variable every time a coal piece is added. If enough coal has already been added, the piece will disappear. PHP Code: void CoalBurner(string &in asParent, string &in asChild, int alState) Let me know how that turns out. Then I can help you with the sticky areas, if you like. RE: Setting up the elevator machine - PutraenusAlivius - 05-07-2013 PHP Code: void OnStart() RE: Setting up the elevator machine - serbusfish - 05-07-2013 Awesome, thanks a lot guys! Although I will say those 'VarInt' commands are something I havent used before and havent quite got my head around them yet. Im at work today but when I finish tonight I will give this a go RE: Setting up the elevator machine - serbusfish - 05-08-2013 OK I have tried the script and when I put all 3 pieces of coal into the machine they disappear. Ive also had a mess with the sticky areas and replicated what Frictional did with their machine, and all 3 of the cogs click into place as they should. But that's as far as I have got. I have also put the lever to start the machine in place as well. RE: Setting up the elevator machine - Tomato Cat - 05-08-2013 Did you not want the coal to disappear? Use this for the lever: PHP Code: SetEntityConnectionStateChangeCallback(string& asName, string& asCallback); RE: Setting up the elevator machine - serbusfish - 05-08-2013 (05-08-2013, 02:05 AM)Tomato Cat Wrote: Did you not want the coal to disappear? Yes that's fine, I was just updating on what I had done Ok ive used that command on a previous map so know what to do with it, however I dont know how I actually get the machines cogs and things to start up when the lever is pulled? |