Jump to content

Andy455

Member
  • Content Count

    196
  • Joined

  • Last visited

  • Medals

Community Reputation

11 Good

1 Follower

About Andy455

  • Rank
    Sergeant
  1. I'm fairly sure I had the same problem when using stringtable.xml, if I remember correctly using stringtable.csv fixed it for me (however annoying it was to convert a huge stringtable :/ ).
  2. Here is an example from one of my dialogs: class TOUR_DMC_MENU_CREATEUNIT { idd = 897898; movingEnable = true; onLoad = "TOUR_DMC_createUnitMenuActive = true; [] spawn TOUR_DMC_fnc_createUnitOnLoad;"; onUnload = "TOUR_DMC_createUnitMenuActive = false; [] spawn TOUR_DMC_fnc_createUnitCancel"; class controlsBackground { class TOUR_DMC_CREATEUNIT_BACKGROUND : RscBackground { idc = 0; colorBackground[] = TOUR_DMC_COLOR_BACKGROUND; x = "safeZoneX + (safeZoneW / 5)"; y = "safeZoneY + (safeZoneH / 7)"; w = "safeZoneW / 2"; h = "safeZoneH / 1.5"; moving = true; }; }; class objects { }; class controls { class TOUR_DMC_CREATEUNIT_SIDECOMBO : RscCombo { idc = 1; x = "safeZoneX + (safeZoneW / 4.5)"; y = "safeZoneY + (safeZoneH / 4.5)"; w = "safeZoneW / 5"; h = "safeZoneH / 40"; sizeEx = 0.025; size = 0.025; onLBSelChanged = "[] call TOUR_DMC_fnc_fillFactionCombo"; }; }; }; As you can see the controls are created inside of the display (the first class bit), this also means the controls can be moved around by clicking and dragging the background with them. As for the problem with the button, have you got an RscButton class defined in your description.ext? This is because it isnt loaded as a resource by default, you have to manually create it in a mission and load it before you can inherit from that class. Hope that helped at least a little bit, even if it was just example code :P
  3. If you need any other testers I am up for it :)
  4. Try respawn = 4 instead, should allow JIP and when they die they become a crow
  5. I made a similar thread a while back: http://forums.bistudio.com/showthread.php?t=92266&highlight=deactivate+mine Note the posts from VictorFarbau about creating the checksums from the vectorUp of the mine itself. Hope it helps :-)
  6. _aliveCount = {alive _x} count (units goup) // Will return the alive units in specified group
  7. I think he is trying to find which element it is in the array rather than the actual world position. In this case you can use the find command: _number = array find var2; // Will return 1 (-1 if not found)
  8. Write the code to setPos or setVectorUp in the variable: this setvariable ["VehicleInit","<YOUR INITSTRING>;"] That should grab it properly I think. Now if that isnt the problem or I have misunderstood you then I don't really know what else could be causing it :( Andy
  9. The group names / types are in the Ca.pbo config, under CfgGroups. I am not sure about finding out group names from inside the editor, I don't think its possible though (not sure though so someone else might be able to help more).
  10. Andy455

    Civilian Module On / OFF

    You could maybe set its condition of presence to something like: (paramsArray select [color="Red"]0[/color] == 1) And in the description.ext you could have // Other params up here class AmbCivil { title = "Ambient Civilains"; values[] = {1,0}; texts[] = {"On","Off"}; default = 1; }; Just remember to change the condition of presence to point to the correct element in the params array (WILL ONLY WORK IN MP)
  11. Ok I updated by original post, let me know if that works. Also I advise using the startup param -showScriptErrors as it will put any syntax or misuse of command errors on screen so it makes it much easier ;) an alternative would be to have a look in your RPT file.
  12. _helo = "MH60S"; //Create the Helo _grp = createGroup WEST; _helo createUnit [getMarkerPos "heloStart", _grp, "this engineOn true; this flyInHeight 30; helo1 = this", 1]; //Give the helo waypoints _waypoint1 = (group helo1) addWaypoint [getMarkerPos "LZ1", 0]; _waypoint1 setWaypointType "MOVE"; helo1 land "GET IN"; // Waituntil all alive units in players group are in the chopper waitUntil { {_x in helo1 && alive _x} count units group player >= {alive _x} count units group player }; deleteWaypoint [(group helo1),1]; _waypoint2 = (group helo1) addWaypoint [getMarkerPos "wp2", 0]; _waypoint2 setWaypointType "MOVE"; _waypoint3 = (group helo1) addWaypoint [getMarkerPos "wp3", 0]; _waypoint3 setWaypointType "MOVE"; _waypoint4 = (group helo1) addWaypoint [getMarkerPos "wp4", 0]; _waypoint4 setWaypointType "HOLD"; helo1 land "GET OUT"; deleteWaypoint [(group helo1),4]; // Waituntil all alive units in players group are out of the chopper waitUntil { {_x in helo1 && alive _x} count units group player < 1 }; _waypoint5 = (group helo1) addwaypoint [getMarkerPos "wp5", 0]; _waypoint5 setWaypointType "MOVE"; Ok, that should fix at least some of your problems. If I have missed something obvious let me know :)
  13. The obvious answer would be to either put a password on or just lock it if you are logged in as admin. Other than that you could use an onPlayerConnected command to check if UID is that of the player you want else kick.
  14. Glad I helped Landdon ;) I'll see if I can make an example mission later.
  15. Its not execMovingtarget which actually moves the target ;) The function you are looking for is found in: CA\missions_e\bootcamp\BootCamp_Shared\functions\functions_animations.sqf Here is the one you want: BIS_animateMoveSmooth = { private["_sleep","_object","_posStart","_posEnd","_deltax","_deltay","_deltaz","_distance","_tmax","_a","_vmax","_t","_ssaved","_animList","_animPhase","_progress","_posx","_posy","_posz","_anim","_taccel","_saccel","_sconst","_tconst"]; private["_wps","_positions","_distancesStart","_distancesPrev","_refWP","_ghostBall","_time","_hoverHeight","_dir"]; _sleep = 0.01; //delay between each anim frame, lower values = smoother animation _object = _this select 0; _wps = _this select 1; //array of all animation WPs //hover height if (count _this > 4) then { _hoverHeight = _this select 4; }; //---------------------------------------------------------------------------------------------- //positioning & animating along waypoints ------------------------------------------------------ _positions = []; //array of all WP positions _distancesStart = []; //array of WPs distances from the beginning of the animation _distancesPrev = []; //array of WPs distances from the previous WP _refWP = _wps select 0; private["_d","_dTotal","_tmpPos"]; _d = 0; _dTotal = 0; { //storing position of each WP //it's WP object if (typeName(_x) == "OBJECT") then { _tmpPos = getPosASL _x; if (_x == player) then { _tmpPos = [_tmpPos select 0, _tmpPos select 1, (_tmpPos select 2) + 0.8]; }; //it's position } else { _tmpPos = _x; }; _positions = _positions + [_tmpPos]; //total from the start _d = _x distance _refWP; _dTotal = _dTotal + _d; _distancesStart = _distancesStart + [_dTotal]; //from previous WP _distancesPrev = _distancesPrev + [_x distance _refWP]; _refWP = _x; } forEach _wps; //current WPs _wpStart = 0; _wpEnd = _wpStart + 1; //count positions _posStart = _positions select _wpStart; _posEnd = _positions select _wpEnd; //count delta x,y,z _deltax = (_posEnd select 0) - (_posStart select 0); _deltay = (_posEnd select 1) - (_posStart select 1); _deltaz = (_posEnd select 2) - (_posStart select 2); _dir = [_posStart,_posEnd] call BIS_fnc_dirTo; _object setDir (_dir-180); //display object at start position if isNil("_hoverHeight") then { _object setPosASL (_positions select 0); } else { _object setPos [(_positions select 0) select 0, (_positions select 0) select 1,_hoverHeight]; }; //---------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------- //_vmax if (count(_this) > 2) then { _vmax = _this select 2; } else { _vmax = 15; }; //_a if (count(_this) > 3) then { _a = _this select 3; } else { _a = 5; }; //acceleration path _taccel = _vmax/_a; _saccel = 1/2 * _a * _taccel * _taccel; //distance (of whole animation) _distance = _distancesStart select (count(_distancesStart) - 1); //["_distance",_distance] call BIS_debugLog; //distance too short if (2*_saccel > _distance) then { //["DISTANCE IS TOO SHORT"] call BIS_debugLog; //["_saccel (raw)",_saccel] call BIS_debugLog; //["_taccel (raw)",_taccel] call BIS_debugLog; _saccel = _distance/2; _taccel = sqrt(_distance/_a); //["_saccel (fixed)",_saccel] call BIS_debugLog; //["_taccel (fixed)",_taccel] call BIS_debugLog; //distance is too short -> object wont reach max speed _vmax = _a * _taccel; //there is no constant speed part in middle _sconst = 0; _tconst = 0; //distance is fine } else { //["DISTANCE IS FINE"] call BIS_debugLog; _sconst = _distance - 2*_saccel; _tconst = _sconst/_vmax; }; //total time _ttotal = 2*_taccel + _tconst; _t = 0; _tmax = _taccel; _ssaved = 0; _animList = []; _animPhase = 0; _animList = _animList + [{1/2 * _a * _t * _t}]; _animList = _animList + [{_vmax * _t}]; _animList = _animList + [{_vmax * _t - 1/2 * _a * _t * _t}]; _time = time; private["_sleepTime","_tover"]; _tover = 0; while {_animPhase < count(_animList)} do { _t = _t + _sleep; _sleepTime = time; sleep _sleep; //real sleep time calculations _sleepTime = time - _sleepTime; _t = _t - _sleep + _sleepTime; if (_t > _tmax) then { _tover = _t - _tmax; _t = _tmax; }; _anim = _animList select _animPhase; _s = call _anim; //------------------------------------------------------------------------------------------ //positioning & animating along waypoints -------------------------------------------------- _movedFromStart = _ssaved + _s; //searching for acctual _wpStart & _wpEnd while {_movedFromStart > _distancesStart select _wpEnd} do { _wpStart = _wpStart + 1; _wpEnd = _wpStart + 1; //["Current waypoints:",format["%1 -> %2",_wpStart,_wpEnd]] call BIS_debugLog; //count positions _posStart = _positions select _wpStart; _posEnd = _positions select _wpEnd; //count delta x,y,z _deltax = (_posEnd select 0) - (_posStart select 0); _deltay = (_posEnd select 1) - (_posStart select 1); _deltaz = (_posEnd select 2) - (_posStart select 2); //set direction _dir = [_posStart,_posEnd] call BIS_fnc_dirTo; _object setDir (_dir-180); }; //progress part -> object positioning _movedBetweenWPs = _movedFromStart - (_distancesStart select _wpStart); _progress = _movedBetweenWPs / (_distancesPrev select _wpEnd); if (_progress > 1) then { _progress = 1; }; _posx = (_posStart select 0) + _deltax * _progress; _posy = (_posStart select 1) + _deltay * _progress; _posz = (_posStart select 2) + _deltaz * _progress; if isNil("_hoverHeight") then { _object setPosASL[_posx,_posy,_posz]; } else { _object setPos[_posx,_posy,_hoverHeight]; }; //["_movedFromStart",_movedFromStart] call BIS_debugLog; //["_movedBetweenWPs",_movedBetweenWPs] call BIS_debugLog; //["_progress",_progress] call BIS_debugLog; //["_posx",_posx] call BIS_debugLog; //create a ghost-ball /* _ghostBall = "sign_sphere25cm_ep1" createVehicle [0,0,0]; _ghostBall setObjectTexture [0,"#(argb,8,8,3)color(0.8,0.5,0.5,0.5,ca)"]; _ghostBall setPosASL[_posx,_posy,_posz]; */ //------------------------------------------------------------------------------------------ if (_t == _tmax) then { _animPhase = _animPhase + 1; //[format["Animation ID%1 finished at distance %2 (took %3 secs)!",_animPhase-1,_ssaved + _s,_tmax]] call BIS_debugLog; //skip the middle part (animationPhase 1) if its time == 0 if (_animPhase == 1 && _tconst == 0) then { _animPhase = _animPhase + 1; //["Animation ID1 skipped!"] call BIS_debugLog; }; if (_animPhase == 1) then { _tmax = _tconst; } else { _tmax = _taccel; }; //_t = 0; _t = _tover; _ssaved = _ssaved + _s; }; }; private["_pos"]; _pos = _positions select (count(_positions) - 1); if isNil("_hoverHeight") then { _object setPosASL _pos; } else { _object setPos [_pos select 0, _pos select 1, _hoverHeight]; }; }; Now simply feed that with the target object and an array of waypoints (objects/positions), for example: [target1, [wp1, wp2]] spawn BIS_animateMoveSmooth Play around with the script to suit your needs (I personally call the function again at the end to loop it). Hope I helped ;) Andy455
×