Jump to content

Vehicle placement Script Ideas


Yossarian22

Recommended Posts

Hello

 

I need some help. In my Mod GTS I use a REF.moveto player command to place the Vehicle next to the Player when he is Fast Travelling. So that works fine, BUT only on a mostly flat ground. So the problem is, that the ground in the wasteland in majority isn't flat. So, we already started to bring the mapmarkers into flat positions, but its such an incredible amount of work, that I really wish there would be a solution, that works a bit better.

 

So, does anyone has a Idea how to place the Vehicle in angle and height depending on the terrain?

Link to comment
Share on other sites

Is the vehicle affected by gravity? If so, just give it a little height offset and let it fall

 

Warning: this may cause the bike to roll down a hill, but shouldnt

 

I cant do that. The Vehicles are actually actors. That is needed, coz moveto only works for actors on the right way. So I am not really sure how the game actually place actors, but kristjin discovered, that it mostly seems to depend on the navmesh. However, I am not yet sure about this. Actually this vehicle placement is the last thing, that bursts my eyes. Also I want invite more vehicle choices like Tanks and Trucks, but I need a proper solution for this placement before I can start add more Vehicles.

Link to comment
Share on other sites

Would it be possible to shoot a trace from the bottom of the vehicle to the terrain below it, return the angle of the terrain at that point, then angle the vehicle so that it matches the returned angle?

 

Disclaimer: I have no idea how to do this, I suck at vector maths, just shooting the idea out there for anyone who might have more of a clue :)

Link to comment
Share on other sites

Ehm, wasn't moveto able to accept offset parameters?

[ObjectRef].MoveTo MarkerID, x, y, z (optional)
MoveTo Moves the object to the specified reference's location. The x, y, z are optional offsets from the target reference.

Yep, that does sound like it. If you do a normal moveto, since the spot you're asking is "occupied" it finds a nearby place and puts it. With an offset, this shouldn't be a problem.

 

Otherwise, after moving the vehicle, you could use getpos and setpos to move the vehicle higher in the z axis, an offset of about 80 (a character's waist) should be enough, and let the havoc physics handle the rest

Link to comment
Share on other sites

One idea that I had a while ago for something like this, but never actually tested properly, was to use PlaceAtMe to determine a "safe" position. This idea is based on the fact that references created and placed via PlaceAtMe are only placed in "safe" locations, so it can hopefully be used in two ways to place an object in a safe position:

 

1. Replace the old reference by using the return value of PlaceAtMe to store the RefID of the new reference, and delete the previous reference via Disable/MarkForDelete.

 

2. Use PlaceAtMe, perhaps combined with Disable, to place a reference at a "safe" location, then use MoveTo to move another reference to that location, followed by deleting the "marker" reference via Disable/MarkForDelete.

 

Cipscis

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...