Jump to content

pierremgi

Member
  • Content Count

    4270
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by pierremgi

  1. AI VEHICLE RESPAWN SP/MP Hi all, Did you ever try the BI respawn vehicle module? That works well on empty ones, as far as you linked the vehicles to the module. With some disappointment trying to link a flying helicopter and see it (them!) falling to the ground. A little code in the "expression field" and, yeah, you create a new crew and a helo just hovering now! But, what if you want, not only the standard crew, but also the airborne assault squad into it? When? Where on helo track (waypoints)? And, why not respawning a crate? and the loadout for any respawned vehicle/crate? I suggest the following script to allow AI vehicle, manned or empty, but no player on board), respawning according to parameters. This works in SP or MP. Only vehicles (+ full crew if any) / crates are concerned as far as the respawn for killed infantry AI units is the object of a this other script. version December 06th 2018 parameters: VEHICLES / POSITIONS / DELAY / RESPAWN WHEN DISABLED / EMPTY VEHICLES (ALL) Examples: [] spawn MGI_fnc_vehicleRespawn // [] passed as parameter equals to [ [ ], "death", 10, false, true] All empty vehicles can respawn on their position at death, after 10 sec delay, without possibility to respawn if just disabled. [ [WEST,EAST], ["mrk1","death","start",""], nil, false,false ] spawn MGI_fnc_vehicleRespawn // equals to [ [WEST,EAST], ["mrk1","death"], 15, false,false] here, only WEST & EAST ai vehicles can respawn: - on the marker "mk1" if any, (on death position if marker not present), for BLUFOR vehicles - on the position of death for OPFOR vehicles, (other strings in positions array are useless), 10 second delay (default), without respawn when disabled. Code to be run on server (eventually on Headless Client). example: initServer.sqf if no HC. or inside a simple trigger in 3den, server only, non-repeatable, condition true ___________________________________________________________________ FIRST SCRIPT for a basic MGI_fnc_vehicleRespawn (with standard loadout, crew and waypoints, but no kept appearance, pylons, actions ,arsenal...): ___________________________________________________________________ SECOND SCRIPT (instead of first one) for MGI_fnc_vehicleRespawn (now adding skin, appearance, loadout, pylons and turrets config, actions menu). Tha's a step further, with integration of the two functions MGI_fnc_getVehicleLoadout and MGI_setVehicleLoadout for recovering the vehicle loadout after respawn: Enjoy! Pierre MGI Notes: - If you choose to respawn the disabled vehicles, these will be destroyed (then respawned), probably earlier than for the normal destruction. Destruction occurs sooner but not before the crew leaves the vehicle. So, if you allow crew staying inside immobilized vehicle, this "respawn on disabled" is postponed until destruction by enemy or abandon. - using the second scrip^t, some behaviors like custom loadout and actions menu needs to fire the EH handle damage. That is to say, you have to damage the vehicle in-game (firing at it), not using a simple setDamage via debug console (this command doesn't trigger the EH). Also, let some seconds after mission start (Arma engine actions menu returm something for the actionParams). Version 13112018: added possibility to "respawn" the code written in init field of a vehicle. You just need to write it this way: instead of <your code> write: this setVariable ["MGIcustomCode", ' <your code> ' ]; call compile (this getVariable "mgiCustomcode") Pay attention for double and single quote! Example: in normal init field, you can write: 0 = [] spawn {waitUntil {!isNull player}; hint ("hello "+ (name player))} Here you need to write: this setVariable ["MGIcustomCode", ' 0 = [] spawn {waitUntil {!isNull player}; hint ("hello "+ (name player))} ' ]; call compile (this getVariable "mgiCustomcode") Version 06122018: improved jets respawn. Version 09102019: spawning vehicles on carrier at sea. Version 13103019: fuel management and some extra cases
  2. if (isDedicated) then { this addEventHandler ["killed",{ (_this #0) spawn { params ["_plyr"]; TitleCut [" ","black out",1]; sleep 3; TitleCut [" ","black in",3]; "DynamicBlur" ppeffectenable true; "dynamicBlur" ppEffectAdjust [6]; "dynamicBlur" ppEffectCommit 0; "dynamicBlur" ppEffectAdjust [0.0]; "dynamicBlur" ppEffectCommit 5; ["Initialize",[player,[west],false,false, false, true, true, true, true, false]] call BIS_fnc_EGSpectator; sleep 3; ["Terminate",[player]] call BIS_fnc_EGSpectator } }]; }; if (isServer) then { removeGoggles this; this addGoggles "G_Balaclava_Combat"; };
  3. Place your trigger with an area (circle preferred) set the condition to TRUE (always met) make it server only, as reference for every players. You don't want the players to have different locked doors; in on activation field of the trigger: { _nbDoors = getNumber (configfile >> "CfgVehicles" >> typeOf _x >> "numberOfDoors"); for "_i" from 0 to _nbDoors - 1 do { _var = format ["bis_disabled_Door_%1", _i]; _x setVariable [_var,selectRandom [0,1],true] } }forEach (nearestTerrainObjects [getpos thisTrigger,["house","building","tourism"],(triggerArea thisTrigger) select 0]);
  4. pierremgi

    Script help

    waitUntil {sleep 5; count allUnits - (west countSide allUnits) <= 2}; {deleteVehicle _x} forEach (allUnits select {side group _x != west});
  5. pierremgi

    Switch code with no result?

    if you don't want to bother you with case sensitive switch do, there is a similar coding: call { if somethingTrue exitWith {fisrt Option Code}; if somethingElseTrue exiwith {secon dOption Code}; if .... exitwith ....; in Case Of: Default Code; }; Here exitwith just exit out of the call. There is a difference with switch do process, for default block, but imho this method is clearer.
  6. This feature seems not implemented. If you edit the uav.fsm and requester.fsm, (in arma3\addons\module_f.pbo) you can see there is nothing to do with that.
  7. The only interesting damages are given by getAllHitPointsDamage and transferred by setHitDamage or setHitIndex . If you pick damage to further apply setDamage , you'll never recover the former damage status, just applying an average of damage on each parts of the vehicle.
  8. I can't reproduce that. Check for startPos eveywhere again. If sentinel takes velocity, that's because it's not touching ground (i.e. the deck). Check the positioning of your UAV by isTouchingGround command. (out of map cursorObject is always null, use cursorTarget or vehicle name). Normally, you can recover addAction on respawn because I scripted for that. I don't know (and I don't care) if it's compatible with other mods playing with menus. I'm scripting for Vanilla (+ vehicles mods like CUP or RHS), but in any case for ACE or exotic mods altering menus. I don't know if it's your case. It's just an info. I spent hours to test sentinel on carrier or ashore, with different pylons, so, except if you have a reproducible mission (or uploaded file), I can't help anymore.
  9. Thanks for your feedback. The skin and loadout problem should be solved now. That was due to some blowing "at once" vehicles and my new performance saving EH. Please Try it now. When you write: 0 = [[veh1,veh2],["startpos"],10,true,false] spawn MGI_fnc_VehicleRespawn (I know you changed "start" for "startPos" everywhere, due to your scenario), that means veh1 will respawn on its start position, but veh2 will respawn by default on its death position. (unless you're writing ["startPos","startPos"]) So, 0 = [vehicles,vehicles apply {"start"},10,true,false] spawn MGI_fnc_VehicleRespawn just means that you apply to the array of vehicles, an array of "start" as parameter, with the same number of elements in array. You can even write something like: _arrayOfVeh = vehicles select {_x isKindOf "landVehicle"}+vehicles select {_x isKindOf "air"}; _arrayOfpos = (vehicles select {_x isKindOf "landVehicle"}) apply {"death"}+ (vehicles select {_x isKindOf "air"}) apply {"start"}; 0 = [_arrayOfVeh,_arrayOfPos,10,true,false] spawn MGI_fnc_VehicleRespawn if you want to respawn planes and helos on death positions and ground vehicles on start ones. Don't forget, spawned vehicles are not taken into account with this kind of line. You must do a loop or use side parameter for that (or use my advanced module, to be corrected soon).
  10. Corrected for spawning vehicles on carrier at sea. + some improvements like helo ditching and in flight edited aircraft (already flying at mission's start). All feedback welcome. Some difficulties for respawning at death position an aircraft colliding with the ground (no previous damage). The solution needs some extra tests.
  11. @dyrmoon You should try with allMissionObjects "explosion"
  12. which mods? did you script something to add laser/light on weapon? did you check your files integrity in steam, arma in library, right click for properties, local files?
  13. Hello. Welcome on forum. thisList is a special variable for triggers, which returned the objects (units/vehicles) satisfying the preset conditions (example BLUFOR present). You can use it in condition and on activation fields but not in on deactivation field where it doesn't mean anything. thisList select 0 is just the first object in the list (if any).
  14. pierremgi

    AI surrender script multiplayer

    Sorry for the time difference. For MGI tactical pack, you can find the notice (pdf) in the addon folder, usually located in arma3\!workshop. On server the conditions are not often met, intentionally. I can pbo a specific mod, with a specific key for signature, so the server owner will have to accept it. For MGI advanced modules (signed also), the notice (WIP) is here, last module.
  15. pierremgi

    AI surrender script multiplayer

    Interesting question and BI skipped that. I wrote somewhere it was a miss for the "Laws of war" DLC. Anyway, I edited 2 addons: -1st one is a simple "make prisoner", right clicking while aiming (temporary zoom), under certain conditions of course (see MGI Tactical pack); - 2nd one allows prisoners and escort to jail. (see MGI advanced modules). If I remember both aren't compatible each other. I'm aware, it's not a splendid behavior, but at least, that works in MP. Not so often feedback on that.
  16. As Beno_83AU wrote: forgetTarget . That's the solution for your specific case.
  17. Marker is a bad idea. I implemented that just in case you don't want to respawn at start or death positions. I'm about to fix this problem without extra workaround but I discover that ditching disabled helo (say a stationary Huron fired by a single Titan AA MPRL) don't fire the MEH "entityKilled" when the Huron sinks and becomes wreck. It's weird. Working around (one more time!) on a specific Arma behavior.
  18. It seems to me that you can loose an helo at sea without triggering the MEH "entityKilled" I tried several landing at sea (ditching). The helo sink, becomes wreck and not alive but the MEH can't take that into account. For sure, maritime events are not at the best in Arma (even allowDamage false for player can't work in diving)
  19. Formerly, in these scripts, "start" is used as a string different from any marker, saying you want to use the initial position for respawning. "death" is also a specific string for respawning where the vehicle was destroyed/crashed. If your mod/script uses "start" as marker name, not my bad, the vehicle will respawn at this marker just because my script checks for any marker before other possibilities. So, if you have a marker named "start" and you want to respawn at initial position, the simplest workaround is to modify the script for reading another string, no matter which one, but you must be consistent, so change "start" by "anyNameYouLike" everywhere in the script. The result will be the same. If you read the "notice", a simple "anyNameYouLike" as parameter will be efficient for any vehicle to be respawned on its initial place. "start" (or "anyNameYouLike") and "death" are generic. No need to refer at one vehicle. Read the explanation.
  20. Welcome text: Do what you want in initPlayerLocal.sqf Message for special key or other stuff: think about briefing (intel module: create diary record, in editor) At least, the player can read that when he wants. General message: waitUntil condition on server (initServer.sqf or init.sqf and if(isServer) then ....) ; then, as example, remoteExec hint, add JIP param (all details in BIKI).
  21. You need to read some topics about MP. Your aim is easy but there are so much things to understand to make MP work properly. MP scripting Event scripts initialization order locality code optimization and most of their links, not mentioning extra knowledge to run it on a dedicated server. All players must have all the sqf files to be run. That's not a problem, they are loaded at start if your fellows discover the mission. For example, you host your mission and when people join they download the mission.sqm but also all the sqf paa ogg... folders if any. As a good habit, try to manage: - server things through specific sqfs that you can call from initserver.sqf - player things through initPlayerLocal.sqf A very good place to run a text for JIP without boring the others. - init.sqf is a common code for server and players. It runs at server start and alongside JIP. So its code can ruin (reset) your ongoing scenario by re-running some global effects and data. Same for all init fields of all objects/units in editor. That doesn't mean you can't use them but a server condition will be added most of the time. Keeping on mind when / where / why any code runs is mandatory. And where the results /effects occur also. One of the most powerful but probably hardest thing to understand is the remote execution. You can execute some codes remotely on other PCs. That doesn't mean you will send missing files like pictures or sounds, but you'll trigger some displays or events on whole or specific PCs. Start to read. Bis_fnc_MP is obsolete. Hard to resume. Have fun!
  22. Anyway, if you spawn units, you can make them join an existing leader (edited or not), so they will follow his waypoints (if any). If you don't want to join an existing leader, you need to write your waypoints with the waypoint commands like addWaypoint... (see BIKI). I guess you are using Jebus and Gaia for that and you probably encounter some problems due to these codes. You should ask their authors. For checking some waypoint feature, enable the console and watch for waypoints yourGroup apply {[_x, waypointType _x]} Note: I never used the skip waypoint, totally useless as far as you can deleteWaypoint with a little code: waitUntil {someCondition before the waypoint is reached (check currentWaypoint)}; deleteWaypoint theWaypoint.
  23. pierremgi

    Headless client on rented server

    Imho, except if you have a multi CPU on your PC, there is no added value to run HC + player instances on the same PC. HC is made for discarding the CPU load (of the server), redistributing some AIs features on a remote PC. Are you sure you need to divert AIs calculations from server, to your PC already in charge of your player (+ your AI group + owned vehicle)? Not saying that you multiply broadcast data which need sync between server / HC / other clients.
×