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
Multiple Issues Help Setting up the elevator machine
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#11
RE: Setting up the elevator machine

As far as the cogwheels/sticky areas go, you have to set the "AttachableBodyName" (The object to be attached) and attach function (Called when said object attaches) in the level editor. Both are found under the "Area" tab. Make sure you uncheck CanDetach, just for this example.


Here's a function you could use:

PHP Code: (Select All)
//But first declare a local variable in OnStart
SetLocalVarInt("Cogs",0);
//You might also have to set sticky area attachment in OnStart, try it with and without
SetAllowStickyAreaAttachment(true);

//This will be called each time a cog attaches
void Mount_Cog(string &in asStickyAreastring &in asBodyName)
{
    if(
GetLocalVarInt("Cogs") <= 3)
    {
        
AddLocalVarInt("Cogs",1);
        
AddDebugMessage("Attaching cog "+asBodyName+" to area "+asStickyArea,false);
        
AddDebugMessage("Cogs is at "+GetLocalVarInt("Cogs"),false);
    }


Try that out and make some adjustments. Let me know how it works!
(This post was last modified: 05-08-2013, 04:12 AM by Tomato Cat.)
05-08-2013, 04:00 AM
Find


Messages In This Thread
Setting up the elevator machine - by serbusfish - 05-07-2013, 01:30 AM
RE: Setting up the elevator machine - by Rapture - 05-07-2013, 03:09 AM
RE: Setting up the elevator machine - by Tomato Cat - 05-08-2013, 04:00 AM



Users browsing this thread: 1 Guest(s)