OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RT-SuperTron on 25 Aug 2002, 02:29:15
-
???
speed obj
Operand types:
obj: Object
Type of returned value:
Number
Description:
Object speed (in km/h)
Example:
speed player
How does that thing work?? I have been foolin around with it, but still no luck other than error messages.
[RT]SuperTron
-
basically it wil return the speed of the selected vehicle...
condition:
_speed1 = speed unitname
activation:
hint "_speed1"
that will hint to you how fast a certain vehicle is going.... hopefully...
:thumbsup:
-
Messiah shouldn't that be
_speed1 = speed car
hint format [" %1",_speed1]
;)
-
or even:
hint format ["%1", (speed car)]
/me waits for Sefe to step in and prove to us all there's a better way yet
The speed function returns the speed of the unit, you can't use it to set it I'm afraid SuperTron ;) (I have a strange feeling that's what you're wanting to do... If I'm wrong please disregard)
-
But you can use it to limit speed. Forcing an AI driver to apply the brakes if he goes too fast. He drives along as though he cant work a clutch, but it works.
-
Just looked at theis thread.
How does that %1 bit work? what exactly does it mean? I guess that could be incredibly useful - (hours of work overcomplicating things about to seem pointless and a complete waste of time!)
M
-
But you can use it to limit speed. Forcing an AI driver to apply the brakes if he goes too fast. He drives along as though he cant work a clutch, but it works.
Yeah I had a feeling this would be possible, but how does that work.
[RT]SuperTron
-
dis qoute is from da oficial comand referance ;)
format format
Operand types:
format: Array
Type of returned value:
String
Description:
First argument of array is format string. Format string may contain references to following arguments in form %1, %2, etc. Each %x is replaced by corresponding argument. %x may appear in the format string in any order.
Example:
format ["%1 - %2 - %1", 1, "text"] , result is "1 - text - 1"
LCD OUT
-
Yes, indeed tha would be great, being able to speed up vehicles wouldnt it?
Come on, you really dont wanna drive a shilka 350km/h up a 45*Deg mountain ?!
;D ;D ;D ;D ;D
I hope they enable such a line some day.....sigh*
-
???
Well, is it possible with that command to force a vehicle to stay below 45 km/ph.
[RT]SuperTron
-
???
Well, is it possible with that command to force a vehicle to stay below 45 km/ph.
[RT]SuperTron
You could set the speed mode lower when the speed is exceeded, like:
_Car = _this Select 0
#SpeedLoop
@(Speed _Car > 45)
_Car SetSpeedMode "NORMAL"
@(Speed _Car < 35)
_Car SetSpeedMode "FULL"
GoTo "SpeedLoop"
This will make the car go to normal speed when it goes faster than 45 and it wol go to full speed when it goes slower than 35... you could, of course, change the values so the speed change is smaller...
-
;)
Thanks Demoniac, that seems usefull. So if I get this command right, it is used to CHECK the speed of an object not setting it, but by checking for at certain value in SPEED, you can thereby alter it -SPEEDMODE- to something else.
[RT]SuperTron
-
I have already wrote a speed script that will be used for the catapult on the aircraft carrier we are making at
www.operationnorthstar.com
also I can make the script make a vehicle go from zero to any speed i would like so look forward to the carrier.
-
8)
NAA Us Marine, this sounds allmost to good to be true, both a speed script and new vessels. :cheers:
[RT]SuperTron
-
What about using it for a 'SPEED' type mission.
? speed bus1 < 40 : bus1 setdammage 1
? speed bus1 > 100 : bus1 setdammage 1
::)
-
I have already wrote a speed script that will be used for the catapult on the aircraft carrier we are making at
www.operationnorthstar.com
also I can make the script make a vehicle go from zero to any speed i would like so look forward to the carrier.
I don't believe that is possible with a script. Please show us.
-
Dont worry Its true Im not lying and I will give It to you pretty soon.
-
Ok I'll believe it when I see the script itself. I hope your script doesn't use "setpos" to accomplish acceleration, because if it does you are fooling yourself.
The reason I am so sketical is that this problem has been around for over year and many a great OFP minds have never been able to do what you say your script does.