Search the Community
Showing results for tags 'Target'.
Found 10 results
-
Need help to find the intented Target of AI
Heavensrevenger posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey I want to make the C-RAM bullets explode if they fly past the target. I know how I'll do the Code but I don't know how to get the object that the C-RAM is currently shooting at. Any help is appreciated! -
Revive player over distance with pistol
MinervaArts posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi guys, I'm currently working on a script that will allow a player to shoot another unconscious player and then revive him immediately. I already have the revive system ready, but I haven't found a way to make it so that only the player who was shot is revived. Do you have an idea how I can make it so that the code is only executed on the player who was hit? I have already tried to rebuild a taser script but didn't really get anywhere. Thanks for your help!- 2 replies
-
- event handler
- scripting
-
(and 2 more)
Tagged with:
-
ai-spawn doFire / fireAtTarget / vehicle Spawn - No Attacks
SirBassi posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi Guys, Background I want a simple script that spawns certain random vehicles from a pool at random intervals and attacks a random player. Here using the example of helicopters, the whole thing will follow later for jets, ground vehicles, etc. Distances and timings are greatly reduced for testing. Choice of Randomplayer is double made because of testings. Observation The script starts as expected, but when the helis reach the AO over Player they don't really attack with main or ship guns. Rarely a short salvo but no real attack. Trials doFire normally lets AI auto-aim, so I've tried without doTarget as well. But same result. If I read the table at the bottom of the BI Wiki, (Link: https://community.bistudio.com/wiki/fireAtTarget) fireAtTarget could be a solution.# What I wanted to avoid was spwawing AI, forming groups, occupying a vehicle and then acting via waypoints. Since I would like to send random vehicles from a larger pool and that would make things very extensive. Script My Question Do you have any tips and recommendations that could help me with my desired scenario goal of dealing with the AI? Am I on the right track or should I solve it completely differently? Thanks for your support. -
Description This dialog is supposed to make the training of firing drills easier. It will show the current target, stats of the last shot and gives the opportunity to evaluate your firing discipline. Features Camera on the target Stats from last shot 3D model and hit position Mini map with position of targets Activate and deactivate selected target MP compatible (tested on dedicated and hosted with 2 players, NOT TESTED WITH JIP) Localized in German and English Picture Usage To add a target to the list add this to the object init: this setVariable ["TER_isTarget", true]; I recommend to only use objects of the type "Pop-Up Target X". Open the dialog with createDialog "TER_target"; Include the following files in your main mission folder (where the mission.sqm is): Add these two lines to your description.ext (or create it): #include "TER_TargetGUI\defines_A3.hpp" #include "TER_TargetGUI\TER_target.hpp" Put this in the initPlayerLocal.sqf (or create it): #include "TER_targetGUI\addEH.sqf" Add the content of the stringtable.xml to your own or copy it as is The TER_TargetGUI folder Download http://www.armaholic.com/page.php?id=33043 (RIP Armaholic) https://drive.google.com/drive/folders/0B8-BL9HKQ_OXWjFnUDhEUGhqejA?usp=sharing (expired) https://drive.google.com/drive/folders/0B8-BL9HKQ_OXWjFnUDhEUGhqejA?resourcekey=0-slVaBtuyLj5IjSDmkcW-2Q&usp=sharing Credits Dialog & scripts: Terra Testing: Aasgeyer Good hunting! Changelog:
-
Tank AI won't use main gun to shoot target
Kelvin Lee posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi guys, I'm very new to Arma 3 (less than 200 hours) and am building a base in Eden editor. I tried making a tank fire at targets but it uses its machine gun rather than the main turret so it just goes pew pew rather than boom boom, pls help 😞 below is the code I used (found it on youtube) I tried changing the "currenetWeapon" to "primaryWeapon" and secondaryWeapon" but it still doesn't work null = this spawn { _this dotarget k2; sleep 0.5; _this addEventHandler ["Reloaded",{ _unit = _this select 0 ; _mag = _this select 4 select 0 ; _unit addMagazine _mag ; }] ; while {alive k2 and alive _this} do { sleep 3; [_this,currentWeapon _this] call BIS_fnc_fire; } ; } ; EDIT: where do you guys learn how to write all these codes? is there a website for this or do you guys study/ already have experience in computer science and coding stuff? -
when i playing in wasteland servers mostly playing in independ team. so they are free from others. so when we use something with radar other independ vehicles are green on radar. they sees them friendly targets but they are not. and R key dont select them i must use T key on them with real vision. i mean manuel targeting. is there a way select friendly targets on radar ? like selecting enemies.
-
Better alternative to "assignedTarget"
lawman_actual posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Looking for some advice on what functions to use. Currently I have attached a "FIRED" event handler to each member of a recon team. Once the trigger fires, it assesses what the unit is shooting at, and if the target belongs to the WEST side, it has 'positively identified' NATO in the area. //player sideChat (format ["%1",_this]); _unit = (_this select 0); _group = group _unit; _leader = leader _group; _target = assignedTarget _unit; player sideChat (format ["Target: %1",_target]); //player sideChat (format ["Side: %1",(side _target)]); //player sideChat (format ["Qrf1: %1",qrf1Sent]); //player sideChat (format ["Qrf2: %1",qrf2Sent]); if ((side _target) == WEST) then { if (reconOnSite) then { if (!qrf1Sent) then {_aaq = execVM "law\dispatchQrf1.sqf";}; if (!qrf2Sent) then {_aar = execVM "law\dispatchQrf2.sqf";}; }; } else { if ((reconOnSite) && (!qrf1Sent)) then {_aad = execVM "law\dispatchQrf1.sqf";}; }; Hence; if the recon team is only firing upon local militia, a small QRF is needed. If the recon team is in contact with NATO forces, a large one. The problem is that assignedTarget appears to rely upon the group leader specifically directing one of the units to fire upon the target. If the unit simply sees an enemy and fires of it's own initiative, the target is returned as 'objectNull' and the script fails. In most cases, this isn't a problem. But the recon team is only small, and if the group leader is killed before this happens it might cause problems. Is there a better way of assessing what the unit is firing at without having a target assigned? -
I'm using the great new Eden editor to put a shoot house together. I want to have moving targets, and I'm using some stuff I found a while back, and it doesn't seem to work on a dedi server. I think this is new, with the new editor and its changes, but I don't know. I'm using this function to do the moving: fn_MovingTargetOnce = { private ["_target","_distance","_speed","_dir"]; if (!isServer) exitWith {};//added to prevent MP unpredictable effects _target = _this select 0; _dir = _this select 1; // direction of travel (and opposite) _distance = _this select 2; // how far to travel in each direction _speed = _this select 3; // speed of movement _pause = _this select 4; // pause at either end sleep _pause; for "_i" from 0 to _distance/_speed do { _target setPos [ (position _target select 0) + ((sin (_dir)))*_speed, (position _target select 1) + ((cos (_dir)))*_speed, 0 ]; sleep 0.01; }; sleep 0.05; }; And then I'm calling it from a script, with something like this: [tar1,((direction tar1) -90),10,0.06,.3] spawn fn_MovingTargetOnce; Works fine in SP, but in the dedicated server, the target waits then jumps to the end position. Not sure what's wrong. Any ideas on how to do this right on a dedi (MP) server, with the current editor?
-
[SCRIPT SNIPPET] Firing Drill/Fire at Target
willithappen posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi all, earlier somebody asked about a "Firing Drill" for AI to shoot at a target/area. I also noticed several other people over time have asked about this and got little response. I've created this simple to use script to allow the above, it could also be used to make ambient shots at a target or for a cinematic if you needed something specific. WHAT YOU NEED - A game logic named "nofireobject" - A named Target to shoot at -WH_Firing_Drill.sqf http://puu.sh/mUJyf/a02e876d1a.txt (Also below in spoiler) HOW TO USE // Place into INIT field of unit you want to use the script with.null = [this,TARGETNAME,timebetweentriggerpull,#OFBULLETSTOSHOOT,waittimeafterallroundsfired]; EXAMPLES:null = [this,TARG1,0.5,6,15] execVM "WH_Firing_drill.sqf";-- Unit fires at TARG1 every 0.5 seconds, unit fires 6 shots and waits 15 seconds to repeat after the 6 shots were fired.null = [this,TARG2,3,2,6] execVM "WH_Firing_drill.sqf";-- Unit fires at TARG2 every 0.3 seconds, unit fires 2 shots and waits 6 seconds to repeat after the 2 shots were fired.null = [this,TARG1,2.5,30,10] execVM "WH_Firing_drill.sqf";-- Unit fires at TARG1 every 2.5 seconds, unit fires 30 shots and waits 10 seconds to repeat after the 30 shots were fired. TO DO:- Allow complete end of script, so unit no longer shoots at targets. - Ability to choose what weapon type to shoot instead of just what is currently held. [iE Missiles or Miniguns in a Pawnee] [Or a mixture?] ISSUES: - After firing loop, AI looks around for other threats- 7 replies
-
- FireAtTarget
- FiringDrill
-
(and 6 more)
Tagged with:
-
Tab lock on - How to set up for a target (C-ram)
alexboy posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Hey guys, I am back at it for sometime in programming the C-ram. I been working hard on this coding, but i need some help with one issue of coding. What I am trying to do is make a config that lets someone Tab- lock on to a target, just like if you had an AA gun - you press TAB and a white box goes around an air craft then it locks on when you are aiming in the direction of the target. also you can do this with machineguns (so that the zeroing is automatic and not manual), I am trying to make a target to be lock on able, so that it does automatic zeroing when aiming at it. right now my C-ram can "auto-zero" into aircraft since it can lock on to it and the zeroing adjusts so that the c-ram bullets hits the target while aiming at it, rather then the bullets ending up missing the target. =============================== EDIT ============================== Right now I can Tab-target aircraft with my c-ram so that it can auto-zero the turret so that the bullets can hit the target at far distances I am trying to be able to do that but with the target i make below Target code: class at_phalanx_target_base: TargetBase { class EventHandlers; }; class at_phalanx_target: at_phalanx_target_base //take out gps { model = "at_phalanx\at_phalanx_target"; displayName = "gun RAM TARGET"; _generalMacro = "at_phalanx_target"; // irTarget = 1; //side = 0; //hasdriver = 1; irLock = true; laserLock = true; nameSound = ""; // threat (VSoft, VArmor, VAir), how threatening vehicle is to unit types threat[] = {0.0, 0.0, 1.0}; //simulation = "artillerymarker"; //simulation = "nvmarker"; laserTarget = true; irTarget = true; nvTarget = 0; //artilleryTarget = true; type = VAir;//added vehicleClass = "Air"; side = TEast; //scope = protected; //laserTarget = 1; armor = 15; scope = 2; cost =10000000; //vehicleClass = "Static"; }; if anyone can help me, i will be very thankful. I been at just this point for a couple of days and i just feel like im missing something simple, and I am looking toward the community for some help Thank you in advance! alexboy