Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
VanhA-ICON

params help + Spawn function

Recommended Posts

Right. It's been many weeks now banging my head so help would be appreciated. :confused:

Situation:

I'm trying for the first time to implement some params to select if enemy will have reinforcements or not.

I have actually two versions ,group and revive but I'll show the revive one as example.

I can't get the reinforcement parameters to work and spawn troops. The option for "No reinforcements" should delete area trigger which is "Detected by OPFOR" but that don't happen either.

The trigger sets a variable "AA" which is second condition for two triggers confining the reinforcements if "LIGHT" or "HEAVY" is chosen.

Description:

// Mission Header

class Header

{

gameType = Coop;

minPlayers = 1;

maxPlayers = 8;

};

// description.ext settings for revive

///////////////////////////////////////////////////////////////////////////////////////////

respawn = "BASE";

respawndelay = 4;

disabledAI = 1;

#include "revive_sqf\dialogs\config.cpp"

#include "revive_sqf\dialogs\define.hpp"

#include "revive_sqf\dialogs\rev_cam_dialog.hpp"

#include "revive_sqf\dialogs\respawn_button_1.hpp"

#include "revive_sqf\dialogs\respawn_button_2.hpp"

#include "revive_sqf\dialogs\respawn_button_3.hpp"

#include "revive_sqf\dialogs\respawn_button_4.hpp"

#include "revive_sqf\dialogs\respawn_button_1b.hpp"

#include "revive_sqf\dialogs\respawn_button_1c.hpp"

#include "revive_sqf\dialogs\respawn_button_2b.hpp"

#include "revive_sqf\dialogs\respawn_button_3b.hpp"

#include "revive_sqf\dialogs\respawn_button_4b.hpp"

#include "revive_sqf\dialogs\respawn_button_1map.hpp"

#include "revive_sqf\dialogs\respawn_button_2map.hpp"

#include "revive_sqf\dialogs\respawn_button_3map.hpp"

#include "revive_sqf\dialogs\respawn_button_4map.hpp"

#include "revive_sqf\dialogs\OK_map.hpp"

#include "revive_sqf\dialogs\dead_cam_dialog.hpp"

///////////////////////////////////////////////////////////////////////////////////////////

class Params

{

class reinforcements

{

title = "Enemy reinforcements:";

values[] = {3,2,1};

texts[] = {"Heavy","Light","None"};

default = 2;

};

class Revive

{

// paramsArray[2]

title = "Number of Revives:";

values[] = {2000,1000,20,10,7,5};

texts[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7 - Hard","5 - Extreme"};

default = 7;

};

};

//============================================================================================

class RscTitles

{

#include "VanhA.h"

};

Init.sqf:

SOBER = false;

enableSaving [false, false];

server execVM "revive_init.sqf";

server execVM "scripts\Rf.sqf";

cutRsc ["Va", "PLAIN", 0.9];

player setVariable ["BIS_noCoreConversations", true];

[] execVM "scripts\blur.sqf";

group player selectLeader player;

// ====================================================================================

[[

["true","tsk1",["Get some coffee from backpacks to sober up ","Get some coffee from backpacks", "Get some coffee"], "crs"],

["true","tsk2",["Go visit the granny","Go visit the granny", "Visit the granny"], "gr"]

],[

["true",["Mission details","Your team is celebrating christmas with a <marker name="prt"">beach party</marker> when one of you suddenly realizes that Sosabowski's grandmother lives near here in <marker name=""gr"">Bled</marker>.What a great idea to sober up a bit and go for a traditional christmas dinner!?]],

["true",["Credits", "This mission was made by VanhA from ICON squad.<br /><br />taskmaster by Shuko, revive by norrin"]],

["true",["Respawn", "The Humvee (regular) is the mobile spawn vehicle"]]

]] execvm "briefing.sqf";

// ====================================================================================

the reinforcement params:

waitUntil {!isnil "bis_fnc_init"};

if (isServer)

then

{

_reinforcements = (paramsArray select 1);

if (_reinforcements == 1) then

{

deleteVehicle tutka;

};

if (_reinforcements == 2) then

{

LIGHT = true;publicVariable "LIGHT";

};

if (_reinforcements == 3) then

{

HEV = true;publicVariable "HEV";

};

};

And last one of the spawn scripts:

waitUntil {!isnil "bis_fnc_init"};

if (isServer)

then

{

_pos = getPos spawngroup2;

_skill = [0.5, 0.5];

_side = EAST;

_units = ["RU_Soldier_SL", "RU_Soldier_TL", "RU_Soldier_AR", "RU_Soldier_AR", "RU_Soldier_LAT", "RU_Soldier_LAT", "RU_Soldier", "RU_Soldier_LAT", "RU_Soldier", "RU_Soldier_GL", "RU_Soldier_LAT", "RU_Soldier", "RU_Soldier_Marksman", "BTR90", "UAZ_AGS30_RU"];

_newGroup2 = [_pos, _side, _units, [], [], _skill] call BIS_fnc_spawnGroup;

_wp = _newGroup2 addWaypoint [(getmarkerpos "TRG2"), 0];

_wp setWaypointType "SAD";

_wp setWaypointSpeed "FULL";

_newGroup2 enableAttack true;

};

Now, I cant find any rpt errors that would help me specify why it won't work.

The revive params do work.

Any ideas what am I doing wrong?

Share this post


Link to post
Share on other sites

First of all, you are trying to do it in an unnecessarily complex way. Second, you are selecting the 2nd parameter, when the paramsarray starts from 0.

_reinforcements = (paramsArray select 1);

to

_reinforcements = (paramsArray select 0);

Share this post


Link to post
Share on other sites
First of all, you are trying to do it in an unnecessarily complex way.

Unfortunately script finesse is not my strongest point when making these...

Thank you for help :o

Share this post


Link to post
Share on other sites
Sign in to follow this  

×