OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Rommel92 on 06 Jun 2008, 17:02:06
-
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:
player globalchat format ["%1",_pool];
_POOL = Scalar Bool Array 0xe0fffff etc.
-
Please give the last line of the script.
-
/*
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
-
That globalChat was in the function for debug purposes?
Add private for each variable. Missing private can cause some strange errors.
-
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.
-
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.
(http://img359.imageshack.us/img359/6074/platzlr6.jpg)
_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];
_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))
_count = count units call compile format[" '%1' ",_group];
player globalchat format ["%1",_count];