Frictional Games Forum (read-only)
The simple button... - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: The simple button... (/thread-4787.html)



The simple button... - SLi78 - 09-27-2010

... isnt simple

Hi there,

i've set an entity of the simple_button in my room.

[attachment=682]

And some simple code to test.

Code:
void Button1Func(string &in entity, string &in type)
{
    AddPlayerBodyForce(20000,0,0,true);
}

void OnStart()
{
    SetEntityActive( "button_simple_1",true);
    SetEntityConnectionStateChangeCallback("button_simple_1", "Button1Func");
    SetEntityInteractionDisabled("button_simple_1", false);

    
}

My problem that the Button isn't usable, i mean the "Useicon" doesn't appear, so i cant test my code.

I thought, at least i could press the button, because its a button...

... but that isn'tSad

Tips and Hints are welcome as always


RE: The simple button... - mansarde - 09-27-2010

Unfortunately the button isn't a real entity with which you can interact.
Therefore you have to make your own button with the model editor.
Just load it up in the model editor and then under the menu "Settings"->"User defined variables" change its Type from "Object" to "Button".
Then save it under another name in the same folder.
Now you can use your new, useable button.


RE: The simple button... - SLi78 - 09-29-2010

(09-27-2010, 07:27 PM)mansarde Wrote: Unfortunately the button isn't a real entity with which you can interact.
Therefore you have to make your own button with the model editor.
Just load it up in the model editor and then under the menu "Settings"->"User defined variables" change its Type from "Object" to "Button".
Then save it under another name in the same folder.
Now you can use your new, useable button.


thx

it works, but as far as i see is there no animation for pushing the button, so i use a lever now.


RE: The simple button... - mansarde - 09-29-2010

(09-29-2010, 06:19 PM)SLi78 Wrote: thx

it works, but as far as i see is there no animation for pushing the button, so i use a lever now.

You're welcome. Smile
What you could do would be to script the button entity to move when being interacted with by the player.
Don't ask me how exactly that works though, I haven't delved into moving objects via scripts yet.^^