Jump to content

rejenorst

Member
  • Content Count

    427
  • Joined

  • Last visited

  • Medals

Everything posted by rejenorst

  1. :butbut: lol alright. Cheers for the info. After a fair bit of testing I noticed it seems to work well when in closer proximity to the enemy (urban combat) but over longer ranges on hilly areas it doesn't seem to work so well.
  2. The conditions you want to specify then it seems in the trigger is !alive Bob and that bob's distance from bobstrigger (name the trigger bobstrigger) is less than or equal to 40 meters and that the time is no more than lets say 100 seconds (feel free to change distance/time etc. (!alive bob) && (bob distance bobstrigger <= 40) && (time < 100) Alternatively if you want to make it that if he is dead AND (is either within 40 meters of the trigger OR the time is less than 100 seconds) then: (!alive bob) && ((bob distance bobstrigger <= 40) OR (time < 100))
  3. you can try: _vehicle forceSpeed 0; And to change it back to normal via: _vehicle forceSpeed (0 - 1); A quick test in ARMA 3 with a trigger seems to indicate that the boat stops. I didn't do extensive testing though. This will not help if the boat is floating away due to any physics etc. I only recently got a rig that can run this game so I don't know what physics have been coded in with water (ie: currents etc).
  4. Not sure if this is helpful to anyone but thought I'd share it. A very simple function where you input an array and the function removes all non-unique variables and returns the array. Throw this into the init.sqf: rej_fnc_uniquevarlist = compile preProcessFileLineNumbers "rej_fnc_uniquevarlist.sqf"; Create a a file called rej_fnc_uniquevarlist.sqf and throw the following code into it: /////////////////////////////////////////////////////////////////////////////////////////// //-- This case sensitive script will return a list of unique variables within an array --// /////////////////////////////////////////////////////////////////////////////////////////// private["_arrayToCheck","_variableList","_arrayCount","_variable"]; _arrayToCheck = _this select 0; _variableList = []; _arrayCount = (count _arrayToCheck) - 1; if (_arrayCount >= 0) then { //////////////////////////////////// //-- Create a unique array list --// //////////////////////////////////// for "_i" from 0 to _arrayCount do { _variable = _arrayToCheck select _i; if (_variableList find _variable < 0) then { _variableList set [count _variableList,_variable]; }; }; }; _variableList Call the script as follows: _uniqueVars = [_varList] call rej_fnc_uniquevarlist; Where _varList is the array you want cleansed of non-unique variables and _uniqueVars will be the returned list of unique variables. Example: _varList = ["chop","chop","hoe","hoe","lamb","lamb",1,1,5,6,6,[0,0,0],[0,0,0],[1,2,1]]; Returns: ["chop","hoe","lamb",1,5,6,[0,0,0],[1,2,1]] Feel free to change the filenames etc.
  5. The one you listed first is over 0.4ms faster than my optimized one which you posted below it so I think I'll go with that. Is it ok to use your script and put the following in the script?: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //-- This case sensitive script will return a list of unique variables within an array. This script is more optimized than my original and is --// //-- courtesy of Killzone_Kid: http://killzonekid.com/ --// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Oh sweet thanks for pointing these out (saves a lot of time in coding :D ): https://community.bistudio.com/wiki/deleteAt https://community.bistudio.com/wiki/deleteRange https://community.bistudio.com/wiki/reverse I only recently got a PC that can handle ARMA 3 so I am having to acquaint myself with all the new bells and whistles :)
  6. Oh awesome :D Did not see the new ARMA 3 isEqualTo command and that pushback command looks extremely useful as well (no more sets and counting for me). Thanks for this. I will give this a try.
  7. {_x addEventHandler ["FIRED",{shotsFired = shotsFired + 1; if ((shotsFired > 5) && (shotsFired < 7)) then {_null = [] execVM "myscript.sqf"}}]} forEach units (group this); Try that in the group leaders init or any other unit of the group. Only use it once per group though. I've just noticed a problems as well. This script will continue to be launched every time a unit fires after the 5 shots have been fired. I've edited it so that it will only trigger the script on the 6th shot (hopefully). Additionally you will want to remove all FIRE eventhandlers in your launched script. So add this inside your script (the one your launching): {_x removeAllEventHandlers "FIRED"} foreach allUnits;
  8. You can execute a script by replacing 'hint "CONDITION FULLFILLED!"' with the script you want for example: this addEventHandler ["FIRED",{shotsFired = shotsFired + 1; if (shotsFired > 5) then {_null = [] execVM "myscript.sqf"}}];
  9. rejenorst

    Dart Drone Cannot See Opfor

    I don't know if this is helpful at all to what your trying but: Was mucking around with UAVs in ARMA 3 as I plan on making a script that checks for enemies. I noticed the UAVs alone wont see enemies however if you combine a UAV operator AI unit and check his targets rather than the drones it seems to work: private["_drone","_unit","_terminate","_query","_targetunits","_enemyCount","_UAVconnection"]; _drone = _this select 0; _unit = _this select 1; _unit enableUAVConnectability [_drone,true]; sleep 1; _unit connectTerminalToUAV _drone; sleep 1; _terminate = false; while {!_terminate} do { _query = _unit targetsQuery ["","","","",""]; _targetunits = []; {_targetunits set [count _targetunits,_x select 1]; sleep 0.05} foreach _query; _enemyCount = _unit countEnemy _targetunits; _UAVconnection = getConnectedUAV _unit; hintSilent format["UAV CONNECTION: %1 ENEMYCOUNT: %2",(_UAVconnection),(_enemyCount)]; sleep 0.1; if (_enemyCount > 0) then { _terminate = true; hint "ENEMY FOUND!"; }; if (_UAVconnection != _drone) then { _terminate = true; hint "CONNECTION LOST!"; }; }; _unit connectTerminalToUAV objNull; Execute with: _null = [_drone,_droneOperator] execVM "dronetest.sqf" Operator requires a UAV terminal I believe. Note: If you want a UAV to spot infantry it seems to respond best at lower altitudes like 30 meters although it spots enemy vehicles really well. The script will exit when and if the unit accessing the UAV sees any enemies either in person or via the drone or the drone is killed.
  10. Add this to the init.sqf or to any units init: shotsFired = 0; Then add this to any unit: this addEventHandler ["FIRED",{shotsFired = shotsFired + 1; if (shotsFired > 5) then {hint "CONDITION FULLFILLED!"}}]; Or this to the leader of a group's init: {_x addEventHandler ["FIRED",{shotsFired = shotsFired + 1; if (shotsFired > 5) then {hint "CONDITION FULLFILLED!"}}]} foreach units (group this); Change 5 to whatever number of shots would meet the condition and change hint "CONDITION FULLFILLED!" to whatever you want to happen after those shots are fired like a global variable changing from false to true. etc EDIT: Sorry I just saw that you only need to check whether a single shot is fired in which case: this addEventHandler ["FIRED",{shotsFired = true}]; Or {_x addEventHandler ["FIRED",{shotsFired = true}]} foreach units (group this); You may also want to remove the eventhandlers after a shot is fired: this addEventHandler ["FIRED",{(_this select 0) removeAllEventHandlers "FIRED";shotsFired = true}]; or {_x addEventHandler ["FIRED",{(_this select 0) removeAllEventHandlers "FIRED";shotsFired = true}]} forEach units (group this);
  11. I am not sure if this is useful but: I was searching for a quick and easy way of generating positions in an arc that could be used for flanking waypoints. I came across this forum post which showed a formula for brezier curves taken from wikipedia: http://www.coderanch.com/t/480970/Game-Development/java/plot-curve-points http://en.wikipedia.org/wiki/B%C3%A9zier_curve I decided to use that code and alter it to ARMA script while making some adjustments to allow for the user to sample only a few points along the curve with the end point being the _end point. Add this to init.sqf or rename the function as you see fit: rej_fnc_bezier = compile preProcessFileLineNumbers "rej_fnc_bezier.sqf"; Create a rej_fnc_bezier.sqf or a renamed version as you see fit and add it to the mission folder then add the following code: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //-- This script is a Bezier Curve function and will return a specified number of points along the Bezier Curve --// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private["_vector1","_vector2","_controlVector","_numberOfPoints","_removeStartPos","_x","_y","_increments","_positions"]; _vector1 = _this select 0; _vector2 = _this select 1; _controlVector = _this select 2; _numberOfPoints = _this select 3; _removeStartPos = _this select 4; ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //-- Double distance for the control vector to make the peak of the curve pass through the controlVector --// ///////////////////////////////////////////////////////////////////////////////////////////////////////////// _midPoint_1 = ((_vector1 select 0) + (_vector2 select 0)) / 2; _midPoint_2 = ((_vector1 select 1) + (_vector2 select 1)) / 2; _midPoint = [_midPoint_1,_midPoint_2,0]; _midPoint_1 = ((_vector1 select 0) + (_vector2 select 0)) / 2; _midPoint_2 = ((_midPoint select 1) + (_midPoint select 1)) / 2; _midPoint = [_midPoint_1,_midPoint_2,0]; _vectorDiff = _controlVector vectorDiff _midPoint; _controlVector = _controlVector vectorAdd _vectorDiff; ///////////////////////// //-- Calculate curve --// ///////////////////////// if (_numberOfPoints >= 1) then { _increments = 1 / _numberOfPoints; _positions = []; for [{_i = 0.0},{_i <= 1},{_i =_i + _increments}] do { _x = ((1 - _i) * (1 - _i) * (_vector1 select 0) + 2 * (1 - _i) * _i * (_controlVector select 0) + _i * _i * (_vector2 select 0)); _y =((1 - _i) * (1 - _i) * (_vector1 select 1) + 2 * (1 - _i) * _i * (_controlVector select 1) + _i * _i * (_vector2 select 1)); _positions pushback [_x,_y,0]; _markname = format["%1 %2%3",("testmarker"),(ceil random 999),(ceil random 999),(ceil random 999)]; //-- For demo purpose only. Please remove. _marker = createMarker [_markname,[_x,_y,0]]; //-- For demo purpose only. Please remove. _markname setMarkerType "hd_dot"; //-- For demo purpose only. Please remove. _markname setMarkerColor "ColorBlack"; //-- For demo purpose only. Please remove. }; if (_removeStartPos) then { _positions deleteAt 0; }; } else { _positions = _vector2; }; _positions Call the function as follows: _curvePositionsArray = [startPos,endPos,controlPos,4,true] call rej_fnc_bezier; hint format["POSITIONS RETURNED: %1",(curvePositionsArray)]; -Where _startPos is the starting position, -Where _endPos is the destination position, -Where _controlPos is the position where the curve should flex towards. I've coded it so that the peak or the curve near the peak should pass through the controlPos. This is the direction where the curve tip will point towards and hopefully pass through. -Where 4 can be any number of points you want returned in the array *, -Where true is whether or not you want the starting point returned in the array (it will always be included in the array regardless of whether you asked for 1 position or more to be returned so use this to delete the starting Position from the array. * Make sure you use whole numbers. Using anything less that 1 will return the end position and using any non whole numbers like 1.9 will probably not return the end destination. I tested 1.9 and it landed me somewhere in the middle of the curve. Note: I added a quick marker generation for the points so you can get a visual representation of the points being generated. Feel free to remove. I only spent a short time testing this script out so let me know if there are any weird problems .
  12. rejenorst

    Bezier Curve function.

    No worries :D Glad the script is of use to someone other than me :) Thank you for testing and giving feedback. EDIT: have updated the code to take advantage of array pushback and deleteAt commands which are likely more optimized.
  13. rejenorst

    Bezier Curve function.

    I've updated the code to have the curve pass through the control point. It was a lot less difficult then I at first thought. I thought I might have to use a logic and the modeltoworld and dir function but I figured since its an obtuse triangle I could just get the midpoint of the line between vector1 and vector2 and then the midpoint between that midpoint and vector1 to get a difference in x & z coords between that midpoint and vector1. Then add that to the controlpoint to effectively double the distance. For the most part the peak will usually pass through the controlpoint unless you place the control point behind vector1 or vector2 in which case the peak may or may not be a little off but the curve will or should still pass through the control point. *Note I've renamed the function.sqf etc as I renamed my function to a bezier curve rather than a parabola which was my initial aim until I found bezier. Also what did you have in mind with your radar simulation? Do you mean a GUI radar or a script that moves a line around the map in a circle and checks if any objects like planes etc pass through it which then updates it to the map? The latter wouldn't require any parabola. One could just use a loop script which uses a logic and spins it around slowly while checking lineintersects or whether the object is in the angle of view of the logic (not 100% sure if that would work but yeah). For the GUI simulating a radar screen it would require a sine curve I think for the old fashioned ww2 radar screens or a rotating line animation over a small black circle (which would be easier).
  14. I am just wondering if there is a way to check where an object or position is off the map or if there is a way of checking the max map X height and Y width? I am currently working on a sort of AI command script and this info would be useful to know so that I can use the script on multiple maps etc. Thanks.
  15. Thanks Ryd, I will try your suggestion getting it via the map is a novel idea. Cheers.
  16. I am just wondering is there a way to check if a particular number in the group is taken? ie; Positionid which is given to each unit and can be assigned with the joinas command so long as the id number isn't taken. Would be really useful for the joinas command. Thanks.
  17. Can't say I have man D: I've looked on and off on numerous occasions but never really found anything. The best you can do is use the joinassilent command so that they unjoin and rejoin silently without radio coms getting flooded. private ["_c","_u","_g"]; _u = myunit; _g = groupwewanttojoin; _c = 1; while {! (_u in (units _g))} do { _u joinAssilent [_g, _c]; _c = _c + 1; };
  18. Is there a way I can check if a unit has reloaded? In particular the M119 Howitzer or D30 and mortars? Thanks.
  19. Cheers man will give this a try. At the very least I will see if the magazine count is a good indicator as to whether my Grad or Arty has reloaded.
  20. Not sure if this helps but make sure there's at least 1 enemy on the map (make the probability of him spawning 0) this will create a center for the enemy AI. Without the center the enemy won't spawn. Alternatively you can just create a center using the createcenter command. ie: enemycenter = createcenter EAST; (place that in the init of the player or any object on the map.
  21. Ah cheers man. I suppose I kind of wanted to get a reading on the numbers so as to decide where in the formation the unit should go. Basically I wanted to make the player the last unit in formation. Problem is that when units die the others keep their numbers etc. Still I will probably make use of that. Thanks.
  22. JETSET Have uploaded a very short mission called Jetset. I only made it to test out some scripts and to muck around flying a bit but I slapped some voices on her and have uploaded it for anyone who wants a quick flight. The targets which need to be bombed are randomly selected throughout Takistan and will range between 2-3. Random AA defenses and vehicles will be spawned around the location as well as a small random number of interceptors at the enemy airport. You can choose any western aircraft (mission will check if you have the relevant config). Note that the SU25 has no laser so friendly AI pilots will not see the laser targets unless your flying U.S. jets. You can also choose the time of day and how many AI pilots you want to escort you. Again I stress, very very basic mission. Enjoy. www.rejenorst.com/projects/[sP]jetset.Takistan.rar Armaholic mirror: - Jetset MARTYRDOM 2 http://www.rejenorst.com/projects/mission5.jpg (118 kB) This is a port of my Martyrdom mission to the Fallujah map Version 1.2 by -[TdC]-Shezan.it its designed for random urban operations where enemy units are spawned randomly into buildings located within sectors, where units have random skill and weapon kits and move randomly between buildings. There is also random civilians and random civilian traffic, player weapon selection and mission setting options at the start of the mission such as the number of enemies, friendly squads, fog, time of day and some limited side missions. The main objective is to clear out a randomly chosen sector in the combat zone which is randomly placed around the map where there are buildings. Mission notes: -At the beginning of this mission you will be able to set the number of enemy AI. Enemies at the objective will start and will only move between buildings in the vicinity of the objective, while insurgents will move around the city's sectors at will. -There is now an option to have 2 additional friendly squads join you. The first squad which is on by default will also have a bradley or HUMVEE following it while you will be prompted if you want the 2nd squad which will call in an Apache when calling in reinforcements. -If you plan on having 2 allied squads be aware that the will result in around 20 - 40 additional AI on the map. I tend to play with both squads on and about 80 insurgents and 20-30 enemy units at the objective. Default is 20 enemies for each. Features: Special thanks to Zonekiller for flame script code and Mike Johnston "Clutchy" for beta testing & voice acting. -Enemy building patrols (Enemy will patrol inside buildings and displace to other buildings every now and then. -Friendly Airstrikes. -Ability to set enemy unit numbers. -Randomly selected Weapon kits for both enemies and friendlies. -Random unit starting positions. -Randomly selected sectors as objective. -Insurgents are spread all around the city while Takistani soldiers are concentrated in and around the objective sector(s) (If you want more dispersed fighting up the amount of insurgents, if you want more units guarding the objective then raise the amount of units guarding the objective at the start of mission). -Battle yells. -Ambient sounds (limited but there). -Ability to play the mission at Dawn/Morning/Noon or Night. -Ability to setfog. NEW TO MARTYRDOM 2: -Ability to bandage self when receiving damage over 0.25 -Weapon selection at start of mission -Enemies are now randomly equipped with flares and will fire them at night. -Enemy short range mortars -Sidemissions (optional) -heli reinforcements -Up to 2 additional friendly squads -Bradley fighting vehicles & HUMVEE instead of M1A1 -Apache CAS -Civilian traffic -The hotzone around which the sectors are allocated is now randomly placed around the map. Meaning a change of scenery each time the map is played. -Bunch of other smaller scripting issues I can't remember. Will list as I remember them. -All friendly squad including yourself are transported on site by Blackhawk. CREDITS: Mission: Rejenorst Voice Acting & beta testing: Mike Johnston and Rejenorst Music: Rejenorst Script help: Zonekiller Again special thanks to Mike Johnston whose beta matrix spreadsheet was highly appreciated. VIDEO PREVIEW: dVDBx8RoXm4 ------------------------------------------------------------------------------- MARTYRDOM http://www.rejenorst.com/projects/mimage.jpg (172 kB) I've wanted to make an urban combat mission for a while. These are a pain in the ass to make and there are plenty of better coders out there who could make much better missions like this than me but here is my attempt. Please note that this mission requires both ARMA2 and ARMA2:OA Performance may be an issue for plenty of people out there who already have FPS problems running Zargabad. Mission notes: -The tank script is highly experimental and more for cosmetics when its not actually being useful. -Please post your RPT log for the session if you experienced any problems, also please let me know what addons you are using (I generally don't support addons but some players have found addons to work ok in my missions, this one is more complex so I don't know if addons will work, test at your own leisure. -There are approximately a maximum of 50-60 enemy AI in the city at any time, I have created a dialogue control that kicks in at the start of the mission to allow you to set the number of enemies. The attack squad numbers are not included in that dialogue, there's around 10 infantry attack units that will attack from each objective as it is called. if requested I'll add an option to edit their number as well. If you have a weak PC you can lower the unit numbers but the dialogue will not allow less than 10 Takistani soldiers at the objective areas. ------------------------------------------------------------------------------------------------- DER EINSATZ http://www.rejenorst.com/projects/de.jpg (112 kB) Not a great mission or anything but just a play around with some ideas I had in my head. This is also the first time I have made a hostage rescue mission. The situation is that a member of the KSK has been taken hostage by insurgents. This presents a political PR nightmare. In addition U.S. forces are scheduled to attack the area within the next 24 hours meaning that the hostage could be moved or executed. Your part of a KSK team that is tasked with rescuing and extracting the hostage. Mission voice acting in German, subtitles/text in English. Spelling is in English as ARMA2 English versions are not umlaut compatible is seems. Please note that this mission requires both ARMA2 and ARMA2:OA This only shows if showscript errors is on. The bug does not interfere with gameplay/mission and is harmless. Its related to the HALO script and there's not much I can do about it when it does pop up. It will pop up when you press certain keys. 2) LOD's in the plane may be buggy on ocassion. This was not a problem in the previous patch and has now reappeared for me in 1.10. Have adjusted scripts to compensate as much as possible. ADDITIONAL THANKS: -Hengist -Wellenbrecher -Rule zum Rabensang -Ritter Dummbatz -lorsi ------------------------------------------------------------------------------------------------- HELLFIRE http://www.rejenorst.com/projects/hellf.jpg (183 kB) Last night, Bravo Company of the 115th Mechanized Infantry Battalion (Task Force Bayonet), managed to setup a forward operating base in an abandoned military compound north of Zargabad. Viper55, which is attached to the same brigade, has landed there for emergency refueling. The enemy garrison in Zargabad is unable to launch any significant counter attacks, since most of the enemy's 201st infantry division is thinly stretched across the south to protect major supply lines running between Zargabad and Takistan. Air reconnaissance suggests that more than half of the enemy's 201st Infantry Division has been pulled back into Takistan to join the ongoing fighting there. Intel on the ground suggests that the enemy has a major lack of anti-air defense systems. However, recent information from a high level informant has revealed that the Zargabad garrison has just received additional weapon and munitions shipments. The informant will be sending us specific locations as to where these weapons are being stored. Given this state of events; Lt. Colonel Briggs has ordered the 115th to establish a foothold in Zargabad as quickly as possible.
  23. rejenorst

    Rejenorst's Missions [SP/MP/COOP]

    Hi Teoleo! Yes there is a problem with Martyrdom2 mission objectives. :( I need to investigate it but haven't had time as of late. Thanks for the heads up :)
×