vova _fox
Member-
Content Count
39 -
Joined
-
Last visited
-
Medals
Everything posted by vova _fox
-
ahahahaha list=nearestObjects [position player,[], 100]
-
Global/Local variable problem with Dialog
vova _fox replied to Bbartram's topic in ARMA - MISSION EDITING & SCRIPTING
Hi guys, some question. #define CT_TOOLBOX 6 #define CT_CHECKBOXES 7 #define CT_PROGRESS 8 #define CT_STATIC_SKEW 10 #define CT_CONTEXT_MENU 14 #define CT_CONTROLS_GROUP 15 #define CT_XKEYDESC 40 #define CT_XBUTTON 41 #define CT_XLISTBOX 42 #define CT_XSLIDER 43 #define CT_XCOMBO 44 #define CT_ANIMATED_TEXTURE 45 #define CT_OBJECT 80 #define CT_OBJECT_ZOOM 81 #define CT_OBJECT_CONTAINER 82 #define CT_OBJECT_CONT_ANIM 83 #define CT_LINEBREAK 98 #define CT_USER 99 Someone known anything about of this control types? -
moveTo/doMove doesnt work 100%
vova _fox replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
_num = 1 #loop ~1 _array = nearestObjects [player, ["SoldierEB"], 50] _i=0 {if (alive _x) then {_array set[_i, _x]; _i=_i+1}} foreach _array _array resize _i ? count _array < 1 : goto "loop" _selection = _array select _num hint format["%1",_selection] goto "loop" -
Counting players in a marker area
vova _fox replied to Binary's topic in ARMA - MISSION EDITING & SCRIPTING
I'am don't think that's good: format["%1", loop]=false when i'am use that in ofp, it often crash game... format["%1", loop] can be "scalar bool array string ..." it no good maybe that beter: Condition: isnil "loop" On Act: .....; loop=nil On Dea: ....; loop=true -
-
If then statements eval all??
vova _fox replied to Doolittle's topic in ARMA - MISSION EDITING & SCRIPTING
Now i'am often use "double if".....: if ( if (isclass _entry) then {!(configname _entry) in _crash} else {false} ) then {_array=_array+(getclass _entry)}; ...etc -
breakOut, breakTo - related to While?
vova _fox replied to 5133p39's topic in ARMA - MISSION EDITING & SCRIPTING
array call func func= { try { _this call func2; } catch { hint _exception; }; }; func2= { { if (errorcondition) then {throw "error ....."}; } foreach _this; }; -
Short viewdistance for ai?
vova _fox replied to Ike_fin's topic in ARMA - MISSION EDITING & SCRIPTING
Try use that unit setskill ["spotDistance", 0.01] -
Height error with getpos being on buildings
vova _fox replied to rrores's topic in ARMA - MISSION EDITING & SCRIPTING
But if you check height of vehicle by this, result willbe not correctly. Universal (vehicles/units) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(unit modeltoworld ((boundingbox unit) select 0)) select 2 -
AI eventhandler problem
vova _fox replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
it because you again use private var in initialization "_unit = this" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? not local server : exit; _unit = _this select 0; _spawn = _this select 1; _grp = group _unit; ~2 HideBody _unit; ~2 deleteVehicle _unit; _unit = _grp createUnit ["ack_dpd_4", _spawn, [], 0, "NONE"]; _unit setRank "corporal"; _unit setskill 0.6; temp=str _spawn; publicvariable "temp"; _unit setVehicleInit "this addeventhandler [""killed"", {[this,call (compile temp)] exec ""respawnDead.sqs""}];" processInitcommands; exit; -
a simple looped SQF script
vova _fox replied to SouthSaturnDelta's topic in ARMA - MISSION EDITING & SCRIPTING
use waituntil -
AI eventhandler problem
vova _fox replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> temp=str _spawn; publicvariable "temp"; _unit setVehicleInit "this addeventhandler [""killed"", {[this,call (compile temp)] exec ""respawnDead.sqs""}];" -
Converting Strings
vova _fox replied to ColonelSandersLite's topic in ARMA - MISSION EDITING & SCRIPTING
My version of string to array function, based on cex's str2arr.cpp vf_strtoarray.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">vf_sta_chars=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"," ","0","1","2","3","4","5","6","7","8","9",".",",",":","-","_"]; vf_sta_probel1000=""; for "_i" from 1 to 1000 do { vf_sta_probel1000=vf_sta_probel1000+" "; }; vf_sta_probel100=""; for "_i" from 1 to 100 do { vf_sta_probel100=vf_sta_probel100+" "; }; vf_sta_probel1_9=[""," "," "," "," "," "," "," "," "," "]; { private["_p","_str","_array","_char","_old"]; _array=[]; _old=""; _str=""; for "_i" from 2038 to 1 step -1 do { _p=""; for "_b" from 1 to (_i-_i mod 1000)/1000 do {_p=_p+vf_sta_probel1000}; for "_b" from 1 to (_i mod 1000 - _i mod 100)/100 do {_p=_p+vf_sta_probel100}; for "_b" from 1 to (_i mod 100 - _i mod 10)/10 do {_p=_p+" "}; _p=_p + (vf_sta_probel1_9 select (_i mod 10)); call compile(format["%1_str = ""%2",_p,_this] + """"); if (_old == _str) exitwith {_array}; _char={ if (_str==_old+_x) exitWith {_x}; ""} forEach vf_sta_chars; if (_char!="") then {_array=_array+[_char]}; _old=_str; }; _array } using: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_func=call (compile (preprocessfile "vf_strtoarray.sqf")); _array="string" call _func; about function first: this function use global variables vf_sta_chars vf_sta_probel1000 vf_sta_probel100 in vf_sta_chars array all chars that function will be added to array if they are in the given string. If char doesn't exist in vf_sta_chars the searching isn't stop when find that in array...english .. simple example: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _text="//string" call _func; result will be _text=["s","t","r","i","n","g"]; then "/" isn't exist in vf_sta_chars but converting don't stop and return ["s","t","r","i","n","g"], all chars that exist in vf_sta_chars and second this function convert 2000 chars by ~ 0.064 seconds, i think it fast -
As i understand only 'nearestobject id' command can find objects like trees, shapes..etc. But it not universal, because id has various numbers and usually don't depend but it positions on isalnd. I need more universal script \ function, that can find all objects at some position with some radius, with types and without types. Any ideas?
-
nearestobject id and all?1
vova _fox replied to vova _fox's topic in ARMA - MISSION EDITING & SCRIPTING
hahaha i'am everytime type nearestobject [getpos player,["all"], 100] i'am forgot that that objects aren't have classes <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nearestObjects [position player,[], 100] Works great! Thanks, fasad -
Single mission with onPlayerKilled.sqs script. Download and change as you wish. http://www.rapidshare.ru/472100
-
it happen when enableenddialog command is used wtf? you don't write enableenddialog in your script? Why 'death screen' is shown after death? It because when you death automatically run 'onPlayerKilled.sqs' script. If you don't have this script in your mission folder, it will be exec from 'ca.pbo\data\scripts\onPlayerKilled.sqs' ca.pbo\data\scripts\onPlayerKilled.sqs : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> titleCut["", "BLACK OUT",1] ~1 _animace = ["\ca\data\scripts\deathDefault.sqs", "\ca\data\scripts\death1.sqs"] _this exec ( _animace select floor(random((count _animace) - 0.5 ))) exit and the first strings in "\ca\data\scripts\deathDefault.sqs" and "\ca\data\scripts\death1.sqs" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;init enableEndDialog All that means: if you dont use the enableenddialog command you never see the 'death screen'. All that you need is create onPlayerKilled.sqs script in you mission folder, after this you dont' see 'death screen' after death. Finaly you must write teamswitch algoritm, like this for example: onPlayerKilled.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _group=group player ? {alive _x} count (units _group) == 0 : goto "end" _leader=leader _group ~0.5 addSwitchableUnit _leader selectplayer _leader exit #end ~2 enableenddialog sorry for english please
-
Checking if units in trigger are of certain name..
vova _fox replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
{if (!(_x in [civ1, civ2, civ3, civ4, civ5])) then {_x setDamage 1}} forEach thisList -
Destroying miscellaneous objects
vova _fox replied to celery's topic in ARMA - MISSION EDITING & SCRIPTING
Bombs aren't possible for my purposes. only bombs or other ammo (maybe many bullets ?...) -
Destroying miscellaneous objects
vova _fox replied to celery's topic in ARMA - MISSION EDITING & SCRIPTING
it because treeas and billboards aren't find by nearobjects command (and by nearestobjects and another..etc ) in ofp you can find trees by nearestobject command in arma - not -
Have to be missing something
vova _fox replied to CarlGustaffa's topic in ARMA - MISSION EDITING & SCRIPTING
maybe you missed " here? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["resultingfog :%1", _resultingfog] and maybe _resultfog var not _resultingfog? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["resultingfog :%1", _resultfog] -
vf_checkclass= { private ["_class","_cfg","_check"]; _class=_this select 0; _cfg=_this select 1; _check=_this select 2; while {_class != _check and _class != ""} do {_class=configname (inheritsfrom (_cfg>>_class))}; _class == _check }; usage : _condition=[_class,_config,_check] call vf_checkclass; _class - string of search class ("SoldierWSaboteurPipe2" for example) _config -entry (type config) where we find this class (configfile>>"cfgvehicles"....configfile>>"cfgweapons"...e tc) _check - string of parrent class return true if _check have class or false if isn't example _config=configfile>>"CfgVehicles"; _check="all"; _a=["SoldierWSaboteurPipe2",_config, _check] call vf_checkclass; if (_a) then {hint "<all> is a parent of <SoldierWSaboteurPipe2> in <CfgVehicles>"} but you can't use "CfgVehicles" like _check , because cfgvehicles isn't a parent of any class just see config class cfgvehicles { class all { .... }; ... }; all haven't parent....
-
number = random 60 _conditions= [ {number < 14}, {number > 14 AND number < 23}, {number > 23 AND number < 30.5}, {number > 30.5 AND number < 34}, {number > 34 AND number < 41}, {number > 41 AND number < 46}, {number > 46 AND number < 51} ]; _functions= [ {[group01,Spa1,400,100] call spawnbuild} {[group01,Spa2,400,100] call spawnbuild}, {[group01,Spa3,400,100] call spawnbuild}, {[group01,Spa4,200,100] call spawnbuild}, {[group01,Spa5,200,100] call spawnbuild}, {[group01,Spa6,200,100] call spawnbuild}, { [group01,Spa4,200,100] call spawnbuild; [group01,Spa5,200,100] call spawnbuild; [group01,Spa6,200,100] call spawnbuild; } ]; scopename "find"; _i=0; _f=-1; { if (call _x) then {_f=_i; breakto "find"}; _i=_i+1; } foreach _conditions; if (_f>=0) then {call (_functions select _f)};
-
My version was the same but with a sqs and use this SpawnBuild=compile preprocessfile "SpawnBuild.sqf"; [] exec "SpawnP.sqs"; SpawnP.sqs: number = random 60 ?number < 14 : goto "SP1" ?number > 14 AND number < 23 : goto "SP2" ?number > 23 AND number < 30.5 : goto "SP3" ?number > 30.5 AND number < 34 : goto "SP4" ?number > 34 AND number < 41 : goto "SP5" ?number > 41 AND number < 46 : goto "SP6" ?number > 46 AND number < 51 : goto "SP6" ?number > 51 : goto "Exit" ;--------------------------------------------- #SP1 ;Group, Area, ASize, Num Of Enemy [group01,Spa1,400,100] call spawnbuild; exit ;--------------------------------------------- ;--------------------------------------------- #SP2 ;Group, Area, ASize, Num Of Enemy [group01,Spa2,400,100] call spawnbuild; exit ;--------------------------------------------- ;--------------------------------------------- #SP3 ;Group, Area, ASize, Num Of Enemy [group01,Spa3,400,100] call spawnbuild; exit ;--------------------------------------------- ;--------------------------------------------- #SP4 ;Group, Area, ASize, Num Of Enemy [group01,Spa4,200,100] call spawnbuild; exit ;--------------------------------------------- ;--------------------------------------------- #SP5 ;Group, Area, ASize, Num Of Enemy [group01,Spa5,200,100] call spawnbuild; exit ;--------------------------------------------- ;--------------------------------------------- #SP6 ;Group, Area, ASize, Num Of Enemy [group01,Spa6,200,100] call spawnbuild; exit ;--------------------------------------------- ;--------------------------------------------- #SP7 ;Group, Area, ASize, Num Of Enemy [group01,Spa4,200,100] call spawnbuild; [group01,Spa5,200,100] call spawnbuild; [group01,Spa6,200,100] call spawnbuild; exit ;--------------------------------------------- #Exit exit it must work, or "SpawnBuild.sqf" write not correctly or this BuildPos=compile preprocessfile "BuildPos.sqf"; SpawnBuild=compile preprocessfile "SpawnBuild.sqf"; [] execvm "SpawnP.sqf"; SpawnP.sqf : try { number = random 60; if (number < 14) then {throw "SP1"}; if (number > 14 AND number < 23) then {throw "SP2"}; if (number > 23 AND number < 30.5) then {throw "SP3"}; if (number > 30.5 AND number < 34) then {throw "SP4"}; if (number > 34 AND number < 41) then {throw "SP5"}; if (number > 41 AND number < 46) then {throw "SP6"}; if (number > 46 AND number < 51) then {throw "SP6"}; throw "exit"; } catch { switch _exception do { case "SP1" : { //Group, Area, ASize, Num Of Enemy [group01,Spa1,400,100] call spawnbuild; }; case "SP2" : { //Group, Area, ASize, Num Of Enemy [group01,Spa2,400,100] call spawnbuild; }; case "SP3" : { //Group, Area, ASize, Num Of Enemy [group01,Spa3,400,100] call spawnbuild; }; case "SP4 : { //Group, Area, ASize, Num Of Enemy [group01,Spa4,200,100] call spawnbuild; }; case "SP5" : { //Group, Area, ASize, Num Of Enemy [group01,Spa5,200,100] call spawnbuild; }; case "SP6" : { //Group, Area, ASize, Num Of Enemy [group01,Spa6,200,100] call spawnbuild; }; case "SP7" : { //Group, Area, ASize, Num Of Enemy [group01,Spa4,200,100] call spawnbuild; [group01,Spa5,200,100] call spawnbuild; [group01,Spa6,200,100] call spawnbuild; }; case "exit" : {}; }; };
-
how do you exec this script? if it didn't work in sqs then your function "spawnbuild" write not correctly type you function "spawnbuild" and type how you describe this function