Home   Help Search Login Register  

Author Topic: refueling vehicles + questions  (Read 1039 times)

0 Members and 1 Guest are viewing this topic.

gadolinite

  • Guest
refueling vehicles + questions
« on: 28 Aug 2003, 20:51:33 »
How do you get the AI to refuel a vehicle?  

How do you get a unit to pull into a gas station without crashing into it or anything else (works 100% of the time, or close)?

I am setting up a bus route.  

If the fuel level of a bus is low (around 20% full) then the bus will pull into a station and refuel itself, then resume its route.

Komuna

  • Guest
Re:refueling vehicles + questions
« Reply #1 on: 29 Aug 2003, 00:11:21 »
Actually, you don't need to force the bus to refuel itself... Just lead it into the gas station and refuel it through the command "_Bus setFuel 1" (Notice that 0 is empty and 1 is full)

Now, about getting it into the gas station... Well, it seems you'll need a script.

In such script you could:

- Force the bus to move close to the gas station
- get its velocity (right before stopping) and set its velocity towards the gas station

Nothing very difficult, indeed.

gadolinite

  • Guest
Re:refueling vehicles + questions
« Reply #2 on: 02 Sep 2003, 02:23:15 »
I did not try to use the setvelocity command.  I have been just trying to just get it in with conventional commands such as domove getpos, and waypoints.  I also tried subtracting the gas station position array components by two, or so.  No luck.

How do you apply the velocity commands to this situation ???  

Offline KJAM

  • Contributing Member
  • **
  • Why Me, Whats it For?
    • Nightstalker mod
Re:refueling vehicles + questions
« Reply #3 on: 02 Sep 2003, 09:27:47 »
setvelocity pushes a vehicle in a direction , it doesnt make it turn just pushes it sideways, i dont know if it can be used in this situation but here's something i wrote to help people with setvelocity:

basic velocity
[X,Z,Y] this is just how the numbers are arranged so facing north (default compass direction , 0 ,the command

this setvelocity [10,10,10]

would send the vehicle 10speed to the right, 10 speed forward and 10speed UP whereas

this setvelocity[-10,-10,10]

would send it 10speed to the left, 10 speed backwards and 10speed up
though take in mind using a - number for the verticle would send the vehicle crashing down (if its in the air, and sometimes when its not) to earth and a bug that if you set the verticle too HIGH it hits the ground and gets destroyed, i dunno why that happens though

Guide to the Directions Setvelocity send the vehicle , relative to vehicles Azimut Heading
FACING NORTH
Y=Verticle*  a normal # is UP a -# is DOWN
Z=Forward/backward, normal # is FORWARD, a -# is BACKWARD
X= -Left/+Right (-# is LEFT: normal # = RIGHT on vehicles facing north)

FACING EAST X with a normal # is forward X with -# is backward:  Z with normal # is LEFT, Z with - # is RIGHT

FACING WEST
X with a -# is FORWARD X with normal number is BACKWARDS:Z with normal # is RIGHT, Z with - # is LEFT

FACING SOUTH
Z with a -# is FORWARD, Z with normal # is BACKWARD: X with a -# is RIGHT and a normal # is LEFT.

hope that helps the people who wanna use setpos

N.B
* means that it is a constant, no matter which Compass direction the direction this sends the vehicle remains the same
-# = A MINUS NUMBER E.G. -100
normal # = a positive number e.g 100
[X,Y,Z] replace any letter with a number

i hope you guys understand this
if not ill try and re-write it so you do
« Last Edit: 02 Sep 2003, 09:29:31 by KJAM »