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
The simple button...
SLi78 Offline
Junior Member

Posts: 23
Threads: 6
Joined: Sep 2010
Reputation: 0
#1
The simple button...

... isnt simple

Hi there,

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


.jpg   Unbenannt.JPG (Size: 180.64 KB / Downloads: 140)

And some simple code to test.

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
09-27-2010, 07:00 PM
Find
mansarde Offline
Junior Member

Posts: 42
Threads: 3
Joined: Sep 2010
Reputation: 0
#2
RE: The simple button...

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.
09-27-2010, 07:27 PM
Find
SLi78 Offline
Junior Member

Posts: 23
Threads: 6
Joined: Sep 2010
Reputation: 0
#3
RE: The simple button...

(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.
09-29-2010, 06:19 PM
Find
mansarde Offline
Junior Member

Posts: 42
Threads: 3
Joined: Sep 2010
Reputation: 0
#4
RE: The simple button...

(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.^^
09-29-2010, 07:18 PM
Find




Users browsing this thread: 1 Guest(s)