Jump to content
Sign in to follow this  
MonsterXXX

Some questions need help

Recommended Posts

Hi,

I have some questions about damaged vehicle and vehicle respawn need to help. So can anyone tell me how to?

1. how do I setting the vehicle name in init line when it heavily damaged or wercked then apper name on the map? Example: XXX need repair

2. When I get out the vehicle it will respawned to start point. How do I change from the script?

Edited by MonsterXXX

Share this post


Link to post
Share on other sites

For question 2 you can use Tophes vehicle spawn script found here. All you have to do is change the deserted timer to 0.

For question 1 you would use something along these lines

_unit = player;
_WestHQ = createCenter West;        //used to initialize a side which has no units present in the Mission.sqm, so that you can spawn groups and units for it. 
_group = createGroup West;            //Creates a new AI group for the given Side. An HQ (center) for that side must already have been initialized with createCenter.

_veh = [(getpos _unit), random 360, "AH1Z", _group] call BIS_fnc_spawnVehicle;       //spawns in a Cobra helicopter

waitUntil
{
	_checkdamage = false;
if (getDammage _veh > 0.8) then {_checkdamage = true};
	_checkdamage
};

hint format ["%1 your %2 has been damaged and needs repair!", _unit, typeof _veh]

Edited by cobra4v320

Share this post


Link to post
Share on other sites

@cobra4v320 thank's for you replied my question so soon.

Q2 was solved but Q1 I have no idea how to place it? If I using ingame edit how do I place vehicle mark to init line?

Share this post


Link to post
Share on other sites

Place the script into a notepad and save as helidamage.sqf. Then save it into your mission folder. In the script you can set the getdamage to whatever level of damage you want 0 is no damage and 1 is vehicle destroyed. You will also need to place a Functions Module on the map.

In a radio alpha trigger under the init place: nul = [] execVM "helidamage.sqf"

_unit 		= player;
_WestHQ 	         = createCenter West;
_group 		= createGroup West;
_pos 		= [(getpos _unit select 0), (getpos _unit select 1), 50];
_dir		= random 360; 

_veh = [_pos, _dir, "AH1Z", _group] call BIS_fnc_spawnVehicle;

_veh = _veh select 0;

waitUntil
{
	getDammage _veh >= 0.5
};

hint format ["[color="RoyalBlue"]%1 [/color]your [color="Red"]%2[/color] has been damaged and needs repair!", [color="royalblue"]_unit[/color], [color="red"]typeof _veh[/color]]

If someone has a shorter version to do this please let us know.

Edited by cobra4v320

Share this post


Link to post
Share on other sites

I have to say I'm not very good for english and mission edit. So can you help me step by step?

1. When I place a Functions Module on the map then under the init place: nul = [] execVM "helidamage.sqf". Do I enter something in []?

2. If I have 5 or more type vehicle how do I do?

Share this post


Link to post
Share on other sites

1. Nope, the Functions Module just has to be on the map because it's used by helidamage.sqf. You'd put the nul = []... stuff in trigger that was spawning the helicopters.

2. Ideally you'd want to change that script to support any type of vehicle.

Share this post


Link to post
Share on other sites
1. Nope, the Functions Module just has to be on the map because it's used by helidamage.sqf. You'd put the nul = []... stuff in trigger that was spawning the helicopters.

2. Ideally you'd want to change that script to support any type of vehicle.

How do I change the script for for any type of vehicle? I was confused.

Share this post


Link to post
Share on other sites

Changes in red:

nul = [[color="Red"]"AH1Z"[/color]] execVM "helidamage.sqf"

[color="Red"]_type = _this select 0;[/color]
_unit 		= player;
_WestHQ 	         = createCenter West;
_group 		= createGroup West;
_pos 		= [(getpos _unit select 0), (getpos _unit select 1), 50];
_dir		= random 360; 

_veh = [_pos, _dir, [color="Red"]_type[/color], _group] call BIS_fnc_spawnVehicle;

_veh = _veh select 0;

waitUntil
{
	getDammage _veh >=[color="Red"] 0.2[/color];

};

hint format ["%1 your %2 has been damaged and needs repair!", [color="Red"]name[/color] _unit, typeof _veh]

The 0.2 instead of 0.5 was because in testing if you hit a Chinook with a Stinger it would take out the engine, making it land, but damage wouldn't actually be greater than 0.5 yet the vehicle would still be out of commission and in need of repairs. The name was added so you didn't get a weird 1-B-0-1 UnitsName type name, just UnitsName.

Share this post


Link to post
Share on other sites

It's work. But this script not I want. I just need vehicle name apper on the map when damaged not hint on game screen.

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  

×