Andy455
Member-
Content Count
196 -
Joined
-
Last visited
-
Medals
Everything posted by Andy455
-
Link to Marker in Notes no more supported?
Andy455 replied to memphisbelle's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 :/ ). -
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
-
need someone to help test new stuff , missions / mods
Andy455 replied to zonekiller's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you need any other testers I am up for it :) -
Just found a major flaw concerning disable AI = true
Andy455 replied to a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try respawn = 4 instead, should allow JIP and when they die they become a crow -
How to check if mines are deactivated?
Andy455 replied to Coffeecat's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 :-) -
Return number of units left in a group
Andy455 replied to Nemorz's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
_aliveCount = {alive _x} count (units goup) // Will return the alive units in specified group -
How i know the position of a variable in one array?
Andy455 replied to inpace's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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) -
How can I get the state of a mine created by placing one in the editor or using createMine?? For example in a mission I'm trying to make I would like there to be an objective to deactivate a preplaced mine (therefore I can't take it), I cannot find a way to detect once it has been deactivated. I have tried to use !alive Mine1 but that does'nt work, Help please :(
-
dyno grabber in 3d editor - desperate to save this
Andy455 replied to igneous01's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 -
Where are groups usually defined?
Andy455 replied to hamm's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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). -
Civilian Module On / OFF
Andy455 replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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) -
NEW TO SCRIPTING: Can someone troubleshoot this for me?
Andy455 replied to evans d [16aa]'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
NEW TO SCRIPTING: Can someone troubleshoot this for me?
Andy455 replied to evans d [16aa]'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
_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 :) -
locking mission on test server for all exept creator name only
Andy455 replied to demonized's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
How to Make Targets Scroll Side to Side.
Andy455 replied to evans d [16aa]'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Glad I helped Landdon ;) I'll see if I can make an example mission later. -
How to Make Targets Scroll Side to Side.
Andy455 replied to evans d [16aa]'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 -
Pop Up targets Stay up?
Andy455 replied to spec_ops_sniper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
To make the popup targets go down: TARGET animate ["terc", 1]; and back up: TARGET animate ["terc", 0]; To disable auto popup of targets simply put this into your init.sqf or init field of a unit: nopop = true; With that you can easily use forEach/for loops with an array of target names to lay all targets flat and then pop random ones up each time. EDIT: feck didnt see that :( -
Trigger only activated by wheeled/tracked vehicle?
Andy455 replied to FelixK44's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Another way (more specific) would be: Condition {_x isKindOf "Tank" OR _x isKindOf "Car"} count thisList > 0 That should only fire for tracked/wheeled vehicles, if you find a vehicle that doesn't work with that then please post it for future reference ;) -
Display Text to ALL in MP
Andy455 replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Place the functions module on the map. Then add this to whatever you want: [nil, nil, rTITLETEXT, "TEXT TO SHOW", "PLAIN", 0] call RE; There you go, that will make text appear for everyone. For more info on the MP framework go here. -
Spawning a vehicle behind a C-130
Andy455 replied to NGagedFX's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Do you just spawn it right behind or do you spawn it then use setPos to make it go behind the C-130? I have found you need a lot of clear space (more than you would think necassary) when you want to spawn a vehicle or object to a location, so I overcame this problem by using setPos to make it go where I wanted after I spawned it. -
Call random script from description.ext
Andy455 replied to katipo66's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
description.ext class but4 : but1 { text = "Missions"; action = "call fnc_selectRandomMission"; y = 0.52; }; init.sqf fnc_selectRandomMission = { private ["_rNum"]; _rNum = floor (random 2); switch (_rNum) do { case 0: { execVM "missions\01mission.sqf"; closeDialog 0; }; case 1: { execVM "missions\01mission2.sqf"; closeDialog 0; }; }; }; }; Ok if you just put both of those in, it should work. I haven't tested it though :) might have missed something out. -
Limit Driver of Vehicle to Specific Unit Name
Andy455 replied to doomanchu's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
An alternative would be to use an event handler, for example: this addEventHandler ["GetIn", { if ((_this select 1 == "driver") && (_this select 2 != pilot1)) then { (_this select 2) action ["EJECT", _this select 0] }; }] That would check if the driver is pilot1 else eject him, also it would only run when someone gets in so you dont have to keep track of lots of spawned code. -
deerstand issues
Andy455 replied to Morten87's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Instead of creating a waypoint for him to climb up why not simply have him spawn up there? You could do this by putting this into the insurgent's init field: this setPosATL [(getPosATL this select 0), (getPosATL this select 1), [color="Red"]4[/color]] To adjust height simply change the last element in that array (coloured red) up or down to suit your needs. As a final note remember to put the insurgent on top of the deer stand in the editor else he will spawn up in the air then fall down ;) -
Set helicopter damage
Andy455 replied to svarun's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Use search next time, I searched "helicopter tail", and got 7 results points to your exact problem. Answer: CHOPPERNAME setHit ["mala vrtule", 1]; Most of the time what you ask for has already been done, so do us all a favour and search :P EDIT: damn you ky -
myEnd = [[color="Red"]n[/color]] execVM "f\server\f_mpEndBroadcast.sqf"; If that is exactly how you have it then that could be the problem, I'm not sure what paramaters that script takes but I'm guessing its a number (3 for "END3" when using endmission command). Other than that there isnt much we can do to help unless we can see that script you call.