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 How do I make a chair move?
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#11
RE: How do I make a chair move?

(12-10-2016, 07:48 PM)Mudbill Wrote: Ok, well, I think then the safest (and possibly simplest though subjective) way would be:

Create a custom entity for the chair by opening the original and "Save As" a different name. Make it a MoveObject type. Set the axis to be the direction you want the chair to move in the level (either X or Z). You do this in the User Defined Variables in the Model Editor.

Spoiler below!
[Image: f53474051df7413b80fd10e37db1effb.png]

In the map, place the entity. Once the player hits a collision box, use SetMoveObjectState to move the chair along the axis. That's all you need to do.

In the User Defined Variables you can also specify the speed and accelleration of the chair, but instead of doing it here, you can use the function SetMoveObjectStateExt instead to specify it in the script (it's a bit easier if you need to change values often).

PS: If you want the player to be able to also grab the chair after it has moved, use ReplaceEntity to turn the entity back into a normal chair (which is a Grab object).



However if you don't mind the chair possibly falling over, you can probably just use the function AddPropForce alone...

Thanks, bud!

Guys, I tried everything..

-If I make the chair a waterlurker with pathnodes it's invisible and doesn't follow the pathnode
-If I make the chair a moveobject with the SetMoveObjectState script it does nothing.
(This post was last modified: 12-10-2016, 08:57 PM by goodcap.)
12-10-2016, 08:08 PM
Find


Messages In This Thread
How do I make a chair move? - by goodcap - 12-10-2016, 06:57 AM
RE: How do I make a chair move? - by Spelos - 12-10-2016, 10:24 AM
RE: How do I make a chair move? - by Spelos - 12-11-2016, 09:00 AM
RE: How do I make a chair move? - by Mudbill - 12-10-2016, 04:03 PM
RE: How do I make a chair move? - by goodcap - 12-10-2016, 05:16 PM
RE: How do I make a chair move? - by goodcap - 12-10-2016, 07:31 PM
RE: How do I make a chair move? - by Mudbill - 12-10-2016, 07:48 PM
RE: How do I make a chair move? - by goodcap - 12-10-2016, 08:08 PM
RE: How do I make a chair move? - by goodcap - 12-10-2016, 09:17 PM
RE: How do I make a chair move? - by Spelos - 12-12-2016, 08:19 PM
RE: How do I make a chair move? - by Spelos - 12-16-2016, 09:36 AM
RE: How do I make a chair move? - by Daemian - 12-16-2016, 06:01 PM



Users browsing this thread: 1 Guest(s)