Jump to content
Sign in to follow this  
dale0404

call BIS_fnc_spawnVehicle;

Recommended Posts

Hello Xeno

Is there a way to modify your script ... I want to call most of the parameters from execVM. Such as random number, position of spawn/marker Name, distance to waypoints ... Except vehicle_types of course.

For example ["numberOfVehicle", "positionToSpawn", "distanceToWayponts", "blaBla"] execVM "patrol_ru.sqs"

Is it passable to spread spawn position a little (with X Y random range maybe?). Because now all vehicles spawn one on other. Some of them get damaged.

Thanks in advance.

Edited by AKM74

Share this post


Link to post
Share on other sites

hi

just cant get anything to spawn still

here's what ive placed in the editor

player usmc

functions module

1 RU soldier noplayable /probabillty of presence =0

trigger

radius 300x300

activation west,present

tiggers on act has the following

call {
_vehicle_types = ["BMP3","BTR90","T72_RU","T90","GAZ_Vodnik","GAZ_Vodnik_HMG"];
_max_dist_between_waypoints = 1000;

_dgrp = createGroup east;
_vec_type = floor (random count _vehicle_types);

for "_i" from 1 to 5 do {
   [(getpos troops1_1_7), random 360, _vehicle_types select _vec_type, _dgrp] call BIS_fnc_spawnVehicle;
};

[_dgrp, (getpos troops1_1_7), _max_dist_between_waypoints] call BIS_fnc_taskPatrol;
}

tried it with trigger activation set to west/civ/anybody/none and all with present and not present

so anyidea what im missing please!

Edited by BiGGiBs

Share this post


Link to post
Share on other sites

You must place a game logic or something with the name "troops1_1_7"

Share this post


Link to post
Share on other sites

thanks for the help

Although that didn't work

added a gamelogic named troops1_1_7

tried both types of game logic

class=location

class=game logic

neither made any diffrence still nothing spawning...sigh!

FIXED:

just needed to reset the triggers type back to 'none'

i had changed that trying to get this script to work

as amk74 says shame the vehicles seem to spawn 30ft in the air and either land upside down or fly off 100's ft into the air

even though everything is placed in a flat open field

not like there are trees or rocks ect that might cause that!...hmm

random doesn't seem to be very 'how should i put this 'random' unless i've mis read what xeno said

always spawns 5 of the same vehicles...5 x btr90's , 5 x vodniks ,5 x t90's ect

Edited by BiGGiBs

Share this post


Link to post
Share on other sites

Why can't I get a trigger to allow me to use this in the OnAct line:

call {
_vehicle_types = ["BMP3","BTR90","T72_RU","T90","GAZ_Vodnik","GAZ_Vodnik_HMG"];
_max_dist_between_waypoints = 1000;

_dgrp = createGroup east;
_vec_type = floor (random count _vehicle_types);

for "_i" from 1 to 5 do {
   [(getpos troops1_1_7), random 360, _vehicle_types select _vec_type, _dgrp] call BIS_fnc_spawnVehicle;
};

[_dgrp, (getpos troops1_1_7), _max_dist_between_waypoints] call BIS_fnc_taskPatrol;
}

It says I'm missing a ";". All I did was copy n' paste this from the post above.

Share this post


Link to post
Share on other sites

HI all

The below works well and I have used it a lot.

if(!isServer) exitWith{};

waitUntil {!isNil "bis_fnc_init"};

_pos = _this select 0;

_x = _this select 1;

for "_i" from 1 to _x do {

_units = 2 + Random 10;

sleep 5;

_grp = [(getMarkerpos _pos),east,_units] call bis_fnc_spawngroup;

[_grp, ( getMarkerpos _pos), 250] call BIS_fnc_taskPatrol;

};

Share this post


Link to post
Share on other sites

What is wrong with this:

_group_types = ["RU_InfSquad", "RU_InfSection", "RU_InfSection_AT", "RU_InfSection_MG", "RUS_ReconTeam", "RU_MotInfSquad", "RU_MotInfSection_Recon", "RU_MotInfSection_Patrol", "RU_MechInfSquad_1", "RU_MechInfSquad_2", "RU_TankPlatoon"];


_group_type = floor (random count _group_types);

_grp_pos = getPos _trigger;


_patrol_grp = [_grp_pos, EAST, _group_types select _group_type] call BIS_fnc_spawnGroup;

It doesn't create any squads? Is there something wrong with that array?

---------- Post added at 05:08 PM ---------- Previous post was at 03:56 PM ----------

Meh, I did it the hard way:

_patrol_type = floor (random 12);

switch (_patrol_type) do  
{
case 0: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSquad")] call BIS_fnc_spawnGroup};
case 1: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSection")] call BIS_fnc_spawnGroup};
case 2: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSection_AT")] call BIS_fnc_spawnGroup};
case 3: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSection_AA")] call BIS_fnc_spawnGroup};
case 4: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_InfSection_MG")] call BIS_fnc_spawnGroup};
case 5: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RU_SniperTeam")] call BIS_fnc_spawnGroup};
case 6: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> "RUS_ReconTeam")] call BIS_fnc_spawnGroup};
case 7: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Motorized" >> "RU_MotInfSquad")] call BIS_fnc_spawnGroup};
case 8: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Motorized" >> "RU_MotInfSection_Recon")] call BIS_fnc_spawnGroup};
case 9: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Motorized" >> "RU_MotInfSection_Patrol")] call BIS_fnc_spawnGroup};
case 10: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Mechanized" >> "RU_MechInfSquad_1")] call BIS_fnc_spawnGroup};
case 11: {_patrol_grp = [_grp_pos, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Mechanized" >> "RU_MechInfSquad_2")] call BIS_fnc_spawnGroup};
};

But Somehow _patrol_grp doesn't notice the waypoints I added to them???:

_pgwp1 = _patrol_grp addWaypoint [getPos _trigger, 100];
_pgwp1 setWaypointType "SAD"; 
_pgwp1 setWaypointSpeed "LIMITED";
_pgwp1 setWaypointBehaviour "AWARE";
_pgwp1 setWaypointCombatMode "RED";

So it's not referring to "_patrol_grp" anymore. Anyone know why?

Edited by Bunny75

Share this post


Link to post
Share on other sites

Hi all

Ive only just discovered how to get the functions help menu to pop up while in editer and i noticed the bis_fnc_spawnvehical.sqf my question is can i use this to say spawn a AH1Z to help me after ive blown up or killed a certain something from a trigger if so how would i go about doin it :)

thanks

Share this post


Link to post
Share on other sites

Is it possible to spawn a unit with a init line that execute when the unit spawn?

I would like to spawn a unit that should patrol a marker area using the UPS script.

Share this post


Link to post
Share on other sites
Is it possible to spawn a unit with a init line that execute when the unit spawn?

I would like to spawn a unit that should patrol a marker area using the UPS script.

You can always do this after creation:

unit setVehicleInit "whateveryouwantodoasinit"; processInitCommands;

Share this post


Link to post
Share on other sites

Instead starting new thread ill just ask this here sorry iam playing about with the editer and ive placed radar named it rad1 and then placed 3 tunguskas

soon as ive blown up the radar i want the tunguskas to be disabled dont matter if blows them up.

I placed a trigger and put !alive rad1 in the condition and then in the on act i put !alive tung1 && !alive tung2 && !alive tung3 but its not havin it help please ta

edit: nvm figured it out with set damage command

Edited by muttly

Share this post


Link to post
Share on other sites
You can always do this after creation:

unit setVehicleInit "whateveryouwantodoasinit"; processInitCommands;

Cool thanks :cool:

Share this post


Link to post
Share on other sites

what have i done wrong with this one ?

In a trigger from editor i put this in the activation:

if (isServer) then

{grp1 = [

getmarkerPos "spawn_1", 180, "BMP3", EAST] call bis_fnc_spawnvehicle;

null=[grp10,(getMarkerPos "wp_1"),750] execVM "scripts\BIN_taskPatrol.sqf"};

The BMP spawns when the trigger gets activated but it wont use Patrol script.

Also how can i add something to the init of the BMP3 ?

Share this post


Link to post
Share on other sites

try

if (isServer) then

{grp10 = [

getmarkerPos "spawn_1", 180, "BMP3", EAST] call bis_fnc_spawnvehicle;

null=[grp10,(getMarkerPos "spawn_1"),750] execVM "scripts\BIN_taskPatrol.sqf"};

---------- Post added at 03:32 PM ---------- Previous post was at 03:29 PM ----------

Also how can i add something to the init of the BMP3 ?

_grp10 setVehicleInit "null = [group this,(getPos this), 250] execVM ""scripts\BIN_taskPatrol.sqf""; ";

Share this post


Link to post
Share on other sites
what have i done wrong with this one ?

In a trigger from editor i put this in the activation:

The BMP spawns when the trigger gets activated but it wont use Patrol script.

Also how can i add something to the init of the BMP3 ?

If you absolutely need to spawn from a trigger:

if (isServer) then

{

grp1 = createGroup east;

[(getmarkerpos "spawn_1"), 180, "BMP3", grp1] call BIS_fnc_spawnVehicle;

null=[grp1,(getMarkerPos "wp_1"),750] execVM "scripts\BIN_taskPatrol.sqf";

};

Share this post


Link to post
Share on other sites

Is it possible to use BIS_fnc_spawnVehicle to spawn vehicles from communtiy addons?

Edited by sixpack
fixed typo

Share this post


Link to post
Share on other sites
Is it possible to use BIS_fbc_spawnVehicle to spawn vehicles from communtiy addons?

I have used BIS_fbc_spawnGroup to spawn Addon vehicles manned so I would venture to say yes you can use BIS_fbc_spawnVehicle to do that as well. I have just not tested it.

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  

×