Jump to content
Sign in to follow this  
fro

ArmA 2: CfgVehicles - Vodnik Class troubles

Recommended Posts

Hey everyone,

I have been messing with a script all night and can't figure it out. I am using bon's AI recruitment script to spawn vehicles along with soldiers. It is working great except for one thing. when I try to spawn a Vodnik (2xPk) two of them appear and for the ambulence version 3 pop up.

In bon's script (more specifically the recruit.sqf file) I have entered several lines of code. The part that I believe is messing up is:

if(side player == east) then {
	if(_unittype isKindOf "Tank") then {
		_unit = _unittype createVehicle (getMarkerPos "ruhvyspawn");
		};
	if(_unittype isKindOf "BTR90_Base") then {
		_unit = _unittype createVehicle (getMarkerPos "ruhvyspawn");
		};
	if(_unittype isKindOf "GAZ_Vodnik_MedEvac") then {
		_unit = _unittype createVehicle (getMarkerPos "ruvhopspawn");
		};
	if(_unittype isKindOf "GAZ_Vodnik") then {
		_unit = _unittype createVehicle (getMarkerPos "rulgtspawn");
		};
	if(_unittype isKindOf "GAZ_Vodnik_HMG") then {
		_unit = _unittype createVehicle (getMarkerPos "rulgtspawn");
		};
	if(_unittype isKindOf "Kamaz_Base") then {
		_unit = _unittype createVehicle (getMarkerPos "rulgtspawn");
		};
	if(_unittype isKindOf "UAZ_AGS30_RU") then {
		_unit = _unittype createVehicle (getMarkerPos "rulgtspawn");
		};
	if(_unittype isKindOf "UAZ_RU") then {
		_unit = _unittype createVehicle (getMarkerPos "rulgtspawn");
		};
};

I am finding the vehicle classes from:

http://community.bistudio.com/wiki/ArmA2:_CfgVehicles

I believe that there has been a mistake where it lists the vodniks further down the page.

The Vodnik heirarchy goes as follows:

-GAZ_Vodnik_HMG

--GAZ_Vodnik

---GAZ_Vodnik_MedEvac

If I am reading this correctly they are all a part of the GAZ_Vodnik_HMG "Family" which is the BPPU varient and I have a hard time believing that. Also most the other classes usually start with a (name your unit)_Base model and then work into the different variants.

To get to the point I want to know what the proper hierarchy for the Vodnik is and how we can bring this to the attention of someone who can fix the Bohemia Interactive Wiki.

Thanks for the help in advance.

Share this post


Link to post
Share on other sites

To get to the point I want to know what the proper hierarchy for the Vodnik is and how we can bring this to the attention of someone who can fix the Bohemia Interactive Wiki.

Fix what? BIS devs aren't the most logical people. ;) There are tons of things like this in the game.

I try to spawn a Vodnik (2xPk) two of them appear and for the ambulence version 3 pop up.

That in itself is proof that the Wiki is correct. Your script checks if the unit is medevac, which is true. Then it checks if it's medevac's superclass/parent, which is true. And then it checks if its the Vodnik base class, again true.

Voila, you have 3 Vodniks, because it passed 3 IFs.

You might want to use typeOf instead.

Share this post


Link to post
Share on other sites

Shuko,

Thanks for replying. I have tried the following in my script:

_GAZ_Vodnik_HMG = typeOf _unittype

GAZ_Vodnik_HMG = typeOf _unittype

"GAZ_Vodnik_HMG" = typeOf _unittype



_unittype = typeOf _GAZ_Vodnik_HMG

_unittype = typeOf GAZ_Vodnik_HMG

_unittype = typeOf "GAZ_Vodnik_HMG"



_unittype typeOf "GAZ_Vodnik_HMG"

_unittype typeOf _GAZ_Vodnik_HMG

_unittype typeOf GAZ_Vodnik_HMG



"GAZ_Vodnik_HMG" typeOf _unittype

_GAZ_Vodnik_HMG typeOf _unittype

GAZ_Vodnik_HMG typeOf _unittype

and none of them worked...

anymore help would be greatly appreciated

Share this post


Link to post
Share on other sites
if(typeof _unittype == "GAZ_Vodnik_MedEvac") then {
 _unit = _unittype createVehicle (getMarkerPos "ruvhopspawn");
};
if(typeof _unittype in ["GAZ_Vodnik","GAZ_Vodnik_HMG"]) then {
 _unit = _unittype createVehicle (getMarkerPos "rulgtspawn");
};

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
Sign in to follow this  

×