Jump to content

_qor

Member
  • Content Count

    294
  • Joined

  • Last visited

  • Medals

Everything posted by _qor

  1. There is one heli with a "HOLD" waypoint synchronized with a trigger, which makes the heli fly to a certain waypoint when a certain unit is dead. But then I want the heli to load 2 groups and unload only them at the waypoint. This is possible by the "TRANSPORT UNLOAD" waypoint so far. The only way I found to make this possible, is by set each unit to "in cargo" and group it with the heli. Unfortunately the actual groups dont exist anymore this way. So when the heli alights, all the units (instead of the pilots etc.) disembark, but are single units. I want them to stay in their groups. How do I do that?
  2. I have got several ammo crates which have to be destroyed. If this happens, mission should end. I set a trigger with the condition: {alive ammocrate} count units=0 but it doesnt work (yes, I set Type to "end"). So what do I have to add to condition and by which command do I attach the other ammo crates? Is there a "notalive" command? Currently I preview the mission and instantly debriefing pops up, even though I am out of the trigger's range. Why?
  3. Hey there, I want to wide the friend/enemy conditions a bit. So even if the player is regarded as enemy to a side, it can be setCaptive true. The conditions for this are fullfilled if the player has no weapon or is inside unarmored car. This is the loop: And the question is how to control if the loop stops or continues. So if the player has been identified as enemy, the loop has to stop so it wont set the player to captive true again. Unfortunately I realized too late that knowsAbout is not suitable for this, because its result doesnt decrease properly. Actually I wanted to stop the loop if west knowsAbout player >= 0.105 and to continue it if < 0.105. So is there better way to check if the player is not seen/detected by side west? I would combine that with a specific period of time this condition must be true (timeout).
  4. Great, it works. Now I am finally aware of what forEach does ;)
  5. Hey, I want to know how much weapons and magazines are within a spefic cargo. getWeaponCargo and getMagazineCargo return the following array: [["AK_74","M4A1"],[4,30]] So (getWeaponCargo _vehicle) select 1 would return all the amounts of the weapons. But how can I easily add them to one sum?
  6. Hey, I was very lucky when I found helling3r's script which handles reading and refilling of cargo space: https://dev.withsix.com/issues/68594 But it is not possible for me to remove multiple items at once: _removeW = [_box, "AK_74", 5] call CBA_fnc_removeWeaponCargoGlobal; Additionally, the simple syntax only removes ALL items: _removeW = [_box, "AK_74"] call CBA_fnc_removeWeaponCargoGlobal; Is there anything I could have done wrong with this? Apparently there are 3 files to download, of course I use the latest one... Does this work for you?
  7. The content of the box will change very often while playing. So I cant use a code which adds a fix amount of weapons/magazines. It simply will not achieve the same effect as when I would remove a single weapon.
  8. Hey, I am looking for a way to transfer weapons from ammoboxes to vehicles without picking each single weapon. Best way would be to have an interface which allows you to choose the weapons and which adds/removes the selection when finished. But this requieres some experience with creating interfaces. Perhaps there already exists a script or there is an easier way to do this? Otherwise I really have to get into creating interfaces. In this case it would be great if the dialog of the already existing gear menu can be seen. Thanks!
  9. Ah, thought _weaponsCargo would also contain information about magazines. Works great, thanks a lot for those scripts!
  10. Hey, I added some weapons and magazines to a vehicle's cargo. Is there a way to swap this weapon-setup, which may have changed, to an ammobox? Cant find a way to do this by getWeaponCargo and weapons only returns "TruckHorn". I think there is a way to do this with getWeaponCargo, otherwise this code would have been introduced only to make the cargo visible. Unfortunately pickWeaponPool and putWeaponPool doesnt work. I read some posts mentioning that those codes do work.
  11. Wow, excellent!!! Exactly what I was looking for! So you call BIS_fnc_removeIndex to remove the each existing weapon from the vehicle? Or does this just removes the preexisting weapons in the ammunition MTVRs? Script works great for weapons, but not for magazines. I dont really know how to adapt the script. {_vehicle addMagazineCargoGlobal _x} forEach _weaponsCargo; returns onlythe given weapons.
  12. Try with this, I didnt look up the syntax rightly as well ;) _suspect = _this select 0; _police = _this select 1; _action = _this select 2; _suspect disableAI "MOVE"; _suspect removeAction _action; hint "SUSPECT IN CUSTODY";
  13. Sorry, there was a redundant quotation mark. handcuffAction = this addAction ["HANDCUFF","handcuffScript.sqf","",1,true,true,"","((_target distance _this) < 4)"] You can always look this up on your own at: https://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2 Search for addAction and look up the syntax and the examples.
  14. Hey, the scenario first: a convoy which has to get stolen by the player which has to unload the convoy's content at base. Convoy gets respawned if dead and therefore two vehicles with actually the same name can exist. Problem is, that when a vehicle with the same name as an existing vehicle gets spawned, the first vehicle (the "old" one) gets a new name. So there is a trigger which fires when a convoy vehicle is inside. But it wont get fired by the old vehicle which has been renamed. Actually I solved this problem (it just worked good without knowing exactly why), but while "improving" the script it seems to be a problem again. So this how I set up the addAction: FC2veh setVehicleInit "unloadFC2 = this addAction ['UNLOAD','convoys\Unload\FCunload.sqf','',1,true,true,'','((_target distance _this) <6) && (FC2veh getVariable ''GOODS'' == 1) && [FS_anar,_this] call bis_fnc_inTrigger']"; processInitCommands; What I thought is, the local variables would alway return the correct vehicle. But when the new vehicle is spawned, the action disappears from the old vehicle and only appears back when the new one is inside trigger too. Does this mean that [FS_anar,_this] call bis_fnc_inTrigger always returns FC2veh? Pls help, I got lost in script-glyphs ._. EDIT Got the point! Ofcourse the problem came up with introducing the a getVariable which is connected to the name. Anyway, it would be great if there is a convenient way to work around this problem with respawn and unitnames!
  15. Hey, I want to have a code which returns the enemy which has fired at a specific vehicle. So is there any code which works like assignedTarget but in reverse? The problem with findNearestEnemy is, that another enemy might be nearer to the vehicle but is absolutely unimportant for the scenario. Perhaps there is a way doing the same with findNearestEnemy? Thanks!
  16. Ya I solved it with "Incoming Missile" EVH. I guess there is no way to detect unguided missiles which hasnt been targeted at the helicopter without rather complicated scripting. Its hard to hit a flying chopper with a non guided rocket anway ;D
  17. To your last problem: Add this to your suspect's init: handcuffAction = this addAction ['HANDCUFF','handcuffScript.sqf','',1,true,true,'','((_target distance _this) < _range)'] Where you have to replace _range with the distance you want to be able to catch the suspect (try with 4). Create in your mission folder: handcuffScript.sqf _suspect = _this select 0; _police = _this select 1; _action = _this select 2; _suspect disableAI "MOVE"; ///_suspect setCaptive true; _suspect removeAction _action; hint "SUSPECT IN CUSTODY"; As far as you chase civilian units, you wont need to set them to captive because they are neutral to anyone anyway. If this is the case, just delete this line in the script, otherwise delete "///"!
  18. Hey, I want to spawn a Chinook with all crew inside, but using BIS_fnc_spawnVehicle spawns the Chinook like in the air with engineOn true and with some velocity. Although the heli spawns on the ground, the Chinook acts like a rocket firing straight in the air. I used setVelocity [0,0,0] and engineOn false, so at least the Chinook takes off smoothly. But I actually want it to stay on the ground with engine turned off. Do I need to use createVehicle and add the crew or is there a better way?
  19. Hey, I want to evaluate the fuel-level of a fuel station and add some fuel. Using an trigger to evaluate will return "scalar", but putting the same code in an gamelogic's init, it will return 1. fuel ((position this) nearestObject 94046) So why does this work only with a gamelogic? How can I evaluate this with an external script? Besides, does anybody know whether the fuel stations have eternal resources or get empty when in use?
  20. https://community.bistudio.com/wiki/Surrender "Soldiers surrendering will be setCaptive, disableAI "move", will leave their group, will disembark from their vehicle if they have one and won't be able to climb in another" if (captive _unit) then [your code here]; Cant find out how to check if "move" has been disabled, but evaluate only captive will do this too.
  21. Didnt know that command, I will give it a try! But combining lineintersects and "fired" may not be a solution as far as I add the eventHandler to all enemies in game. So the code should get executed from the vehicle which is under fire. "Max hardcoded distance is 1000m" could be a problem, because it should be about an helicopter and an AA ground unit, which targets the heli when it is about 2000m away. EDIT: IncomingMissile EVH should work! I realize to post more information next time ;D This EVH works great for this special purpose. But there is another problem: the EVH doesnt work for players firing a not guided missile ._.
  22. But I need something that fires even if the rocket fails to hit the vehicle. I thought about using waitUntil {behaviour leader _vehicle == "COMBAT"} to then evalute by which unit this has been executed and if this unit is attacking the vehicle.
  23. Hey, its just about this script that is not working: _trg1 = createTrigger ["EmptyDetector", getPos FC1veh]; _trg1 setTriggerArea [20, 20, 0, false]; _trg1 setTriggerActivation ["ANY", "PRESENT", true]; if (EAST countSide list _trg1 == 0) then {hint "free to delete"} else {hint "occupied"}; Of course the necessary conditions to fire the trigger are fulfilled. Got an idea what might be wrong?
  24. Hey, I spawn a convoy with this script FC1 = [getmarkerPos "FC_spawn1", 172, "HMMWV_M1151_M2_DES_EP1", West] call Bis_fnc_spawnvehicle; FC1veh = FC1 select 0; FC1crw = FC1 select 1; FC1grp = FC1 select 2; FC2 = [getmarkerPos "FC_spawn2", 172, "MtvrRefuel_DES_EP1", FC1grp] call Bis_fnc_spawnvehicle; FC2veh = FC2 select 0; FC2crw = FC2 select 1; FC2grp = FC2 select 2; convoyGuardFC = createGroup west; FCg_l = convoyGuardFC createUnit ["US_Delta_Force_TL_EP1", getMarkerPos "cgFC", [], 0, "FORM"]; FCg_mg = convoyGuardFC createUnit ["US_Delta_Force_MG_EP1", getMarkerPos "cgFC", [], 0, "FORM"]; FCg_s = convoyGuardFC createUnit ["US_Delta_Force_Marksman_EP1", getMarkerPos "cgFC", [], 0, "FORM"]; {_x moveInCargo FC1veh} forEach units convoyGuardFC; Is there a way to delete all of them (drivers, vehicles, cargo units, gunners...)? It doesnt work with {deleteVehicle _x} foreach units FC1grp; {deleteVehicle _x} foreach units convoyGuardFC; If the convoy is destroyed, I want to spawn the same convoy again, so I think I need to delete the old one because otherway there would be a name-problem?! It is possible that a driver of any vehicle has disembarked. So I cant refer to driver vehicle and need to refer to the whole group.
×