Heavensrevenger
Member-
Content Count
40 -
Joined
-
Last visited
-
Medals
Everything posted by Heavensrevenger
-
Hello, im trying to make a A-143 with jericho trumpets, so when diving it makes a sound. I have the following code so far, but I have trouble attaching the sound to the airplane. I know of say3D, however I don't think the volume can't be changed in that command, furthermore this script is supposed to be a composition so that it can be spawned on the fly in any mission. Any input is much appreciated! this addWeaponTurret ["cannon_125mm_advanced",[-1]]; this addMagazineTurret ["24Rnd_125mm_APFSDS_T_Red",[-1]]; this addMagazineTurret ["24Rnd_125mm_APFSDS_T_Red",[-1]]; nul = [this] spawn { params ["_this"]; while {alive _this} do { _velocity = ((velocityModelSpace _this select 1) - 100) max 0; _vol = _velocity / 10; playSound3D [ "a3\sounds_f\sfx\alarm_blufor.wss", _this, false, _this, _vol, 1, 300 ]; sleep 3; }; };
- 2 replies
-
- playsound3d
- script
-
(and 2 more)
Tagged with:
-
Attach sound to a vehicle
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have the same problem with the distance, but it fixed it when i put the distance up to like 1500. The problem is that it it doesn't move with the plane, so after 0.5 seconds the airplane already moved 100m and the sound just plays from the same spot in the air- 2 replies
-
- playsound3d
- script
-
(and 2 more)
Tagged with:
-
Hello, I just a little help with the missileTargetPos command. When running it on the VLS Missile it seems to return a random position mid air near the launcher, but not where the missile is actually intended to go. Is there a reason for this or a different way to find the target position?
-
Turn vehicle except the turret invisible
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I know of mods with open topped vehicle (which is really all i want lol) but idk i prefer vanilla or using mods for some reason. But i still found a good way, by using props attached to the turet to act as the shield in the prowler -
Turn vehicle except the turret invisible
Heavensrevenger posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, i need some help; im trying to make a humvee like hunter, so with a manned HMG. My thought process was to attach a prowler HMG to the Hunter and the turn everything but the gun invisible. I'm not sure how to do this or if this is the best way to do it. -
Hello I want to spawn the explosion of the 30 mm MP-T from the LDF APC using createVehicle. I know you can spawn "HelicopterExploBig" and I was wondering if there was a CFGAmmo for the 30mm explosion.
-
CFGAmmo of 30mm explosion
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
can you only detonate spawned projectiles? Because the explosion would be spawned on an existing 30mm anyway, but when i tried to set its damage to 1 it wouldnt explode. -
How to identify selected objects class
Heavensrevenger posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
I'm making interceptable Artillery rounds, however I can't attach a drone (that acts as the target for AA) to Cluster rounds / MLRS, i fixed MLRS by teleporting the drone to the round at all times. I was planning to do the same for the cluster, but since howitzers have multiple ammo types I need to find out if the round is a Cluster or not. this addEventHandler ["Fired", { params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; _drone = createVehicle ["B_UAV_02_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"]; if ( _projectile == "Cluster_155mm_AMOS" ) then { //this doesnt work while {alive _drone} do { _drone setpos getPosASL _projectile; _drone setVelocity velocity _projectile; sleep 0.001; }; }; waitUntil {sleep 0.001; !alive _drone}; _bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle getPosASL _projectile; _bomb setDamage 1; deleteVehicle _projectile; deleteVehicle _drone; }; }]; I either need a way to check the projectiles Cfg class or a way to attach the drone to the artillery round Thank you in advance Edit: if ( getText (configOf _projectile / "vehicleClass") == "Cluster_155mm_AMOS" ) then { this doesn't work either -
So I wanted to make programmable AB rounds that explode a few meters beyond the turrets current zeroed distance. I thought I could use currentZeroing but it only gives the manually zeroed distances (100,200,300,400,...), however i need to know the distance the gun automatically adjusts to when lasing the range. Is there any way to get that value? Thanks in advance
-
Finding a weapons zeroing
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I will use a keypress detector and then run screenToWorld, that should work doesnt work, as the range goes through objects like houses or walls -
Finding a weapons zeroing
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
works well with helis and planes but for ground vehicles the gunner doesnt really have a laser -
I've just made a new loadout that still had some space when it came to stamina but not inventory so i just wanted to add a rpg with a rocket already inside. Problem is everytime I load the loadout the rpg is empty and I don't know how to fix it. I tried looking at the text when exporting and as for is I understand the problem comes from the line "this addSecondaryWeaponItem "RPG7_F";" because it doesn't get saved I think. What bugs me the most is I have a couple Loadouts with single use launchers and they all work fine. Edit: I use a UGV as a backpack, if I change it it works. Is there a way to make it work with a UGV?
-
Run a code for each crew member of a vehicle
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you! This works great -
Run a code for each crew member of a vehicle
Heavensrevenger posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello i want to run a code on every member of a vehicle (Turrets, cars, tanks, planes, helos, boats and basically everything that can be entered). I have the following code for this: _vehicle = nearestObjects [player, ["AllVehicles"], 200]; { if (damage _x < 0.5 ) then { _x setdammage (damage _x + 0.1); }; } forEach crew _vehicle; But the code always tells me that in the forEach crew _vehicle; it expects an object not an array. I'm unsure how to do this. Do I have to do this: _vehicle = nearestObjects [player, ["AllVehicles"], 200]; { { if (damage _x < 0.5 ) then { _x setdammage (damage _x + 0.1); }; } forEach crew _x; } forEach _vehicle; or is there a better way? Also is the "AllVehicles" class the correct one or should I use a different one? -
Run a code for each crew member of a vehicle
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've run into a problem I'm not sure how to fix _vehicles = nearestObjects [player, ["Ship", "LandVehicle", "Helicopter", "Plane"], 200]; This returns the "crew" AI of drones, so running the code will kill the drones "crew" so they are basically useless. Is there a way to exclude classes? i tried !"B_UAV_AI" but that doesnt work -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I see. I've got most the code down now, it's really just bugfixing but ill make a mental note for next time or if i decide to overhaul the code for efficiendy or something thank you -
Run loop in init field with suspension
Heavensrevenger posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I know .sqf is generally better but i would like to save the props as a composition so i can just place it down in different missions. Is there a way to run loops in the init field WITH suspension. Sleep doesnt seem to work. -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
this... is exactly what i was looking for -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ok i dont quite understand, maybe im too new to code and this is above my experience, so please excuse if what im about to say doesnt make sense. This code just passes a local variable into a spawned code, i think? my problem was more like passing the variable back out but there seems to be no function for that other than global variables And this code will output me the loadout of the units i put the code on? It didnt work for me it just said [] but if thats what i should do then that also doesnt answer the question i had. At this point I dont know anymore, so ill just do the code in a single spawned script -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you very much thats what I was looking for. So for clarity, from what I understand I can use global variables (but that means i cant copy and paste the object anymore, because maybe the radius of the 2nd object is supposed to have different values (in this case i would have to change the global variable to i.e. radius2 for one of the props)) or I write the code within one scope instead of two. -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, last effort because I think I know how to communitcate what I need 😅 I don't need to know how to code the radiation or if its possible because I know it is and I know how. But I was speculating that there was a better way to do things Basic example code, where I want to know _radius after 4 seconds: Option A: The one where I know it works however the code to announce the radius after 4 seconds is inside the code that increases the radius (Somewhat untidy, can get confusing with longer code) private _maxradius = 1000; private _radius = 1; nul = [_maxradius, _radius] spawn { params ["_maxradius", "_radius"]; _x = 0; while { _radius < _maxradius } do { _radius = _radius * 2; if (_x == 4) then { hint str _radius; }; _x = _x + 1; sleep 1; }; }; Option B: The way it is right now it doesn't work but it would be more tidy and compact as the code to announce the radius is separated from the code increasing the radius private _maxradius = 1000; private _radius = 1; nul = [_maxradius, _radius] spawn { params ["_maxradius", "_radius"]; while { _radius < _maxradius } do { _radius = _radius * 2; sleep 1; }; }; nul = [_maxradius, _radius] spawn { params ["_maxradius", "_radius"]; sleep 4; hint str _radius; }; Code A would hint I believe "32" while code B would say "1", I know A works but what I'm looking for is a way to make code B also say "32" without using global variables or calculating the radius inside the second spawned code / use hint in the first spawned code. I think/hope this is more understandable. -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I dont really want to make a certain campaign or anything i just want to write to script to run it and be proud when it works, also to get better at scripting obviously. The plan is to make something radioactive in gerneral. A zone slowly expands around an object and anyone inside takes damage. The zone eventually stops increasing in size but soldiers who enter the zone should obvously still die. Add to that maybe some visual effect and buidings also taking damage but only till they are 50% down to simulate like corrosion or something. I havent started coding yet but i know its doable and i could do it , but i wanted to know if i can have seperate codes running simultaneously to keep things more organized i guess. As in the 1. Spawned Code expands the circle, then the 2. Spawned code checks for units in the circle and deals damage and the 3. spawned code deals damage to buildings. This would work with global variables as the 2nd spawned code could "ask" the first how large the circle is but using global variables would mean that I cant copy and paste the object without also going into the code and adding a number behind each global variable (The circle around one radioactive zone may not be as big as the one of a different zone). So my idea was that there might be a way to pass the local variable from the first spawned code to the second. If there is none then i will have to run the code in a single spawned code which would also work. This was really just me thinking in advance hoping to have a tidier / more segmented code. I feel like its still pretty badly explained so ill try to create a problem i might run into: If the soldier only takes 0.1 damage and the time between being damaged is random, you could something like sleep random 10; however i also want to keep expanding the overall radius of the radiation at a steady pace. In this case running 2 codes at the same time would be useful. You could also create a random number _x and then add 1 to _y everytime the code runs and the soldier takes damage if _y is greater than _x. That would mean the code has no suspension and the radius expanison at the beginning of the loop continues at a steady pace. Idk to be honest. I just want to run 2 codes at the same time that share a local variable. Im gonna post this because I wrote it all and dont want to delete it but i will probably just start writing the code and then make a new topic if i run into a problem, that way there is a good example of what i mean to solve. -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
more like a bomb blast as youve coded however i want the soldiers taking damage to linger forever while the radius stays the same eventually. For that you can just do another loop after the "for "_i" from 1 to _totalLoops do" loop but what i was originally getting at is that you pass the _currRad variable outward to a different spawned code (so basically having 2 nul = [_myObject, _attach] spawn {}; that share the _currRad variable). I hope I made understandable what im looking for Also im sorry for probably causing alot of confusion by not starting a new topic. The code im making is different from the original code that uses _myObject and _attach but i thought since it's this thread that taught me to spawn code and pass local variable into said spawned code, itd make sense to ask how to pass local variables back out of spawned code. -
Run loop in init field with suspension
Heavensrevenger replied to Heavensrevenger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes and no, in the code i posted _myObject is _radius and i want to check that after 4 seconds, but i want to check it in a different spawned code. So as the code is right now it will say _radius is 0 becasue thats what i defined it as at the start but i want it to tell me what _radius is after 4 seconds of running the first spawned code. This would work by simply using a global variable, however i want to copy the prop im using so that would break the code. (If what im trying to do isnt possible global variables will have to do) Im not sure what you mean, but I dont want to spawn a composition in a running mission if thats what youre getting at PS: for clarity, the code i want to make is basically increasing a circle beginning from an object and then checking for anyone in the circle / damage them, i may be able to make it work within one spawned code however as the codes have to run at the same time (increasing radius and damaging player) i figured itd be tidier to have multiple spawned codes that each have their own purposes (one spawned code increases radius the other spawned code damages units) Then why not simply increase the radius after damaging the units and use just one single code? Because im still unsure wheter or not i will need waitUntil or run more loops within the codes which would then offset the expansion of the circle. Also should I start a new topic for this or change the title? -
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!