Jump to content

Heavensrevenger

Member
  • Content Count

    40
  • Joined

  • Last visited

  • Medals

Everything posted by Heavensrevenger

  1. Heavensrevenger

    Need help to find the intented Target of AI

    Ah nice, thank you that should do. I assume the praetorians aim will always be close to 1 for the intended target.
  2. Heavensrevenger

    Run loop in init field with suspension

    so this isnt exactly the same as the script I made the topic for but still very similar so I figured Id just ask: when changing _myObject inside the called script is there a way to pass the variable back to the original script? for instance with this code private _maxradius = 1000; private _increaseradius = 10; private _radius = 0; nul = [_maxradius, _increaseradius, _radius] spawn { params ["_maxradius", "_increaseradius", "_radius"]; _increaseradius = _maxradius / _increaseradius / 10; while { _radius < _maxradius } do { _radius = _radius + _increaseradius; sleep 0.1; }; }; nul = [_maxradius, _increaseradius, _radius] spawn { params ["_maxradius", "_increaseradius", "_radius"]; sleep 4; hint str _radius; }; how can I, in a seperately spawned script, find out the _radius after 4 seconds?
  3. Heavensrevenger

    How does setVectorDirAndUp work?

    ok that signature is genuinely funny but thank you I didnt even realize I was getting an uneven distribution so that should definitely help
  4. I don't understand how the rotation works. Specifically I made Airburst Mortar rounds and want to increase the kill zone by rotating the claymores: this addEventHandler ["Fired", { params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; nul = [_drone,_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle] spawn { params ["_drone","_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; waitUntil { sleep 1; getPos _projectile select 2 > 50 }; while { alive _projectile } do { waitUntil { getPos _projectile select 2 < 30 }; for "_i" from 0 to 3 do { _tungsten_fragments = createVehicle ["ClaymoreDirectionalMine_Remote_Ammo", [0,0,1000], [], 0]; _tungsten_fragments attachTo [_projectile,[0,0,0]]; _random =round (random 10) / 10; _tungsten_fragments setVectorDirAndUp [[0,0,_random], [0,0,_random]]; _tungsten_fragments setDamage 1; }; deleteVehicle _projectile; sleep 1; }; }; }]; I don't understand which numbers in the setVectorDirAndUp Array I need to change to rotate the claymores and what each number even does .
  5. Heavensrevenger

    How does setVectorDirAndUp work?

    _random should be a number between 0 and 1 if im not mistaken
  6. Heavensrevenger

    Cannot Lock/Target spawned in Vehicles

    Alright, for anyone interested, this is the code for the missiles (i managed to turn off the lights, the mk41 will be nato) this addEventHandler ["Fired", { params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; _drone = createVehicle ["B_UAV_02_F", [0,0,1000], [], 0, "FLY"]; _drone disableCollisionWith _unit; _drone attachTo [_projectile,[0,0,0]]; _drone setObjectTextureGlobal [_index, ""]; createVehicleCrew _drone; _drone disableAI "LIGHTS"; _drone disableCollisionWith _vehicle; _drone setVehicleAmmo 0; _drone setVehicleTIPars [1,1,1]; _drone engineOn true; _drone doMove (position _drone); nul = [_drone, _projectile] spawn { params ["_drone","_projectile"]; waitUntil {!alive _drone}; _bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle getPos _projectile; _bomb setDamage 1; deleteVehicle _projectile; deleteVehicle _drone; }; }]; and this code can be used for mortars (mortar has to be csat / mortar rounds will only be targeted by nato) this addEventHandler ["Fired", { params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; _drone = createVehicle ["O_T_UAV_04_CAS_F", [0,0,1000], [], 0]; _drone disableCollisionWith _unit; _drone attachTo [_projectile,[0,0,0]]; _drone setObjectTextureGlobal [_index, ""]; createVehicleCrew _drone; _drone disableAI "LIGHTS"; _drone disableCollisionWith _vehicle; _drone setVehicleAmmo 0; _drone setCollisionLight false; nul = [_drone, _projectile] spawn { params ["_drone","_projectile"]; waitUntil {!alive _drone}; _bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle getPos _projectile; _bomb setDamage 1; deleteVehicle _projectile; deleteVehicle _drone; }; }]; This is awesome. Thank you all for helping me
  7. So I want to make Cuise Missile that can be shot down. So far I've made the following code: this addEventHandler ["Fired", { params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; _drone = "O_T_UAV_04_CAS_F" createVehicle (getPosATL _projectile); _drone attachTo [_projectile,[0,0,0]]; _drone setObjectTextureGlobal [_index, ""]; createVehicleCrew _drone; nul = [_drone, _projectile] spawn { params ["_drone","_projectile"]; waitUntil {!alive _drone}; _bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle getPos _projectile; _bomb setDamage 1; deleteVehicle _projectile; deleteVehicle _drone; }; }]; I works great (beside that the drones pylons stay visible, which I haven't found a fix for) and you can manually destroy the cruise missile with an autocannon. But you cant lock it for some reason. Even if you turn the engine on the spawned drone on you just get the rectangel but not the sound/diamond with dot in the middle. Anyone know why? (Code is copied from the MK 41 Init Field)
  8. Heavensrevenger

    Cannot Lock/Target spawned in Vehicles

    Thank you so much! Also the rockets were the biggest concern as the rotorblade is hidden in the smoke anyway and until now I hadnt even noticed the lights.
  9. So, I used the following code to add cruise misssles to aircraft: this addWeaponTurret ["weapon_VLS_01",[-1]]; this addMagazineTurret ["magazine_Missiles_Cruise_01_x18",[-1]]; If the Code is added to like a rhino MGS or something it works fine, but if added to eg. the Gryphon when trying to lock on to the laser it just has the 4 corners around the laser but doesnt actually lock it.
  10. Heavensrevenger

    Run loop in init field with suspension

    Nice thats, all I needed. Thank you all
  11. Heavensrevenger

    Run loop in init field with suspension

    _this is refering to a different object than _attach, how do i pass _this aswell as _attach to the code? Edit: or rather, how do i pass 2 different local variables to the code?
  12. Heavensrevenger

    Run loop in init field with suspension

    The spawned code seems to have trouble running local variables. _attach = nearestObject [this, "B_Plane_CAS_01_F"]; x = true; nul = [] spawn { while {x} do { sleep 1; if (!alive _attach) then { deletevehicle _attach; this setDamage 1; }; }; }; how can I define them in the code? If i put the definition in the spawned code it tells me that "this" is not defined, but how do I define "this" without knowing the location of the object?
  13. Heavensrevenger

    Run loop in init field with suspension

    thank you so much! Thats what I was looking for
  14. I need to have the player rotate to another object but using this command: player setDir (player getDir _positionOrObject); only rotates horizontally, the only thing I've found that might work is https://community.bistudio.com/wiki/setVectorDirAndUp but i dont know how to get working values for it.
  15. Heavensrevenger

    get the vertical direction to an object

    Thank you! That did the trick.
×