Home   Help Search Login Register  

Author Topic: Towing Bike  (Read 836 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Towing Bike
« on: 18 Sep 2005, 09:02:25 »
I could really do with this script.

YOu have a jeep and a bike. When you start the mission the bike is setpos'd directly behind the jeep at an angle of 90 degrees, as close as it can get without colliding and exploding. Also it is off the ground.

In short it looks like it's attached to the rear of the jeep.

When the player gets close, an action appears which says, "Unload Motorbike" or something like that. When you click it, the bike is setpos'd a bit further behind the jeep at the same angle etc. It is now free to ride. There is an action that says "Load Motorbike" so you can put it back up.

I'd like it if it was suitable for numerous jeeps so that I could have a group of jeeps with bikes on the back, and could get the bikes off whenever I wanted, ride around then re-attach them and drive away.

Is it do-able?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Towing Bike
« Reply #1 on: 18 Sep 2005, 19:20:15 »
it is definitely doable, and probably not that hard to do...except for getting the bike back on, because your action can't use both the jeep and the bike... hmm

Offline Blip

  • Members
  • *
  • ...Old OFP FART...
Re:Towing Bike
« Reply #2 on: 19 Sep 2005, 16:42:43 »
I towed a zodiac behind a PBR using setpos function, it shouldn't be hard to manipulate to get it to work for you.

Here is basically what I used...

Code: [Select]
_jeep = _this select 0
_z = _this select 1

#loop
_refobj = _jeep
_plcobj = _z
 _offFB = -8
 _offLR = -2
 _offAB =-0.7
_pos = [_refobj,_plcobj,_offFB,_offLR,_offAB] call SetObjPosObj
_z setpos _pos
_z setdir (getdir  _jeep) + 90
~0.01
?endjeepfollow : goto "end"
goto "loop"

_z would be your bike, and _jeep would be your jeep. You will have to mess with the placement values to get it right, the current values where for my mission.
You need the setobjposobj function as well.

Blip
« Last Edit: 19 Sep 2005, 16:45:48 by Blip »
...NIGHT WALKER....

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Towing Bike
« Reply #3 on: 20 Sep 2005, 16:57:51 »
MP compatibility issue

setpossing an object to a moving object although possible, looks very jerky in mp

because setpos is a global command, everytime it is called, it is transmitted across the network and therefore calling it durung a fast loop would induce a heavy requirement on bandwidth, cpu etc

to have something that doesnt look completely retarded, your setpos loop would have to be very very fast
bare minimum 0.1 delay between loops and due to the speed some vehicles can go at, i would expect it needs to be much faster than that

For something so cosmetic, it isnt really worth it

The best system would be to attach an action to the jeep and simply setpos the bike once to and from the jeeps location when you want to unload or load it

STAGE 1
Unload Bike action
which simply setpos's the bike from a safe non playable location to say the rear of the vehicle when you wish to unload it
You would then remove the Unload Bike action from the vehicle


STAGE 2
Load Bike action
You would have this action constantly attached to the bike, never removing it
selecting this action would then run a script that would use the  nearestobject command to search for the nearest vehicle "TYPEOF" that you had listed in a user defined array
The vehicle would then have the "Unload bike" action attached to it and the bike would be setpossed back to the safe location, if it did not have a driver
« Last Edit: 20 Sep 2005, 17:03:50 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123