OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RT-SuperTron on 25 Aug 2002, 02:29:15

Title: ComRef 1.75- Speed obj.
Post by: RT-SuperTron on 25 Aug 2002, 02:29:15
 ???

Quote
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
Title: Re:ComRef 1.75- Speed obj.
Post by: Messiah on 25 Aug 2002, 02:39:16
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:
Title: Re:ComRef 1.75- Speed obj.
Post by: Black_Feather on 25 Aug 2002, 05:09:40
Messiah shouldn't that be

_speed1 = speed car
hint format [" %1",_speed1]

 ;)
Title: Re:ComRef 1.75- Speed obj.
Post by: Sui on 25 Aug 2002, 06:12:18
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)
Title: Re:ComRef 1.75- Speed obj.
Post by: icarus_uk on 25 Aug 2002, 14:56:33
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.
Title: Re:ComRef 1.75- Speed obj.
Post by: mikeb on 25 Aug 2002, 15:02:17
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
Title: Re:ComRef 1.75- Speed obj.
Post by: RT-SuperTron on 25 Aug 2002, 15:55:46
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
Title: Re:ComRef 1.75- Speed obj.
Post by: LCD on 25 Aug 2002, 16:01:50
dis qoute is from da oficial comand referance  ;)

Quote
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
Title: Re:ComRef 1.75- Speed obj.
Post by: ElemenS on 26 Aug 2002, 00:35:56
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*
Title: Re:ComRef 1.75- Speed obj.
Post by: RT-SuperTron on 26 Aug 2002, 00:43:30
 ???

Well, is it possible with that command to force a vehicle to stay below 45 km/ph.

[RT]SuperTron
Title: Re:ComRef 1.75- Speed obj.
Post by: Demoniac on 27 Aug 2002, 21:44:53
???

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:
Code: [Select]
_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...
Title: Re:ComRef 1.75- Speed obj.
Post by: RT-SuperTron on 27 Aug 2002, 23:18:02
 ;)
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
Title: Re:ComRef 1.75- Speed obj.
Post by: ofp..hahha on 28 Aug 2002, 00:21:03
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.
Title: Re:ComRef 1.75- Speed obj.
Post by: RT-SuperTron on 28 Aug 2002, 05:15:33
 8)
NAA Us Marine, this sounds allmost to good to be true, both a speed script and new vessels. :cheers:

[RT]SuperTron
Title: Re:ComRef 1.75- Speed obj.
Post by: Anmac on 28 Aug 2002, 06:21:45

What about using it for a 'SPEED' type mission.

? speed bus1 < 40 : bus1 setdammage 1
? speed bus1 > 100 : bus1 setdammage 1

 ::)
Title: Re:ComRef 1.75- Speed obj.
Post by: toadlife on 29 Aug 2002, 00:04:29
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.
Title: Re:ComRef 1.75- Speed obj.
Post by: ofp..hahha on 29 Aug 2002, 00:39:11
Dont worry Its true Im not lying and I will give It to you pretty soon.

Title: Re:ComRef 1.75- Speed obj.
Post by: toadlife on 29 Aug 2002, 01:12:37
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.