Jump to content
tonic-_-

Virtual Vehicle Spawner (VVS)

Recommended Posts

Hello,

is there any way to spawn the vehicles with anything in the Init field?

Share this post


Link to post
Share on other sites

Haven't tested this, but in fn_spawnVehicle you can do something like...

if (player getVariable ["VVS_restrictSpawn",false]) exitWith {hint "You can't spawn a vehicle at the moment."}; 
player setVariable ["VVS_restrictSpawn",true]; // add these lines near the top of script

...

sleep 600;
player setVariable ["VVS_restrictSpawn",false]; 
hint "You can now spawn vehicles."; // add these lines near the bottom of script

 

 

Share this post


Link to post
Share on other sites

Hello,

Virtual Vehicle Spawner-0.4.zip

Now it's fully compaitable with RHS (due to cfgVehicleClasses in 0.3.9.1 version of rhs).
You can run it with or without RHS mods.

RHS vehicle classes attached to next VVS vehicle spawn classes:

CAR:
- vanilla Car;
- rhs_vehclass_car;
- rhs_vehclass_truck;

AIR:
- vanilla Air;
- rhs_vehclass_aircraft;
- rhs_vehclass_helicopter;

SHIP:
- vanilla Ship;

SUBMARINE:
- vanilla Submarine;

ARMORED:
- vanilla Armored;
- rhs_vehclass_tank;
- rhs_vehclass_apc;
- rhs_vehclass_ifv;
- rhs_vehclass_artillery.

AUTONOMUS:
- vanilla Autonomous;
- rhs_vehclass_aa.

SUPPORT:
- vanilla SUPPORT;
- rhs_vehclass_targeting;
- rhs_vehclass_launcher;
- rhs_vehclass_radar;

Best regards,
[TF]def

Share this post


Link to post
Share on other sites

0.4.1: minor update

- Updated BuildCFG function: now it's pretty simple to add support of your own vehicle class / vehicles from mods;
- Updated example map (now it's ready for multiplayer);
- Submarines at now is a subclass of ships;

To add custom vehicle class (vehicle should be in cfgVehicles anyway) now it's enough to edit only two strings:
1) first of all add your class to the end of allowed vehicle classes array at the end of string 63.
2) now add your class to one of the subclasses array at string 77 (for cars) or 80 (for ships) or 83 (air) or 86 (armored) or 89 (autonomous) or 92 (support).
3) done.

Share this post


Link to post
Share on other sites

hi...

i use to play dinamic combat generator wich use your script VVA but

also if the changelog says "- Fixed: Some vehicles such as helicopters shouldn't explode when being spawned."

I' m still getting vehicles explode when spawn and sometime when you try to get in...Is it a known problem??

I use Usaf and Rhs...any body know how to avoid this problem?

thank you

bye

Share this post


Link to post
Share on other sites

When i execute it, i get: picture picturething not found and all my icons are black! Any suggestions?! Thanks!

P.S.: The VVS is working, but i've got that error and black icons (not white)!

Share this post


Link to post
Share on other sites

When i execute it, i get: picture picturething not found and all my icons are black! Any suggestions?! Thanks!

P.S.: The VVS is working, but i've got that error and black icons (not white)!

Hopefully someone can help with these issues. Great script!

Share this post


Link to post
Share on other sites

Has anyone run into an issue with this script not functioning after running the mission through an eden conversion?

Share this post


Link to post
Share on other sites

When i execute it, i get: picture picturething not found and all my icons are black! Any suggestions?! Thanks!

P.S.: The VVS is working, but i've got that error and black icons (not white)!

 I tried to google this problem and found no help.  So after lots of messing around. for me it was down to Civ Support, if I set VVS_SideOnly = true; in the VVS configuration.sqf file problem solved.

But we like to use Civ Vehicles so heres what I am doing for now. I am sure someone that knows better can tidy this up for us. At the bottom of VVS I have this. (guess it was Pods because they was the only ones without Icons)

 

/*
Vehicle restriction
Again, similar to VAS's functionality. If you want to restrict a specific vehicle you can do it or
you can restrict an entire vehicle set by using its base class.
 
VVS_R_Car = [];
VVS_R_Air = [];
VVS_R_Ship = [];
VVS_R_Armored = [];
VVS_R_Autonomous = [];
VVS_R_Support = ["B_Slingload_01_Ammo_F","B_Slingload_01_Base_F","B_Slingload_01_Cargo_F","B_Slingload_01_Fuel_F","B_Slingload_01_Repair_F","Pod_Heli_Transport_04_base_F","Slingload_base_F","B_Slingload_01_Medevac_F"];
 
Might be to late for you. But I hope it helps anyone else that Googles it, like I did.

Share this post


Link to post
Share on other sites

Hi! Can anyone knows how can i add a class vehicle to a button?

Ex: Car button, when i will click only Car vehicles shows (like the filter list, but on a button).

I want to create for each class an button:

Car_Button = "Car", Air_Button = "Air" ...

Like in this screenshot:

https://r26.imgup.net/test3352.jpg

 

player addAction[""Virtual Vehicle Spawner"",VVS_fnc_openVVS,["",""Car""]];

this is working, but i want the button command for that (not to add an action menu)

i tried some [] call commands but i dont know what  to call ... for the Car for ex...

Edited by Magnum22

Share this post


Link to post
Share on other sites

Can anyone help me to use this on the new aircraft carrier ? Know How to use it on the ground.

Share this post


Link to post
Share on other sites

Yes me too for use on USS freedom , in fn_spawnvehicle.sqf I modify this line:

 

_position set [2, 24]; --> when i write 23 it's low and 24 it's high how to specify exact heigh please ?

 

Sorry for my bad english ..

Share this post


Link to post
Share on other sites

Hello,
i have an question regarding custom vehicle spawn classes. For example if i want to add an class with only to vehicles, so that i can just type in "MyClassName" instead of "Air". 
I am trying since 3 hourse but i just cant get anything out of your comments you made in the files.
I think it would be good if you release an more detailed step by step tutorial on the main site of the mod so everyone can see how it is done.
Greetings
Yannik

Share this post


Link to post
Share on other sites
On 5/13/2017 at 4:56 PM, skuijs said:

Can anyone help me to use this on the new aircraft carrier ? Know How to use it on the ground.

I modified the fn_spawnVehicle.sqf file to solve this problem.  It works in the USS Freedom but I have not check it still works on land.

Basically I check if the position is over water and assume that means it is on the Freedom and then modify the position to take into account the height of the carrier deck.

The checking the respawn point is clear still works (if it is not the vehicle is deleted, as before).

/*
	File: fn_spawnVehicle.sqf
	Author: Bryan "Tonic" Boardwine
	
	Description:
	Spawns the selected vehicle, if a vehicle is already on the spawn point
	then it deletes the vehicle from the spawn point.

   Edit: Strider 10 Sep 2017
   Updated to work with the USS Freedom aircraft carrier.
*/
disableSerialization;
private["_position","_direction","_className","_displayName","_spCheck","_cfgInfo"];
if(lnbCurSelRow 38101 == -1) exitWith {hint "You did not select a vehicle to spawn!"};

_className = lnbData[38101,[(lnbCurSelRow 38101),0]];
_displayName = lnbData[38101,[(lnbCurSelRow 38101),1]];
_position = getMarkerPos VVS_SP;

// Check if we are over water (and assume we are on the USS Freedom.
if ( surfaceIsWater _position ) then {
   _position = _position vectorAdd [0,0,24];
};

_direction = markerDir VVS_SP;

//Make sure the marker exists in a way.
if(isNil "_position") exitWith {hint "The spawn point marker doesn't exist?";};

//Check to make sure the spawn point doesn't have a vehicle on it, if it does then delete it.
_spCheck = nearestObjects[_position,["landVehicle","Air","Ship"],12] select 0;
if(!isNil "_spCheck") then {deleteVehicle _spCheck;};

_cfgInfo = [_className] call VVS_fnc_cfgInfo;

/*
 * Spawn the requested vehicle.
 */

// Spawn vehicle somewhere where we can manipulate it.
_vehicle = createVehicle [_className, [0,0,10], [], 0, "CAN_COLLIDE"];

// Stop it being damaged.
_vehicle allowDamage false;

// Set the vehicle direction.
_vehicle setDir _direction;

// Put the vehicle where we  want it.
_vehicle setVehiclePosition [_position , [], 0, "CAN_COLLIDE"];


if((_cfgInfo select 4) == "Autonomous") then
{
	createVehicleCrew _vehicle;
};

if(VVS_Checkbox) then
{
	clearWeaponCargoGlobal _vehicle;
	clearMagazineCargoGlobal _vehicle;
	clearItemCargoGlobal _vehicle;
};

_vehicle allowDamage true;
hint format["You have spawned a %1",_displayName];
closeDialog 0;

The new bits of code are:

Checking if the respawn position is over water and them modifying the _postion variable.

// Check if we are over water (and assume we are on the USS Freedom).
if ( surfaceIsWater _position ) then {
   _position = _position vectorAdd [0,0,24];
};

Respawn the vehicle safely.  This uses a template I like for safe vehicle respawn and the simple way seemed to cause problems with some vehicle spawning and other disappearing.

/*
 * Spawn the requested vehicle.
 */

// Spawn vehicle somewhere where we can manipulate it.
_vehicle = createVehicle [_className, [0,0,10], [], 0, "CAN_COLLIDE"];

// Stop it being damaged.
_vehicle allowDamage false;

// Set the vehicle direction.
_vehicle setDir _direction;

// Put the vehicle where we  want it.
_vehicle setVehiclePosition [_position , [], 0, "CAN_COLLIDE"];

Hope this might help you.  S

Share this post


Link to post
Share on other sites

I've found a solution to the vehicle icons appearing in black.

In the VVS\resource.h file search for the class VVS_RscListNBox { (~line 52) and insert 3 lines between the following 2 lines:

colorSelectBackground2[] = {1,1,1,0.5};
soundSelect[] = {"",0.1,1};

Insert the 3 lines so they end up looking like:

colorSelectBackground2[] = {1,1,1,0.5};
colorPicture[] = {1,1,1,1};
colorPictureSelected[] = {1,1,1,1};
colorPictureDisabled[] = {1,1,1,1};
soundSelect[] = {"",0.1,1};

Similarly, search for the class VVS_RscListBox { (~line 455) and insert the same 3 lines between:

colorScrollbar[] = {0.2, 0.2, 0.2, 1};
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";

Insert the 3 lines so they end up looking like:

colorScrollbar[] = {0.2, 0.2, 0.2, 1};
colorPicture[] = {1,1,1,1};
colorPictureSelected[] = {1,1,1,1};
colorPictureDisabled[] = {1,1,1,1};
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";

Worked a treat for me.  Good luck  S

Edited by strider42
edited file location to include 'VVS'
  • Like 1

Share this post


Link to post
Share on other sites

Is there any known issue with VVS and ALIVE? Cause i tried VVS on one of my missions, it worked fine, then i added ALIVE to the mission and now VVS doesnt work at all i dont even get the option on screen when i look at the spawner object.

Share this post


Link to post
Share on other sites

Got it working on both land and Freedom.

 

Thanks @GEORGE FLOROS GR

 

Spoiler

/*
	File: fn_spawnVehicle.sqf
	Author: Bryan "Tonic" Boardwine
	
	Description:
	Spawns the selected vehicle, if a vehicle is already on the spawn point
	then it deletes the vehicle from the spawn point.
*/
disableSerialization;
private["_position","_direction","_className","_displayName","_spCheck","_cfgInfo"];
if(lnbCurSelRow 38101 == -1) exitWith {hint "You did not select a vehicle to spawn!"};

_className = lnbData[38101,[(lnbCurSelRow 38101),0]];
_displayName = lnbData[38101,[(lnbCurSelRow 38101),1]];
_position = getMarkerPos VVS_SP;

// Check if we are over water (and assume we are on the USS Freedom).
if ( surfaceIsWater _position ) then {
   _position = getPosATL Freedom_Spawn;
};

_direction = markerDir VVS_SP;

//Make sure the marker exists in a way.
if(isNil "_position") exitWith {hint "The spawn point marker doesn't exist?";};

_cfgInfo = [_className] call VVS_fnc_cfgInfo;

//Check to make sure the spawn point doesn't have a vehicle on it, if it does then delete it.
_spCheck = nearestObjects[_position,["landVehicle","Air","Ship"],12] select 0;
if(!isNil "_spCheck") then {deleteVehicle _spCheck;};

//Creating vehicle

_vehicle = createVehicle [_className,_position, [], 0, "NONE"];

_vehicle allowDamage false;

//Make sure it gets set onto the position.
_vehicle setposatl [(_position select 0) , (_position select 1) , (_position select 2)];

//Set the vehicles direction the same as the marker.
_vehicle setDir _direction;

//Make sure it gets sets upright.
//_vehicle setVectorUP (surfaceNormal [(getPosatl _vehicle) select 0,(getPosatl _vehicle) select 1]);

[_vehicle] spawn DEVAS_AutoPilot;
[_vehicle] spawn DEVAS_Loiter;

if((_cfgInfo select 4) == "Autonomous") then
{
	createVehicleCrew _vehicle;
};

if(VVS_Checkbox) then
{
	clearWeaponCargoGlobal _vehicle;
	clearMagazineCargoGlobal _vehicle;
	clearItemCargoGlobal _vehicle;
};

_vehicle allowDamage true;
hint format["You have spawned a %1",_displayName];
closeDialog 0;

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
17 hours ago, Jnr4817 said:

// Check if we are over water (and assume we are on the USS Freedom). if ( surfaceIsWater _position ) then { _position = getPosATL Freedom_Spawn; };

 

Thanks , just you need to mention though what this variable name is :

_position = getPosATL Freedom_Spawn;

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×