Home   Help Search Login Register  

Author Topic: Entering and Exiting vehicles  (Read 4318 times)

0 Members and 2 Guests are viewing this topic.

Offline ViccyQ

  • Members
  • *
Entering and Exiting vehicles
« on: 15 Oct 2009, 04:52:19 »
Hey everyone.

I am fairly new to scripting and understand it a little.

My current mission is to learn where I can find a script that lets me enter and exit vehicles. I'm specifically looking for a script to work with the Crown Victoria Police Interceptor mods. So far you have to put  r2 action ["getInDriver", car2] on the player or vehicle to get in the car. This is done automatically at the start of the editor or match. Once you are in..to even get out you need to set a trigger using the radio commands to get out. One out of the car..there is no way to get back in.

I was hoping if anyone knew of a script that made entering and exiting as simple as it is with a humvee or any other vehicle in Arma 2.  This would also be helpful for other mods and creations for the game.

Also note: The Crownvictoria police Interceptors are from Arma 1 but work very well in Arma 2. I only know of the actual characters conflicting with the system which is expected.

All advice is welcome. Thanks for reading
« Last Edit: 15 Oct 2009, 05:40:26 by ViccyQ »

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Entering and Exiting vehicles
« Reply #1 on: 16 Oct 2009, 20:46:32 »
I don't know where the BIS Get In script is located, but if find it, it'll probably better to use since it doesn't let you get into position unless you are on that side door.
Patr = Patrol addAction ["Get In Driver", "GetIn.sqf", "DRIVER", 1, false, true, "", "driver _target == objNull"]

It will only appear when you are close to and facing the vehicle, it won't appear if there is already a driver.

GetIn.sqf
Code: [Select]
private ["_veh", "_player", "_action", "_seat", "_getout"];
_veh = _this select 0;
_player = _this select 1;
_action = _this select 2;
_seat = _this select 3;
_player action [format["GETIN %1",_seat],_veh];
call compile format['_getout = _player addAction ["Get Out", "GetOut.sqf", [], 1, false, true, "", "speed %1 < 10"]',_veh];

GetOut.sqf
Code: [Select]
private ["_player", "_action", "_veh"];
_player = _this select 1;
_action = _this select 2;
_veh = vehicle _player;
_player action ["GETOUT",_veh];
_player removeAction _action;

I don't have my ArmA to test this out, so please report any RPT errors.

Offline ViccyQ

  • Members
  • *
Re: Entering and Exiting vehicles
« Reply #2 on: 16 Oct 2009, 23:14:19 »
So these two sqs files that i make will go into the missions folder?

Also. say if I wanted to these intsructions to be apart of a gametype with a addon. would put those sqs texts in the pbo file?  Because basically the addon does not allow people in the vehicle.

Lastly. Say if I were hosting a game type of which I wanted everyone to have same addon, couldn't I just upload the file to the server and when the player connects. She of he downloads that addon along with the gametype and the instructions to get in a car for that specific addon?

I realy appreciate youe help so far.

Thanks.

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Entering and Exiting vehicles
« Reply #3 on: 17 Oct 2009, 00:03:10 »
SQS and SQF files are distinctly different. Try not to mix them up, all my stuff is SQF.

You can't automatically download addons when connecting to a server. If they are small addons they can be integrated into the mission (not recommended). If you want to make sure all the members of your unit have all the same addons even if you make updates to the required addons, you can give them the URL to your AddonSync server.

You should probably look at some other vehicle addons to see how they do it. config.cpp/bin can add to default BIS classes (which should call default functions on the added types) or create your own calls which will require CBA extended eventhandlers.

Offline ViccyQ

  • Members
  • *
Re: Entering and Exiting vehicles
« Reply #4 on: 17 Oct 2009, 06:41:19 »
Hey tcp.

So I have been working at this script for a WHILE now and still had no luck.

I tried : Patr = Patrol addAction ["Get In Driver", "GetIn.sqf", "DRIVER", 1, false, true, "", "driver _target == objNull"] in the initialization box of the vehicle that I want my player to enter and that gives no affect.

I may be doing something wrong.  I used note pad to create the sqf infomation you gave me earlier. After creating those two files, I put them in c:/Bohemia Interactive/Arama2/missions.

So is there a way to actually put this infomation in the actual pbo file of the addon so it can be active through just loading it as a mod or in a mission?

Lastly, where do I find config.cpp/bin ?  i'm not too familiar with that.

Thanks.
« Last Edit: 17 Oct 2009, 06:44:42 by ViccyQ »

Offline tcp

  • Members
  • *
    • Violator Gaming
Re: Entering and Exiting vehicles
« Reply #5 on: 17 Oct 2009, 07:10:07 »
Get armatools http://www.kegetys.net/arma/

Use it to extract the addon pbo

config.bin will be in there, use unRap to extract it

config.cpp will be editable, maybe be a script folder as well

Reference for vehicle config editing:
http://community.bistudio.com/wiki/CfgVehicles_Config_Reference
« Last Edit: 17 Oct 2009, 09:10:43 by tcp »