Home   Help Search Login Register  

Author Topic: Anoter Call Problem  (Read 1353 times)

0 Members and 1 Guest are viewing this topic.

Offline Rommel92

  • Members
  • *
Anoter Call Problem
« on: 06 Jun 2008, 17:02:06 »
Code: [Select]
if (_side == west) then
{
_pool = ["SquadLeaderW","SoldierWB","SoldierWG","SoldierWAT","SoldierWMG","SoldierWG","SoldierWMedic","SoldierWG","SoldierWG","SoldierWG","SoldierWG","SoldierWMG"];
};
if (_side == east) then
{
_pool = ["SquadLeaderE","SoldierEB","SoldierEG","SoldierEAT","SoldierEMG","SoldierEG","SoldierEMedic","SoldierEG","SoldierEG","SoldierEG","SoldierEG","SoldierEMG"];
};

A segment of a script that is run with a call compile preProcessFile... Doesn't like switch / if statements?!  :dunno:

Code: [Select]
player globalchat format ["%1",_pool];
_POOL = Scalar Bool Array 0xe0fffff etc.

Offline i0n0s

  • Former Staff
  • ****
Re: Anoter Call Problem
« Reply #1 on: 06 Jun 2008, 17:45:01 »
Please give the last line of the script.

Offline Rommel92

  • Members
  • *
Re: Another Call Problem
« Reply #2 on: 06 Jun 2008, 18:50:06 »
Code: [Select]
/*
make.sqf;
Version: 110 [07, 06, 2008];
Author(s): Rommel

Execution: nul = [WEST,"SoldierWB",(position Gulan),[],"FORM",10] execVM "make.sqf";
*/

_side = _this select 0;
_type = _this select 1;
_position = _this select 2;
_markers = _this select 3;
_special = _this select 4;

_pool = ["SquadLeaderW","SoldierWB","SoldierWG","SoldierWAT","SoldierWMG","SoldierWG","SoldierWMedic","SoldierWG","SoldierWG","SoldierWG","SoldierWG","SoldierWMG"];

_group = createGroup _side;

{
_man = _group createUnit [_x, _position, _markers, 0, _special];
[_man,_position] spawn
{
_para = _this select 0;
_pos = _this select 1;

_chute = "ParachuteC" createVehicle _pos;
_chute setPos [(_pos select 0) + (50 - random 100), (_pos select 1) + (50 - random 100),(_pos select 2) + 200];
_para moveInDriver _chute;
};
} forEach _pool;
 _group
« Last Edit: 22 Jun 2013, 06:05:49 by Rommel92 »

Offline i0n0s

  • Former Staff
  • ****
Re: Anoter Call Problem
« Reply #3 on: 06 Jun 2008, 18:54:38 »
That globalChat was in the function for debug purposes?

Add private for each variable. Missing private can cause some strange errors.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Anoter Call Problem
« Reply #4 on: 06 Jun 2008, 19:59:44 »
What you have in the first post doesnt coincide with the second one, so obviously the code that fails is not the last one.
In the first case, _pool is defined within the scope of the if, so you cannot use it outside it unless you add, for example,a private ["_pool"]; as very first line of your script.

Offline Rommel92

  • Members
  • *
Re: Anoter Call Problem
« Reply #5 on: 07 Jun 2008, 03:21:11 »
Thanks Mando!  :good:

HOWEVER:

Another question:

First Chat Line is Executing Code.
Second Chat Line is Received Code in the Executed Script. And then the error shown above.
Code below shown in order of debug lines.


Code: [Select]
_group = _this select 3 select 0;
_type = _this select 3 select 1;

player globalchat format["%1 --- %2 --- %3 --- %4",_group,_type,_pos,_shift];
call compile format ["titleCut ['Shift - Click %1 Waypoint Location on Map.','PLAIN DOWN',3]", _type];

call compile format ["onMapSingleClick '[''%1'',''%2'',_pos,_shift] call compile preProcessFile ''Scripts\OnMapSingleClick.sqf''; true;'",_group,_type];

Code: [Select]
_group = format["%1",_this select 0];
_type = _this select 1;
_pos = _this select 2;
_shift = _this select 3;

_side = side _leader;

player globalchat format["%1 --- %2 --- %3 --- %4",_group,_type,_pos,_shift];

if (_shift) then
{
onMapSingleClick "";
_waypoint = _group addWaypoint [_pos, 20];
_waypoint setWaypointType _type;

[_side, "HQ"] sideChat format["%1 %2 task received. Out.",_group, _type];
};

Its clearly coming in as a string, but how do I convert this to a GROUP. :blink:
(Or a BOOL as the game says it is... (via further debugging))
Code: (debugging) [Select]
_count = count units call compile format[" '%1' ",_group];
player globalchat format ["%1",_count];
« Last Edit: 07 Jun 2008, 03:43:00 by Rommel92 »