Rommel 2 Posted January 17, 2008 Executed via: [player] exec "thisscript.sqs" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _xo = _this select 0 _side = format ["%1",side _xo] _dummygroup = format ["%1group", _side] _Hloc = format ["%1dz", _side] I currently have the... object: WESTdz group: WESTgroup which work when just simply typed, however if format'ed' they do not seem to work when trying a createunit. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _x = (getPos _Hloc select 0) - 50 + Random 50 _y = (getPos _Hloc select 1) - 50 + Random 50 _z = (getPos _Hloc select 2) + 220 _para = "ParachuteC" CreateVehicle [_x,_y,_z] "SoldierWB" createunit [[_x,_y,_z], _dummygroup, "this moveindriver _para", 0, "SERGEANT"] With errors: For the object: Type Any, Expected Number Meaning it wants coordinates, which means it is not retrieving them from the getpos of _Hloc, if I change it to WESTdz manually, it works as it can find the object? Howcome? For the group: Simple just does not create the man, typical of a createunit. It cannot find the group, which is evident of the checks I have made. Any way to fix/change this? EDIT: Is it because its returning a string not a value? Share this post Link to post Share on other sites
falseprophet 0 Posted January 17, 2008 What is WESTdz? did you define the group WESTdz in the editor with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">WESTgrp=group this; to convert it to a .sqf file, just change: instead <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> [player] exec "script.sqs"; use<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> nil= [player] execVM "script.sqf"; as .sqf Quote[/b] ]_xo = _this select 0; _side = format ["%1",side _xo]; _dummygroup =  format ["%1group", _side]; _Hloc  =  format ["%1dz", _side]; _x = (getPos _Hloc select 0) - 50 + Random 50; _y = (getPos _Hloc select 1) - 50 + Random 50; _z = (getPos _Hloc select 2) + 220; _para = "ParachuteC" CreateVehicle [_x,_y,_z]; "SoldierWB" createunit [[_x,_y,_z], _dummygroup, "this moveindriver _para", 0, "SERGEANT"]; Share this post Link to post Share on other sites
Rommel 2 Posted January 17, 2008 Sorry for not being clearer, and thanks for making it SQF . WESTdz is the west dropzone point (a invisible Heli-pad) (An object) WESTman: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this] exec "scripts\disable_ai.sqf"; WESTgrp = group this; Share this post Link to post Share on other sites
falseprophet 0 Posted January 17, 2008 init the group befor you start the script, thats maybe a little bug... Share this post Link to post Share on other sites
Rommel 2 Posted January 17, 2008 spent half an hour with falseprophet, and no change. Somethings wrong here peeps! Help! EDIT: Wooooooooooooooooooooooooooooooooooooooooooo <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_xo = _this select 0; _side = format ["%1",side _xo]; _dummygroup = format ["%1grp", _side]; _Hloc = WESTdz; If (_dummygroup == "WESTgrp") then {_dummygroup = WESTgrp;} else { }; player groupchat format ["%1 %2", _hloc, _dummygroup]; _x = (getPos _Hloc select 0) - 50 + Random 50; _y = (getPos _Hloc select 1) - 50 + Random 50; _z = (getPos _Hloc select 2) + 220; para = "ParachuteC" CreateVehicle [_x,_y,_z]; para setPos [_x,_y, 90]; "SquadLeaderW" createunit [[_x,_y,_z], _dummygroup, "this moveindriver para", 0.4, "SERGEANT"]; I fixed it, converted the formats from a string to the wanted propertys (objects) Share this post Link to post Share on other sites
=Odin= 0 Posted January 17, 2008 try swapping this with yours see if it works Quote[/b] ]#drop ? _i > 11 : ParaInProgress = false; exit _x = (getPos _Hloc select 0) - 30 + Random 30 _y = (getPos _Hloc select 1) - 30 + Random 30 _z = 220 PARA = "ParachuteWest" CreateVehicle [_x,_y,_z] "SoldierWB" CreateUnit [[_x,_y,_z], _group, "this moveInDriver PARA", Random 1, "SERGEANT"] PARA setPos [_x,_y,50] ~.1 _i = _i + 1 its in sqs but I think if you add ; after each line, and change ~.1 to sleep 0.1 it should work as sqf (not sure though) Share this post Link to post Share on other sites
UNN 0 Posted January 17, 2008 @Rommel What you're trying to do here: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dummygroup = Â format ["%1grp", _side]; If (_dummygroup == "WESTgrp") then {_dummygroup = WESTgrp;} else { }; Could be done like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dummygroup=Call Compile format ["%1grp", _side]; Share this post Link to post Share on other sites
Rommel 2 Posted January 17, 2008 How is that different? Obviously it has Call Compile at the start, but what does that do? @Odin Nah thanks mate, its what I got my foundation code for this script, you may notice its similar in layout at first, I've also used some of your dialog layouts, which thank you I have learnt so much about them, and thanks to Falseprophet for teaching me a lot about SQF! Still going about editing this, appreciating the help. Share this post Link to post Share on other sites
Doolittle 0 Posted January 18, 2008 call compile is basically saying treat a STRING like a variable instead. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_group", "_pos", "_v", "_unit", "_i"]; _group = call compile format ["%1grp", side _this]; _pos = call compile format ["getPos %1dz", side _this]; for [{_i = 0}, {_i < 10}, {_i = _i + 1}] do { _v = "ParachuteWest" createVehicle [(_pos select 0) + random 50 - 25, (_pos select 1) + random 50 - 25]; _unit = _group createUnit ["SoldierWMG", getPos _v, [], 0, "NONE"]; _unit moveInDriver _v; sleep 0.5; }; Share this post Link to post Share on other sites
Rommel 2 Posted January 18, 2008 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> private ["_group", "_pos", "_v", "_unit", "_i","_grpL","_grp","_s"]; _group = call compile format ["%1grp", side _this]; _grpL = leader _group; _pos = call compile format ["getPos %1dz", side _this]; If (side _this == "WEST") then {_s = SoldierWMG} else {_s = SoldierEMG}; for [{_i = 0}, {_i < 10}, {_i = _i + 1}] do { _v = "ParachuteC" createVehicle [(_pos select 0) + random 50 - 25, (_pos select 1) + random 50 - 25]; _unit = _group createUnit [_s, getPos _v, [], 0, "NONE"]; _unit moveInDriver _v; sleep 0.5; _nullgrp = (units _grpL) select 1; [_nullgrp] join grpNull; _grp = group _nullgrp; }; Would that work? Share this post Link to post Share on other sites