Jump to content

engima

Member
  • Content Count

    548
  • Joined

  • Last visited

  • Medals

Posts posted by engima


  1. y4mhZdbiUAJYvl__S2vdukVSKbucrh4saT2O3fp8

     

    Engima's Parked Vehicles v1.0

     

     

    Overview

    Engima's Parked Vehicles is a script that adds empty vehicles in garages and next to buildings across the map in an Arma 3 mission.

     

    Description

    To "complete" my Engima's Traffic script I have also created a general script to place empty vehicles near or in Buildings across a map. Vehicles are created when a player gets within spawn distance, and they are removed again (and remembered), when all players get beyond spawn radius. You can customize types of buildings and types of vehicles, spawn radius, and use callbacks for when vehicles spawn and despawn.

     

    For a vehicle to spawn in or outside a building there has to be a garage definition entry for that building in the file Engima\ParkedVehicles\GarageDefinitions.sqf. Garages and other buildings for islands Stratis, Altis, Malden and Tanoa are supported out of the box. Anyone can add more garage definitions when needed.

     

    Download

     

    Installation

    TypeSqf: Open the CPack Console and type "install Engima.ParkedVehicles".

    Manual: Copy the folder Engima and the file initserver.sqf to the root of your mission. (If you already have the initserver.sqf file in your mission, copy the content from my file into yours).

     

    Usage

    Configure/Customize the script by altering the parameter list for the main function call.

     

    File "Engima\ParkedVehicles\ConfigAndStart":

    // Set custom parameters here private
    _parameters = [
        ["BUILDING_TYPES", ["Land_FuelStation_02_workshop_F","Land_GarageShelter_01_F", "Land_FuelStation_01_shop_F", ...]],
        ["VEHICLE_CLASSES", ["C_Offroad_01_F", "C_Offroad_01_repair_F", "C_Quadbike_01_F]],
        ["SPAWN_RADIUS", 750],
        ["PROBABILITY_OF_PRESENCE", 1],
        ["ON_VEHICLE_CREATED", {}],
        ["ON_VEHICLE_REMOVING", {}],
        ["DEBUG", false] ];
     
    // Run script
    _parameters call PARKEDVEHICLES_PlaceVehiclesOnMap;

    Script can also be extended to contain support for more garages/buildings. This may be important if you want to use the script on maps for which the default package was not intended. In that case you want to add building definitions to the file "Engima\ParkedVehicles\GarageDefinitions".

     

    Vehicles for building classes that do not exist as a building definition will not be spawned.

     

    Licence

    MIT.

     

    Version History

    Version 1.0

    -First version.

     

    Other releases

    Engima's Traffic (script)

    Engima's Civilians (script)

    Escape Tanoa (mission)

     

    • Like 6
    • Thanks 3

  2. New version.

     

    Version 2.1
    -Mission parameters are now saved in profile, and reused by default.
    -Removed error message about missing image Escape.jpg.
    -Lowered the number of armed and heavy armored vehicles in general traffic.
    -Added more possible locations for comcenters.
    -Fixed: Removed some vehicles that required the Laws of war DLC.
    -Fixed: Too few enemy ambient infantry in the woods.
    -Fixed: Script error when hijacking comcenter.

     

    • Like 3
    • Thanks 1

  3. 20 hours ago, Larrow said:
      Reveal hidden contents
    
    
    _heliPos = attackPos getPos[ 1000 + random 300, random 360 ];
    _heliDir = _heliPos getDir attackPos;
    
    [ _heliPos, _heliDir, "B_Heli_Light_01_F", resistance ] call BIS_fnc_spawnVehicle params[ "_heli", "", "_heliGrp" ];
    _heliGrp deleteGroupWhenEmpty true;
    _heli flyInHeight 40;
    
    _shooters = [ [0,0,100], resistance, 6 ] call BIS_fnc_spawnGroup;
    {
    	_x assignAsCargo _heli;
    	_x moveInCargo _heli;
    	[ _x, 'Sniper' ] execVM 'loadouts.sqf';
    }forEach units _shooters;
    units _shooters joinSilent _heliGrp;
    
    sleep (10 + random 20);
     
    _heliWaypoint = _heliGrp addWaypoint[ attackPos, 10 ]; //Removed index, waypoint is just added to the end of the groups waypoints instead
    
    _heliWaypoint setWaypointType "LOITER";
    _heliWaypoint setWaypointLoiterType "CIRCLE";
    _heliWaypoint setWaypointLoiterRadius 200;
    _heliWaypoint setWaypointSpeed "LIMITED";
    _heliWaypoint setWaypointBehaviour "COMBAT";
    _heliWaypoint setWaypointCombatMode "RED";
    
    _heliGrp setCurrentWaypoint _heliWaypoint; //Sets the created waypoint as the current

     

    Removed all the unnecessary stuff, simpleObject, createVehicleCrew etc. Used alternative syntax of some commands to do the same thing, SHK_pos, getRelDIr etc.

     

    Never use index 0 for waypoints. Index 0 is not the same as waypoint 0 in the editor. Index 0 is the position the group was spawned at, and is set by the engine when spawning. Waypoint 0 is in fact index 1.

    The above code works, but if you change the waypoint creation back to index 0 the heli will buzz past the waypoint position and head off the map.

     

    I didn’t know that. So in general, if you have a group with waypoints and deletes them all the way down to index 0, what will happen? I expect nothing, but apperently something can get wrong. Will the Arma engine get confused? Obviously in this case...?


  4. On 11/9/2019 at 8:05 AM, .kju said:

    kudos and thanks for sharing once again @engima!

     

    whats involved to port to other terrains and/or other mod (units/vehicles)?

     

    Since Escape Chernarus for Arma 2 there is "some" support for porting it to different islands. However I'm working on exactly that, and I already have a playable but not ready for release version of Escape Altis that I have played for test with friends. I'm planning on releasing that later, and at the sime time make the mission as easy as possible to port. If you want to port this very mission I then recommend to wait for Escape Altis.

    • Like 3
    • Thanks 1

  5. 2 hours ago, dreadpirate said:

    @engima This is what I tried...... 

     

    The driver is being replaced as I want, but when the vehicle leaves the spawn radius, only the vehicle is deleted and the civilian is either killed or severely injured as the car disappears from under him.....

     

    Ok, sorry. Try removing him in ON_UNIT_REMOVING then, which is executed right before the vehicle is removed.

    • Thanks 1

  6. 3 hours ago, dreadpirate said:

    @engima Would it be possible to define an array of possible drivers as well as possible vehicles?

     

    It would be great for people using modded civilians and vehicles to mix and match what spawns.

     

    Yes, possible vehicles is an array that goes into the start parameter set as VEHICLES. And the default driver can be replaced using the ON_UNIT_CREATED callback (called after unit has been created).

     

    And if you want some more control over spawned vehicle classes other than pure random, or number of vehicles during certain times of the day etc, use callback ON_UNIT_SPAWNING (called right before a unit is created).


  7. 3 hours ago, avibird 1 said:

    @engima Let me ask you then if there is a OR command then why can't I setup a trigger with it for three objects for example radar tower and radio operator. These units objects link to reinforcements to the AO. If one is killed or destroyed then the trigger is set stop the reinforcements for that particular unit/object the trigger is set to repeat.

    If you expect repeat then there's a problem. It's not unsolvable, but maybe not the solution I'd chosen.

    If your condition is (!alive radar or !alive tower or !alive radio_operator), and radar, tower and radio_operator are variables for objects in the editor, then the condition will evaluate to true if one of them dies, thus the activation code (that sends reinforcement) is executed. However, the contition will need to be false again for the trigger to fire repeatedly, and that will not happen until all objects are intact again.

     

    3 hours ago, avibird 1 said:

    If I understand what you're saying the trigger needs to be then reset to false using code in the deactivation box of the trigger.  So the trigger can repeat if the other two unit or object is killed or destroyed. 

    Is this correct.  Then what is the OR command and how would I set up the deactivation code?

    No. The code in the deactivation box is simply executed when the condition goes from being evaluated to true to be evaluated to false (like the opposite of activation).

     

    3 hours ago, avibird 1 said:

    Question how many Triggers are much for a mission? Some people suggest it is not the most efficient way of writing code using triggers and it will result in game lag. I've always used a lot of triggers in my missions. What I find causes more lag is multiple scripts/mod running in the mission over a large number of triggers in the mission.

    I don't know. I seldom use triggers. They are good since they are executing in unsceduled environment, which is much faster. On the other hand the code is not being kept together and command sleep won't work. From Arma 1.97 you can use command setTriggerInterval to slow down the condition check when you do not need to check all the time. And 100 scripts that mostly sleep is not a problem either. But of course, you should keep performance in the back of the head all the time. For exampel command waitUntil can be set to not check too often if you write waitUntil { sleep 10; my_condition };.

    • Like 2
    • Thanks 1

  8. Of course there is an OR command. But you seem to have misunderstood triggers. A trigger is checking the condition over and over (every half second by default). When the condition evaluates to true the activation will execute.

     

    If trigger is set to repeat, than the condition will need to evaluate to false sometimes after first activation to be able to activate again, which will not happen in the approach you are suggesting. (When trigger condition goes from true to false is when the deactivation code is executed.)

    • Like 2

  9. y4mXXOy00H1m1oe6kPhBnv6-lWTbclDwpeBPEso5

     

    Escape Tanoa by Engima 2.22

    Description

    Finally! Seven years ago I publiched Arma's first Escape mission - Escape Chernarus for Arma 2. I was very glad to see the response then. There were several servers online all the time during the first year, and now, after some years with Arma 3 it has spread in so many versions for every possible Island, and is running on so many servers all the time!

     

    I have tried a few of the missions, and I'm very careful not saying that other's Escape missions are not good enough, because I'm really impressed in how the genre has developed. But you also get a feeling for a mission, and this one might be a release for anyone who wants a little nostagy. You could call it something like "Original Escape with the Engima feeling", since its origin is the very same code base as my first Escape Chernarus for Arma 2. I have fixed it a little though. There are new units, and some of the script commands work differently in Arma 3 compared to Arma 2. But my focus has been to create a robust and fully working and exciting rework of the mission.

     

    Mission is 100% dynamic and uses the entire map. Play it 100 times, two games will not be the same!

     

    Plot

    CTRG Group 11 is deployed at Tanoa to gather intel about the situation prior to the arrival of NATO. However, finding themselves in a much more hostile environment than expected, they are captured by a Syndicat force suspisious about their intentions. Group 11 is unarmed and put in a temporary built prison while awaiting further interrogation. Take the first opportunity to escape the prison and find a way to rendezvous with NATO forces.

     

    Download

     

    Please note that the different missions have different requirements. See Requirements below for more information.


    Features

    • CO 08 Revive (recommended for 2-8 players).
    • Uses entire map.
    • Dynamic and living environment.
    • True random start position. Game develops differently every time, inferring great replayability.
    • Options for enemy skill, enemy frequency, weather and time of day.
    • Supports hosted and dedicated (recommended) server and is JIP compatible.

     

    A small hint for best experience

    Escape Tanoa is best played at difficulty level Veteran or Expert (since the mission's story is based on the idea that you are lost, and you do not want too much help with navigation from the game).

     

    Installation

    Manually downloaded: put the .pbo-file in your MPMissions folder in the Arma 3 game folder.

     

    Requirements

    • Arma 3
    • Apex DLC (official)

     

    Escape Chernarus requires the two mods: "CUP Terrains Core" and "CUP Terrains Maps" to work (since Chernarus is not part of original Arma 3). For more information, follow the Steam Workshop link.

     

    Media

    Remember this?

     


    Code

    Code at Github

     

    Licence

    MIT. You are free to do what you want with the code, but references to my name (Engima) must follow in the license text. I have also made an addition that disallows you use the text "Original Escape Branch" when releasing an Escape mission.

     

    Change log

    v2.22

    • Performance improvement.
    • Added enemy insertion chopper.

     

    v2.2

    • Added more possible communication center positions.
    • Made the mission easier to migrate to other islands.
    • Fixed: Player slots disappears when player leaves game and comes back.
    • Fixed: Rearranged some populated areas.
    • Fixed: Rendesvouz task not updated upon mission complete.

     

    v2.1

    • Mission parameters are now saved in profile, and reused by default.
    • Removed error message about missing image Escape.jpg.
    • Lowered the number of armed and heavy armored vehicles in general traffic.
    • Added more possible locations for comcenters.
    • Fixed: Removed some vehicles that required the Laws of war DLC.
    • Fixed: Too few enemy ambient infantry in the woods.
    • Fixed: Script error when hijacking comcenter.

     

    v2.0

    • New Game version (Arma 3) and, new Island (Tanoa), and new units.
    • Lessened the amount of enemy units somewhat, decreasing the difficulty a bit (original version got some critique for being too hard)
    • JIP players now respawn dead and need to be revived.
    • Patrolling enemy units are smarter.

     

    v1.8

    • Reduced enemy armor on all difficulty levels.
    • Reduced amount of weapons at ammo depots.
    • Increased amount of possible weapon types at ammo depots.
    • Weapons may show up in civilian cars.
    • Road blocks are more passive.
    • Fixed: Paradrops do not fall free and crash onto the ground anymore.

     

    v1.72

    • Fixed bug: Server lagging.
    • Reduced time it takes to hijack a communication center.

     

    v1.7

    • Fixed the start bug (player do not wake up dead anymore)
    • Increased the time it takes to hijack a communication center, and FAC Operators do it faster than the others.
    • Added field hospital at communication centers.
    • Added things that you don't want me to tell you about.
    • Fixed bug that made enemies surrender.
    • Fixed bug that made player's vehicles suddenly disappear.
    • Made it much easier to port to another map.
    • A lot of fixes and improvements (for complete list, see ReadMe.txt in installation pack).

     

    v1.5

    • Changed player units to Razor Team.
    • Communication centers now appear randomly.
    • Added things that you don't want me to tell you about.
    • Removed debug information that was left accidently.
    • A lot of fixes and improvements.

     

    v1.1

    • Fixed bug at mission start (players could start mission dead etcetera).
    • Fixed bug regarding parameter "Enemy frequency". Enemy armor is now also in relation to this option.
    • Made the insurgents invest in night vision goggles.
    • Removed the parameter "Number of revives" (since "Unlimited" is the only option relevant for this mission).

     

    v1.0

    • First version

     

    Credits & Thanks

    • Tophe, Milton, Tobias, Alex, Robbi, Josef, Jaxmen, Samue, JavaDrinker, guccilane for beta testing!
    • Tophe an extra time for composing music for the trailer!
    • NeoArmageddon and Scruffy for spreading mission to many islands.
    • BIS Forum members for help during scripting headaches!
    • Bohemia for a fantastic game!

     

    My Other Missions

     

    • Like 4
    • Thanks 4

  10. On 9/12/2019 at 12:38 AM, JD Wang said:

    Back again, and before I ask I have to say again thank you for this script. Hands down the best traffic script for ARMA.

    Just curious if it could be expanded to include parked cars on the side of the road and/or outside houses etc?

    That's the one thing I miss at the moment when creating long term persistent missions is cars parked up.

    I guess the biggest issue would be if you spawned vehicles and the despawned them when the player left the area, when they come back how do you ensure the same vehicle spawns again?
    Maybe even just spawn them all over the map and enable dynamic sim?
     

     

    @JD Wang

    I needed what you asked for myself. Check out my new Engima's Parked Vehicles script:

    http://typesqf.no-ip.org/cpack/details/Engima.ParkedVehicles

     

    • Like 3
    • Thanks 1

  11. Thanks. Glad you like it.

     

    1. setTriggerInterval sounds nice. That should be an easy fix. But I give no promises for  when you got it.

     

    2. Script does not ”remember” if units are killed or not, and therefore I do not delete the trigger. If you leave and come back there will be new units patrolling. I understand that people may want both, and actually I’m in need of that feature myself, so I might add that parameter too.

     

    3. Yes, that is possible. You do it by configuring and starting two instances of the script, each with its own parameter set. Look for ”instance” in the documentation.

     

    4. Again, see 2 above. Probability of presence is checked each time you enter inside the marker.


  12. I did a little more testing.

     

    First with a simple init.sqf file like this:

     

    init.sqf:

    waitUntil { !isNull player };
     
    hint "First";
    sleep 10;
    hint "Second";
    sleep 3;
    hint "Third";
    sleep 3;
    hint "Fourth";

     

    The first sleep (sleep 10) was simply ignored (for the JIP). The rest of the sleep commands worked as expected.

     

    I did the same thing, but put the hints and sleeps in another file, and started it with execVM. But the result was the same. First sleep was ignored.

     

    I did the first thing, but put the code in initPlayerLocal.sqf instead (which would be a bit of a better practice). The same result.

     

    Then I put an action on a coffee table in game and started the hint-sleep sequence on an action (putting an addAction in the init.sqf). This worked as expected for both hosted server's player and JIP.

     

    Then I tried to replace the sleep with a waitUntil like this:

     

    init.sqf:

    waitUntil { !isNull player };
    
    private _jipEnteredTime = serverTime;
    
    hint "First";
    waitUntil { serverTime > _jipEnteredTime + 10 };
    hint "Second";
    sleep 3;
    hint "Third";
    sleep 3;
    hint "Fourth";

     

    This worked as expected, so for some reason only the first sleep command was a problem.

     

    Conclusion:

    First sleep command for a JIP seems to be ignored if hit during the initialization phase. My guess would be that there is something scheculish thing that has not yet been initialized properly, so to be able to trust the sleep command one should not use it until a few seconds into the mission. Use of sleep in init files should really work, but actually I have never regarded it as best practice. A suggestion to a solution or workaround (if not Boehmia fixes this) would be to only use init files for initializations, and not running code. Init could contain a waitUntil a few seconds so that everything stabilizes and initializes, and the the running code can be started (like execVM "start.sqf").


  13. Ok, I have news. This looked interesting, so I gave it a real try, with two licences, a hosted server and a JIP.

     

    First I can confirm that it really is the sleep command that does not do its job. I actually narrowed it down to these three lines in the init file:

     

    init.sqf:

      hint "Waiting 120 seconds..."; systemChat "Waiting 120 seconds...";
      sleep 120;
      hint "I'm disabling the teleport."; systemChat "I'm disabling the teleport.";
    
    

     

    And sleep still does not work for the JIP!

     

    An what is more is that the mission gets really wierd after that. After leaving game for the lobby, only one slot is visible (I had two from the begining). And if I then leave the server it is impossible to get in again.

     

    There was a small update today. Maybe sleep for JIPs got broken...?

     

    EDIT: I forgot - actually uiSleep seemed to work for the delay part. But the problems I described with the mission slots remained.

    • Like 1
×