Jump to content

vova _fox

Member
  • Content Count

    39
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About vova _fox

  • Rank
    Private First Class
  1. vova _fox

    Finding trees

    ahahahaha list=nearestObjects [position player,[], 100]
  2. 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?
  3. vova _fox

    moveTo/doMove doesnt work 100%

    _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"
  4. 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
  5. vova _fox

    If then statements eval all??

    Now i'am often use "double if".....: if ( if (isclass _entry) then {!(configname _entry) in _crash} else {false} ) then {_array=_array+(getclass _entry)}; ...etc
  6. array call func func= { try { _this call func2; } catch { hint _exception; }; }; func2= { { if (errorcondition) then {throw "error ....."}; } foreach _this; };
  7. vova _fox

    Short viewdistance for ai?

    Try use that unit setskill ["spotDistance", 0.01]
  8. 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
  9. vova _fox

    AI eventhandler problem

    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;
  10. vova _fox

    a simple looped SQF script

    use waituntil
  11. vova _fox

    AI eventhandler problem

    <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""}];"
  12. vova _fox

    Converting Strings

    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
  13. vova _fox

    nearestobject id and all?1

    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
  14. 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?
×