Home   Help Search Login Register  

Author Topic: Speed Script  (Read 784 times)

0 Members and 1 Guest are viewing this topic.

Watty

  • Guest
Speed Script
« on: 17 Oct 2004, 01:45:54 »
Hi guys. I was wondering if their was a script to make computer vechiles drive at full speed, like at 150 on the dirt bike and not 70. the reason, I'm making a movie about a bike jumping over buses adn cars and other stuff but since the computer only drives at about 70 he get nowhere near into the air let alone over the buses.

So in general-need script that could make computer driven bike drive at very high speeds.

m21man

  • Guest
Re:Speed Script
« Reply #1 on: 17 Oct 2004, 03:23:42 »
I could get an AI on a BAS Kawasaki to go 100 by changing its speed mode ( this setspeedmode "full" ). If you want the bike to go faster, you'll probably have to shove it with setvelocity .

Watty

  • Guest
Re:Speed Script
« Reply #2 on: 17 Oct 2004, 14:41:09 »
Cheers for that  ;D
That could sort out this problem i give it a try and post back about the results.
thanks again.
« Last Edit: 17 Oct 2004, 20:24:16 by Watty »

Watty

  • Guest
Re:Speed Script
« Reply #3 on: 17 Oct 2004, 20:26:45 »
emmmmmm...dunno how to say this but it dosnt seem to work. I tryed it in the init feild (and the waypoint Activation) but i kept getting a operator error. could u give me an example so i could base my bike on it.

Kaliyuga

  • Guest
Re:Speed Script
« Reply #4 on: 18 Oct 2004, 01:43:09 »
   unit setvelocity x,y,z  is the proper syntax.

 I can never remember which letter corresponds to which direction, but some experimentation should solve that for ya..

:cheers:

Watty

  • Guest
Re:Speed Script
« Reply #5 on: 18 Oct 2004, 02:14:01 »
Cool thanks. yeah that seems right- x is for horizontal, y is for vertical and z well i think thats sum sort off depth/3-d movement. As you can tell i've only just started editing properly so any help is great. thanks again ;D

I just tryed it and consulted the offical commad response- The line im using just now is-

bike1 setVelocity [130,0,0]

I get an error message saying type anything but bool and the cursor relocates to the very beginning. Do you know how i can sort this as ive only done Sg computing at school so my knowledge is limited.Sorry for adding extra hassle.
« Last Edit: 18 Oct 2004, 02:36:23 by Watty »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Speed Script
« Reply #6 on: 18 Oct 2004, 02:58:40 »
Post the error message exactly, especially the # which tells you where the error has occurred.
Plenty of reviewed ArmA missions for you to play

Watty

  • Guest
Re:Speed Script
« Reply #7 on: 18 Oct 2004, 15:06:16 »
The error message for the line- Bike_1 setVelocity [130,0,0] is -
Type nothing, expected bool.


The error message for the line- Bike_1 setVelocity (150),(0),(0) is
Bike_1 setVelocity (150)|#|,(0),(0)': missing (

Does that help  ???


 

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Speed Script
« Reply #8 on: 18 Oct 2004, 16:14:10 »
The round brackets one ( ) is definitely wrong.    The square brackets one [ ] looks right .... check that the bike is named correctly and that you have only one object with that name.    That error message is a bit general, its one of the ones you get when the game just can't work out what its supposed to do.    I believe that setVelocity doesn't work on some objects when they are touching the ground.    

Try some various experiments to see if you can get setVelocity working at all.  
Plenty of reviewed ArmA missions for you to play

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Speed Script
« Reply #9 on: 18 Oct 2004, 16:23:47 »
this is what I use, borrowed from an unknown author.  My geometry is limited, but using this code, it doesn't matter what direction the vehicle, (_vcl), is facing, it will get a speed boost.  The vehicle just needs to be moving in order to get the "kick"
Code: [Select]
_speed = [(_factor*(sin getDir _vcl))+(velocity _vcl select 0),(_factor*(cos getDir _vcl))+(velocity _vcl select 1),(velocity _vcl select 2)];
_vcl SetVelocity _speed

I don't understand all the math, but I know that it works!  Hope this helps

Offline KJAM

  • Contributing Member
  • **
  • Why Me, Whats it For?
    • Nightstalker mod
Re:Speed Script
« Reply #10 on: 18 Oct 2004, 17:28:41 »
i wrote a very basic guide one time for using setvelocity once here it is



---------------------------------------------------------



   Recommended for OFP version 1.46
setvelocity pushes a vehicle in a direction , it doesnt make it turn just pushes it sideways, here's something i wrote, from my own findings 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 [9,10,10]

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

this setvelocity [-9,-10,10]

would send it 9 speed 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 # 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 or a minus number

--------------------------------------------------

if you want to put it in the init line, use

this setvelocity [X,Y,Z]

and MAKE SURE the bike you want moving, has the same name as the one you put in the script

Watty

  • Guest
Re:Speed Script
« Reply #11 on: 18 Oct 2004, 17:59:55 »
Thanks for all the help guys, I tryed it and it works like a dream  ;D
I guess i can say Problem solved.