Jump to content
Clayn Sharkfin

Vehicle scripting question

Recommended Posts

I have been playing around with ride able animals some using the vehicle scripts, now i just have 1 problem that whenever i run against a prim and keep running against it my animal will start climbing the prim/mesh, is there a easy way to fix this that i am just missing?

Share this post


Link to post
Share on other sites

This sounds like the classic vaudeville routine:

Patient:   "Doc, it hurts when I do this!"

Doctor:  "Then don't do that."

Yuk, yuk. yuk.

Really, though, if you walk into obstacles with your avatar, you'll try to climb over them too. The easy solution is to stop running into walls.  Other than that, I suppose you can go to a lot of trouble to build a llPush statement into your collision_start event, written to give your animal a gentle push away from whatever it runs into.  It won't be easy, though, because you'll have to ignore collisions with the floor, the ground, and other things that you want to be able to walk on.

  • Like 1

Share this post


Link to post
Share on other sites

That or setting llBuoyancy much less than 1.0 will just keep you on the ground better, but I doubt it will affect your hill climbing skills. It's better to just stop bumping into things.

Share this post


Link to post
Share on other sites
17 minutes ago, Rolig Loon said:

but I doubt it will affect your hill climbing skills

It totally depends on the power applied indeed. 

There are way to many factors at play here, and lots of unknowns to give good advice. Though, pretty much anything you do to counterfight one behavior will have unwanted effects on other behaviors as well.

Share this post


Link to post
Share on other sites

climbing hills is not the problem, all i want is that the animal im riding doesn't climb up a house, i thought of using a script that if you bump into something it checks to see if something is in front of you and if your speed decays below a amount it will just set the animal none physical, but im not sure if that's the best way to handle it. It mostly happens if i speed up a hill it then lifts the animal slightly off ground and it hit's the house in a angle that allows it then to climb it.

Share this post


Link to post
Share on other sites

I meant "hill climbing" metaphorically.  Arton and I are saying the same thing. Almost anything you do to stifle that bad behavior i likely to have some other undesired effect.  There's no good way to distinguish between one sort of obstacle and another and tell your animal to back off.  As I said above, you will collide with loads of things -- mostly things that you walk on like the ground and the floor, and you certainly want to be able to walk on them even if they have some slope to them.

With some vehicles, it can help if you llSetStatus(STATUS_ROTATE_X, FALSE ) and llSetStatus(STATUS_ROTATE_Y, FALSE).  I'm not sure whether that's a smart idea in your case, but it might keep your animal from leaning away from the slope.

Share this post


Link to post
Share on other sites

I basically fixed the climbing problem, i just added a invisible prim at the animals head or slightly above and it's fine now, however my only other problem is that it tends to fall to the front if a prim sticks out of the floor, lol

Share this post


Link to post
Share on other sites
12 minutes ago, Dora Gustafson said:

We have a vehicle flag:  VEHICLE_FLAG_NO_DEFLECTION_UP

This may or may not be what you are looking for

Ooohh .. that looks promising. From the Wiki:

Quote

This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky.

 

Share this post


Link to post
Share on other sites

while VEHICLE_FLAG_NO_DEFLECTION_UP may sound good and seem to be the solution it indeed is not at least not for me. The issue of what is happening is that the vehicle is hitting the mesh at a angle where the force makes it drive it self up a long the wall, i do indeed have that flag set but it does not stop it from happening. It's all really just about how your mesh or prims you use are angled.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...