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 Moving shelf via button
triadtimes Offline
Senior Member

Posts: 508
Threads: 16
Joined: Jan 2011
Reputation: 21
#4
RE: Moving shelf via button

Okay, you ready for this? I'm gonna give y'all the low down on how buttons work in Amnesia. Let's gooo...


Go into your level editor and select the button you want to be press-able. From there go to Entities and go down to the box that says PlayerInteractCallback (d'ya see it?). Okay, type whatever you want into this box (let's say PressButton in this case). Now go and take your already developed script and make it look a little like this:

Spoiler below!
OnStart
{
//Functions go here //But we don't need one for this button
}

//Lines of code

void PressButton(string &in asEntity) //Entirely new callback
{
//Stuff you wanted to do when the button is pressed
}

That's right, we don't need to have something in the OnStart for this, it's all LevelEditor & callback, baby.

Okay, hope that helped. See ya.

01-21-2012, 05:57 AM
Find


Messages In This Thread
Moving shelf via button - by Quotentote - 01-21-2012, 05:19 AM
RE: Moving shelf via button - by Tripication - 01-21-2012, 05:23 AM
RE: Moving shelf via button - by flamez3 - 01-21-2012, 05:47 AM
RE: Moving shelf via button - by triadtimes - 01-21-2012, 05:57 AM
RE: Moving shelf via button - by Quotentote - 01-21-2012, 06:09 AM



Users browsing this thread: 1 Guest(s)