Page MenuHomeFeedback Tracker

spawn has stopped working
Closed, ResolvedPublic

Description

I use on map triggers to make the following:

An object is placed on the map, called mainobj1

Locations of spawn key off that object, ex:

QRFDIST1 = 1000;
QRFDIR1 = 0;
QRFDIRTEXT1 = "North";

EQDEPDIR1 = QRFDIR1-30;
EQDEPDIR2 = QRFDIR1+30;

When the scenario begins, this following is executed:

The markers are just flag markers, which are deleted within 300 seconds

"marker_0" setMarkerPos (MAINOBJ1 getPos [QRFDIST1,EQDEPDIR1]);
"marker_1" setMarkerPos (MAINOBJ1 getPos [QRFDIST1,EQDEPDIR2]);
TREIN1 setPos (MAINOBJ1 getPos [QRFDIST1,EQDEPDIR1]);
TREIN2 setPos (MAINOBJ1 getPos [QRFDIST1,EQDEPDIR2]);

Once the player appears in the area of mainobj1, within a time from of from 300 seconds to 900 seconds, an infantry units is s'posed to spawn:

ES1W1 is the spawned group object id

TREIN1 is the object where the new unit appears

ESONEA is a variable of which is defined on a separate file ( I called deployments-mobile.sqf) the type of group to be spawned;

ES1W1 = [getPos TREIN1, OPFOR, [ESONEA],[],[],[],[],[],180] call BIS_fnc_spawnGroup;

This is the error message:

16:52:53 Error in expression <= getNumber(configFile >> "CfgVehicles" >> _type >> "isMan") == 1;

if !(_isMan>
16:52:53 Error position: <>> _type >> "isMan") == 1;

if !(_isMan>
16:52:53 Error >>: Type Config entry, expected String
16:52:53 File /temp/bin/A3/Functions_F/Spawning/fn_spawnGroup.sqf..., line 127

It doesn't matter if it is vanilla Arma 3 units or CUP or RHS units, which I use constantly. Doesn't matter the terrain, or any other mods I use.

Vehicles spawn just fine, no problem, but not actual groups.

Details

Severity
Major
Resolution
Not A Bug
Reproducibility
Always
Operating System
Windows 10 x64
Category
AI Issues
Steps To Reproduce

As above.

Additional Information

this is the dump from init.sqf:

execVM "briefing.sqf";
execVM "deployments-mobile.sqf";

briefing.sqf contains the randomization for date and weather, as well as names of Bad Guys and Bad Gals;

deployments-mobile.sqf contains all the randomization data the units to be spawned:

Example:

comment "Attack QRF Light Infantry for attack and defend scenarioes. First wave";

ESONEA= selectRandom [
configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad",
configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad",
configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad"];

Event Timeline

badanov created this task.Dec 8 2022, 12:13 AM
dedmen added a subscriber: dedmen.EditedDec 8 2022, 12:49 PM
if !(_isMan>
16:52:53 Error >>: Type Config entry, expected String
16:52:53 File /temp/bin/A3/Functions_F/Spawning/fn_spawnGroup.sqf..., line 127

Well as it says, expects string, not config entry

And if you look at the documentation, https://community.bistudio.com/wiki/BIS_fnc_spawnGroup the array takes classnames, not config entries.

So you are just using it wrong.
And looking at the wiki history, it has been like that since 2014.

Also your selectRandom between 3 same classes doesn't make sense, its always the same

I think instead of example 3 syntax, you want to use example 2. So:
[getPos TREIN1, OPFOR, ESONEA] call BIS_fnc_spawnGroup

dedmen closed this task as Resolved.Dec 8 2022, 12:49 PM
dedmen changed Resolution from Open to Not A Bug.

Not meaning to belabor your point, but the spawn says:

toSpawn - Can be one of:
Array - list of character types
Number - amount of characters to spawn
Config - CfgGroups entry

So, I am not using it wrong, but Arma 3's implementation of it has changed.

**This fails silently:

Testing using arrays.**

INFORCE1 = ["CFP_O_CHDKZ_Commander_SNW_01",
"CFP_O_CHDKZ_Automatic_Rifleman_SNW_01",
"CFP_O_CHDKZ_Grenadier_SNW_01",
"CFP_O_CHDKZ_AK_74_SNW_01",
"CFP_O_CHDKZ_AT_Specialst_SNW_01",
"CFP_O_CHDKZ_Automatic_Rifleman_SNW_01",
"CFP_O_CHDKZ_AK_74_SNW_01",
"CFP_O_CHDKZ_Medic_SNW_01"];

_INFORCE2 = ["rhssaf_army_o_oakleaf_summer_sq_lead",
"rhssaf_army_o_oakleaf_summer_ft_lead",
"rhssaf_army_o_oakleaf_summer_rifleman_m70",
"rhssaf_army_o_oakleaf_summer_mgun_m84",
"rhssaf_army_o_oakleaf_summer_gl",
"rhssaf_army_o_oakleaf_summer_ft_lead",
"rhssaf_army_o_oakleaf_summer_mgun_m84",
"rhssaf_army_o_oakleaf_summer_gl",
"rhssaf_army_o_oakleaf_summer_at",
"rhssaf_army_o_oakleaf_summer_medic"];

INFORCE3 = ["CUP_O_sla_Soldier_SL_militia",
"CUP_O_sla_Soldier_MG_militia",
"CUP_O_sla_Soldier_AT_militia",
"CUP_O_sla_Soldier_GL_militia",
"CUP_O_sla_Soldier_MG_militia",
"CUP_O_sla_Soldier_LAT_militia",
"CUP_O_sla_Soldier_GL_militia",
"CUP_O_sla_Soldier_AAT_militia",
"CUP_O_sla_Soldier_AMG_militia",
"CUP_O_sla_Soldier_Medic_militia"];

INFORCE4 = ["CUP_O_MVD_Soldier_TL",
"CUP_O_MVD_Soldier_MG",
"CUP_O_MVD_Soldier_AT",
"CUP_O_MVD_Soldier_GL",
"CUP_O_MVD_Soldier_Sniper",
"CUP_O_MVD_Soldier_Marksman",
"CUP_O_MVD_Soldier_GL",
"CUP_O_RU_Medic"];

INFORCE5 = ["CFP_O_Wagner_Team_Coordinator_WIN_01",
"CFP_O_Wagner_Field_Specialist_RPG18_WIN_01",
"CFP_O_Wagner_Marksman_WIN_01",
"CFP_O_Wagner_Field_Specialist_RPK_WIN_01",
"CFP_O_Wagner_Field_Specialist_PKM_WIN_01",
"CFP_O_Wagner_Field_Specialist_AK74_GL_WIN_01",
"CFP_O_Wagner_Field_Specialist_AKMN_WIN_01",
"CFP_O_Wagner_Contractor_2_WIN_01",
"CFP_O_Wagner_Field_Medic_WIN_01"];

INFORCE1 = ["rhs_vmf_recon_sergeant",
"rhs_vmf_recon_efreitor",
"rhs_vmf_recon_arifleman",
"rhs_vmf_recon_machinegunner_assistant",
"rhs_vmf_recon_makrsman_vss",
"rhs_vmf_recon_rifleman_lat",
"rhs_vmf_recon_medic"];

SELECTRAND1=true;

ESONEA= selectRandom [INFORCE1,INFORCE2,INFORCE3,INFORCE4];

SPAWND1=true;

ES1W1 = [getPos TREIN2, side player, [ESONEA],[],[],[],[],[],180] call BIS_fnc_spawnGroup:

This works, but I can't randomize selections, there is no question the random function works, but the data doesn't pass to the next trigger:

ES1W1 = [getPos TREIN1, side player, ["CFP_O_CHDKZ_Commander_SNW_01",
"CFP_O_CHDKZ_Automatic_Rifleman_SNW_01",
"CFP_O_CHDKZ_Grenadier_SNW_01",
"CFP_O_CHDKZ_AK_74_SNW_01",
"CFP_O_CHDKZ_AT_Specialst_SNW_01",
"CFP_O_CHDKZ_Automatic_Rifleman_SNW_01",
"CFP_O_CHDKZ_AK_74_SNW_01",
"CFP_O_CHDKZ_Medic_SNW_01"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;

I am telling you there is a bug lurking on there somewhere.

One other element to note:

Every last one of the listed OPFOR groups have no medic. Dunno if this is a factor, or even it was a design change.