Jump to content

Fiddi

Member
  • Content Count

    241
  • Joined

  • Last visited

  • Medals

Everything posted by Fiddi

  1. Light advanced vehicle respawn I present to you the vehicle respawn that will change your life (probably not..), it has the capabilities to save much of the customization available in the Eden editor and apply it on respawn. You simply set up your vehicle how you want it in the editor and this applies whatever settings you want. I've made it as light as I can, it should not affect performance noticably (though with hundreds of respawnable vehicles, it could) Multiplayer and singleplayer: Features: Init Support Respawn Delay Custom Loadout/Inventory Custom Paints Custom Parts Respawn Limit Wreck Disposal Minimal Performance Impact Installation and setup: So, onto the logistics. 1. Download the script in question: Download Here! (Included an example mission that have it set up ingame) 2. Copy over files to you mission: Simply grab the "VehicleRespawn" folder from the archive (inside Example.VR) and place it in your mission folder. 3. Setting up to load ingame: In your description.ext (if you don't have one, create it) add this: class CfgFunctions { #include "VehicleRespawn\CfgFunctions.hpp" }; 4. Choosing which vehicles to respawn: In the Init-field of the vehicle(s) you want to respawn put this: [this] call FRED_fnc_vehicleRespawn; This will respawn you vehicle when destroyed with default settings (details below). Now you have a vehicle that will respawn when destroyed. Additional customization: There are options you can customize and disable at your leisure Parameters: 0 : OBJECT (REQUIRED) - Vehicle to be monitored for respawn. 1 : NUMBER (OPTIONAL) - Respawn delay in seconds. +-5-10 seconds. (Default: 5) 2 : CODE (OPTIONAL) - Initialization for vehicle. (To call vehicle use: _this) 3 : NUMBER (OPTIONAL) - Respawn Limit. Number of lives a vehicle has. Unlimited by default. (Default: -1) 4 : BOOLEAN (OPTIONAL) - Deletes wreck on respawn. Wrecks within 100m of respawn point is automatically deleted, regardless of setting. (Default: false) 5 : BOOLEAN (OPTIONAL) - Use Custom Loadout. Saves inventory and loads it on respawn. (Default: true) 6 : BOOLEAN (OPTIONAL) - Custom Paintjob. Saves the current paint on the vehicle and applies it on respawn. (Default: true) Example: [this, 5, {_this allowDamage false;}, false] call FRED_fnc_vehicleRespawn; There's also an option to quit respawn for a vehicle if the situation requires it. Simply execute this code on the vehicle: Vehicle setVariable ["VRStop", true]; You can add vehicles for the function to respawn when the mission is already running. If you have questions or feedback, by all means ask and tell. Thanks! Version History:
  2. Hi, I have a script where I spawn a Huron helicopter and want it to hook to a box (a vehicle ammo box). In the editor it works fine, the helicopter fly to the box and picks it up, but when I try to do the same via scripts the helicopter just hovers 40-50m from the box indefinitely. This is my code to spawn and add the waypoint. _huron1 = createVehicle ["B_Heli_Transport_03_unarmed_F", getPos _HQ_dropOff, [], 0, "FLY"]; createVehicleCrew _huron1; sleep 0.1; _huron1WP = group _huron1 addWaypoint [_box, 0]; _huron1WP waypointAttachObject _box; _huron1WP setWaypointType "Hook";
  3. Hey, I'm having some weird issues with a helicopter full of AI (all in the same group incl. pilot) in cargo. They have a Hold waypoint with trigger activation, a move, get out and seek and destroy. Waypoints works but there's always two AI that gets out during the hold waypoint before it has been activated by the trigger, as in the pilot lands the helicopter and they get out and the helicopter takes off again to original position. It's a Hellcat with full cargo of FIA soldiers (6). I can't figure out what drives them to such weirdness, usually I have a relatively good grasp of the AI but this is just... I can't even.. Also, is there a way to make a patrolling unit skip all their move waypoints before a Cycle and go to a waypoint (seek and destroy) after the cycle, in the editor? Thanks!
  4. There is no code. Everything is in the editor. Does lock really work with AI? I've had AI entering locked vehicles before, but I'll give a try. I found out that if I deleted the two who exited it was business as usual, but then, of course, it was too easy. (Always something, haha!) I know about setCurrentWaypoint, was just wondering if there was another way inside the editor itself. I've tried syncing all the groups waypoints before the seek and destroy and that did nothing, I was hoping to make my mission with as little (self made or otherwise) scripts and functions as possible but still maintain a nice dynamic. Thanks for the help, though!
  5. Hello, I was wondering exactly what is saved when using the existing save function on missions. I get that units, vehicles and stuff that is placed inside the editor is saved and such, but are variables in the init.sqf saved? How about dead bodies and destroyed vehicles? Are there any event handlers for when the game is saved and loaded? I'm trying to design my mission with as few external scripts and functions as possible, mainly because I want to be able to use the vanilla save and load. But I need to know what kind of limitations I will be encountering. Thanks!
  6. @Larrow That all sounds very complicated. Is the init executed on every mission load? If so there's a simple possibility to just have a few ifs and thens to load whatever necessary from profileNamespace. And I was thinking manual saving as in trigger or action induced. So as to have clear checkpoints which makes loading and saving easier.
  7. You can give the "bystanders" an event handler that disables the damage from certain vehicles. They still get run over, it's just that they won't die or take any damage from them. (May need some rewriting to fit specific needs, right now it's just for drivers from the same side.) _unit addEventHandler ["HandleDamage", { _unit = _this select 0; _driver = _this select 3; if (vehicle _driver != _driver AND side _driver == side _unit) then { 0 } else { _this select 2 } }];
  8. Hi, I'm having problems figuring out what I'm doing wrong with the command drawIcon. It works in singleplayer and the icon shows up on the map, but in multiplayer it doesn't. It's supposed to be displayed on both the GPS-minimap and the regular map screen. Here's the code I've got so far. It's executed on the init of the unit (fredrik) in question. ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", { (_this select 0) drawIcon [ "iconManMedic", [0,0,1,1], (getPosWorld fredrik), 0.5 / ctrlMapScale (_this select 0), 0.5 / ctrlMapScale (_this select 0), getDir fredrik, (name fredrik) ]; }]; Any kind of clarification on how to get it to show up on the GPS and in multiplayer would be appreciated! Thanks!
  9. Right, so the display wasn't initialized when the event handler was made. Guess that makes sense. Thanks!
  10. Thanks for the code! I'm executing it on the players init field inside the editor. But I've tried initServer.sqf and initPlayerLocal.sqf
  11. I don't know why they didn't make the "Edit terrain objects" module work in multiplayer. I have a similar problem, I can see destroyed buildings that I've made with the module but everyone else see both the destroyed building and the undamaged one, and they are flickering and occupy the exact same place. Also AI shoot through the undamaged building and kill the client players inside.
  12. Is it possible to determine which building positions, generated by { _building buildingPos -1; }, is indoors and inside the building? I have had to manually check in all houses I wanted and make an array, but I would like to have it more dynamic and universal than that, no mention that it takes time to go through the different building types.
  13. Thanks, that helped. I didn't know about lineIntersects before. I tailored your functions to my own needs (It didn't work at first since lineIntersects specifically need ASL pos and buildingPos outputs AGL) Came up with this: _spawnPos = selectRandom ((_building buildingPos -1) select {lineIntersects [AGLToASL _x, (AGLToASL _x) vectorAdd [0,0,10]]}); That works with the building with the highest roof in Altis (the ghost hotel foyer, I think). Though I ended up keeping my original manual solution, since there were a few buildings with positions that were indoors I didn't want to spawn in. However since that is solved we can keep it here for the archives, in case anyone else needs it. Thanks again!
  14. A script command for manipulating an objects temperature, as in it's visibility on thermal imaging. For example: _object setTemperature 373; // In Kelvin ( about 100 degrees Celsius ) _objectTemperature = temperature _object; // Get the current temperature of the object: 373 (K)
  15. I wasn't aware there were such a thread.. Where would one look for such a thread?
  16. That would be great to have as a command. Something like "object setTemperature 373;". (In Kelvin, of course)
  17. Okay, I can only speak for myself and have had helicopters pick up stuff in many cases, this might help, you can try it in any case: _Pilot setSkill 1; _Pilot setBehaviour "SAFE"; _Pilot disableAI "AUTOCOMBAT"; _Pilot disableAI "CHECKVISIBLE"; I can add that when I first started with the AI slingload, they wouldn't pick up or drop off crates either, but then something clicked and it started working flawlessly, and I don't remember quite what it was I did.
  18. I have had great success with this, with it working all the time. _Waypoint = _Group addWaypoint [_container, 0]; _Waypoint setWaypointType "HOOK"; _Waypoint waypointAttachVehicle _container;
  19. This works for me 99%-100% of the time. I've also had problems with a not lifting correctly. _Waypoint = _Group addWaypoint [_container, 0]; _Waypoint setWaypointType "HOOK"; _Waypoint waypointAttachVehicle _container;
  20. Hello, Would like to get some optimization tips for this loop I have. It gives the enemy sides the possibility of reporting all enemy activity to their friends. It has already intensified my mission greatly, and I was wondering if there's something I can improve upon, as I would guess it's a bit of a performance hog. Anyway, here's the code: while {true} do { _allGroups = allGroups select {!(leader _x getVariable ["excludeZeus", false])}; { _group = _x; _allUnits = allUnits select {(side _group) != (side _x) AND (side _group) knowsAbout _x > 1}; { _group reveal [_x, 1.6]; Sleep 1; true } count _allUnits; true } count _allGroups; Sleep random [2, 4, 8]; };
  21. Yeah, well it works in tandem with another function that creates waypoints for groups based on the nearest targets. It makes the mission much more unpredictable.
  22. I need to activate a players thermal vision (via the APEX goggles) but I can't seem to find out how. player action ["NVGoggles", player] I tried this but that only starts the night vision and not the thermal (even when executed twice). Thanks.
  23. Fiddi

    Unit CMDR Briefing

    Personally, I would have done it this way (for perspective's sake): In commanders init: nul = this spawn { sleep 10; [_this,"BRIEFING_POINT_TABLE"] call BIS_fnc_ambientAnim; };
  24. What I've been able to figure out is that is has to do with the " factions[] " Array inside "class textureSources" of each vehicle. Meaning that, for example, the strider which is a AAF vehicle doesn't show the Nato factions texture. If you empty that array so that is has no faction attached it works as it should. Hope that makes sense.
  25. I play my mission with my friend, and we're getting fairly good performance. We do want to amp up our mission with more going on at the same time but are cautious with the performance impact. Right now my computer handles all the AI, which I presume brings down performance on both of our computers (feel free to correct me). So the question is, if I code it in a way that evenly splits the AI between us will it increase overall performance?
×