Scripted player and walls

Topics regarding Scripting with Reality Factory
Post Reply
Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Scripted player and walls

Post by Danimita92 » Sat Sep 20, 2008 10:25 pm

Hi everybody, I've got a little (or big, dunno) doubt about how to do something. Let's say I've got a scripted player, and I want it to detect when it's near a wall. On this wall, there's a... how was it called? ... a place where you can grab onto, and hang on to. I'd like to make my scripted player to grab onto a part of a wall, hang onto it, and move left or right, with his yaw changing depending on the wall's angle. Is there any quick or not so quick way to do this?

BTW, a less important doubt I'd like to just ask here too, which is similar. How can I make a pawn (that I control) change it's pitch depending on how the floor is (say like a car, on a not straight road)
Thanks in advance

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Scripted player and walls

Post by metal_head » Sat Sep 20, 2008 10:35 pm

hmm,you know,that I know nothing about scripting yet,but I think you could use script points..sorry I just don't have the right skills to help you :(

User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA
Contact:

Re: Scripted player and walls

Post by darksmaster923 » Sun Sep 21, 2008 8:31 pm

I don't have the manual right now, so I can't really be specific, but theres a command around the lines of GetCollisionDistance or something like that. You'll have to check
Herp derp.

Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Scripted player and walls

Post by Danimita92 » Sun Sep 21, 2008 10:02 pm

Yeah, but that's with pawns, and it doesn't check in what direction the wall is facing, and where the player is facing. So say if it's a cube, and the player turns the corner, it wouldn't work properly.

Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Scripted player and walls

Post by Danimita92 » Tue Sep 23, 2008 3:54 pm

bump?

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Scripted player and walls

Post by Juutis » Tue Sep 23, 2008 4:10 pm

You could use the GetCollisionDistance() command to check the distance to the wall in two or more different places. In theory it should be possible to calculate the direction of the wall from those values. Or maybe you could add something like scriptpoints or pawns near walls that tell the player pawn which direction the wall is facing. These are just some ideas I came up with. They're pretty wild, actually and I dunno how you would do it in practice.
Pain is only psychological.

Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Scripted player and walls

Post by Danimita92 » Tue Sep 23, 2008 4:49 pm

So you have no idea how i could make it so a car that drives through an irregular road changes it's pitch depending on the road's angles?

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Scripted player and walls

Post by Juutis » Tue Sep 23, 2008 5:06 pm

Yeah, I'm afraid so. You could try to simulate it by checking the distance to the ground from each of the car's wheels and then change the pitch, yaw and roll correctly. It would require a lot of work and all kinds of tricks, and probably the result wouldn't be worth the trouble. If I were you I'd just wait for the new RF release that has proper physics. Or you might use federico's physics release which is a bit outdated.
Pain is only psychological.

Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Scripted player and walls

Post by Danimita92 » Tue Sep 23, 2008 5:13 pm

I actually am using it and version 0.75C (sorry QoD but I need the physics for some puzzles I've got planned for the game) So there's a way to have a pawn that moves and you control, yet has physics, like a car?

Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Scripted player and walls

Post by Danimita92 » Fri Sep 26, 2008 3:59 pm

Seeing as nobody answers, I ask something else: could it maybe be a posibility that I can add an invisible pawn and make it appear in front of the car, but that this pawn has gravity, and moves as fast as the car in the same direction. Then I change the car's pitch so that it looks at this invisible pawn. Then when there's a down hill, because the invisible pawn is lower than the car, the car looks down the hill, and so on. Would it work? (Question from previous post still answer-able btw)

Post Reply