Jump to content

theVestarr

Member
  • Content Count

    18
  • Joined

  • Last visited

  • Medals

Posts posted by theVestarr


  1. Hey all,
    Some of you might have heard or seen the project that me and my team - Project Orion - have been working on. Just came by to showcase it and highlight a small issue that we and many other developers, who create these high-fidelity mods for ARMA.

    You see - one of the issues we're facing is the limit of the MFD Values that we can display on the screens, which is quite relevant when your vehicle heavily relies on the information and inputs in the cockpit. The current limit is 50 - that is 50 "text" values and 50 numeric values that we can pass from our scripts to the aircraft itself. And that aint much.

    If you want to show 5 waypoints on the tactical map in your MFD, you need to waste at least 10 of the MFD values (x and y coordinates, times 5). Every further custom information that I might want to pass to be displayed, takes another one of these slots. And the list piles up, our budget of 50 gets depleted very very fast.
    I don't really want to get into details of it, but I hope you can see that this is not a very big budget for our needs. And that's something that affects me and my team, the Hatchet Team (the guys who made the interactible UH-60), and the Apache Project.
    We raised a ticket in Bohemia feedback, it's been open for a year. Perhaps we could encourage Bohemia Interactive to increase the limit as a community, when this ticket gets more attention? T159957 Increase MFD Value/Text limits (bistudio.com)

    Anyways, for the fun part, here's some screenshots from the WIP -more frequently updated on Project Orion's discord: https://discord.gg/wCUqFxs
    ENGINE_FFFOOOUR.PNG
    2.PNG?width=1208&height=671
    V2.png?width=1351&height=671
    unknown.png?width=1056&height=671
    received_696029145067024.jpeg?width=1193
    unknown.png?width=1193&height=671
    unknown.png?width=1095&height=671

    • Like 7
    • Thanks 1

  2. BettIR - IR Improvement for ARMA (Alpha Release)

    Downloadhttps://steamcommunity.com/sharedfiles/filedetails/?id=2260572637

    Also, if you liked my work and would like to see more - feel free to support me on my Patreon:
    https://www.patreon.com/vestarr

     

    A1301C74C8AC992EBC8A4BD771D43EB8C21F3EBC

     

    6D05FA367F0117C261FFB66901D5C7389913F8B5

     

    768067B41963E63E5B35A22CAC3D316AB40F9E71

     

    9A1B6AC5283C028D17A0C5A89053D53D2DFBEF9D


    Arma is a great game, but there's one thing it could never do - IR illumination. There's a lot of great things that only work in IR Spectrum, but ESPECIALLY in ACE mod, if it's dark - you're doomed.
    In real life, you would normally use IR illuminators for that purpose. They emit a bit of IR light to help you see stuff around you. A lot of known Night Vision Goggles have them built in; you can also find these lights in AN/PEQ-15 boxes and other weapon-mounted light combos.
    Unfortunately, Arma doesn't natively support such thing. However, with a bit of scripting (and magic) we can make anything work right?

    The mod currently only involves:
    - NVG-mounted IR lights (compatible with particular NVGs only)
    - Weapon-mounted IR lights (e.g. vanilla IR laser pointer is enough to use this functionality)
    - Compatible with Vanilla NVG's and IR pointers
    - Compatible with most RHS NVG's and IR pointers
    - Compatible with most CUP NVG's and IR pointers
    - Compatible with most USP NVG's
    - Allows you to use your laser along with the IR illuminator
    - Multiplayer Compatible!
    - Configurable keybinds to toggle the both lights (Ctrl + Alt + L and Ctrl + Alt + N by default)
    - Adjustable viewdistance
    - Tested with 66 AI actors with their illuminators on with minor FPS impact
    - Easily Extendible - see "For Developers" section below

    To be added soon:
    - Weapon-specific offsets for better approximation of the position of the light source
    - IR Patches
    - IR-only textures
    - Weapon-mounted illuminators
    - AI using it and reacting to it
    - Reorganizing the code architecture

    Known bugs:
    - Laggy in vehicles, potential fix in the pipeline
    - Position of the lights is approximated and might not be perfectly lined up to the actual position of the light source; will not fix (unless there's a method to fix it)

    Spoiler

    For Developers

    Adding more gun attachments to work with it

    You can make this mod compatible with other attachments/nvg's from different mods fairly easy with configs.
    First of all, add the BettIR_Core to the requiredAddons. Then you add your NVG classes to the config.cpp as follows:
     

    
    class BettIR_Config
    {
        class CompatibleNightvisionGoggles
        {
             class mymods_NVGs_className
             {
                  offset[] = {0.1, 0.15,0.3};
             };
        };
        class CompatibleAttachments
        {
            class mymods_some_gunAttachment
            {
                 offset[] = {0.15,0.22,0.25};
             };
        };
    };

    You can also inherit from classes that are already in place: __base_NVG, __base_Monocular, __base_topRailPointer, __base_rightSiderailPointer

    Forcing AI to use it
    Currently this mod isn't very AI-friendly, i.e. it doesn't have any impact on their behaviour. However, there are two functions that you can call which can turn on their lights as well.
    Before you run them however, you need to make sure that the unit is wearing the NVG's currently and has them actually switched on.
     

    
    [this] call BettIR_fnc_nvgIlluminatorOn;
    
    // OR 
    
    [this] call BettIR_fnc_weaponIlluminatorOn;

     



     

    Credits
     

    Ulfgaar - for giving me the idea to do the IR patches, which then spiraled out of control and became much more than that; for exchanging a lot of information about the real life technology and helping me understand it much more
    Dslyecxi - for feedback and Nightvision-related consultation
    OneLittleSociopath - for helping me figure out some of the optimalization concerns
    TheVache & Somedudechen - for helping me test this mod

    Disclaimer
    This mod doesn't change the color of the NVG's as the screenshots suggest! I used a wonderful NVG mod by Apricot to take nicer preview screenshots. You can find it here: https://steamcommunity.com/sharedfiles/filedetails/?id=1908374667


    Licensing information can be found in the steam workshop link, to be updated soon.

    Contributions/suggestions welcome!

    • Like 11
    • Thanks 3

  3. Hi all,
    I've run into a small problem today.
    I wanted to set up some custom textures and a material in my mission and do some magic with it with scripting. I wanted to use the Super Shader but the game won't let . me

    The main problem is just the paths to the textures/maps in the rvmat. It's easy in the Addon editing, but how can I make the texture paths relative to the mission? I'm just getting an error that it could not load the texture.

     

    Code:

    class Stage1
    {
        texture="data\textues\scorpion_nohq.paa";
        uvSource="tex";
    };

     

    I have the "data" folder in my mission root and the path is as follows above. File exists and it's not corrupted I guess - TexView2 sees it properly. I tried changing the path to e.g. textureTest.lingor3\data\... or using __FILE__ but no joy either.

    Could anyone shed some light on that please?

    Thanks!


  4. On 7/16/2020 at 7:45 PM, reyhard said:

    this simulation type doesn't support cargo action, try any vehicle with cargo (Car/CarX/Tank/TankX/Helicopter/etc.) . You can read about various vehicle properties over there

     

    Makes sense, good to know that for the future.

     

    On 7/16/2020 at 7:45 PM, reyhard said:

    They are assigned to selections which then are animated by model.cfg

    https://community.bistudio.com/wiki/Model_Config

     

    Yeah I know - I've configured my Model.cfg this way and the animations worked fine, but I was confused by the Geometry LOD itself. It's the only LOD (as far as I know at least) that must have components named Component01, Component02 etc. from what I know, and I just don't understand how geometry LOD knows which selections it corresponds to in the Resolution LOD, because the name of the selection is not an option in that case. I take it that the selections in the Geometry LOD must be in the same order as in the Resolution LODs and that's how it knows?


  5. Hello everyone,

    I'd like to ask for some help with an addon that I've been working on. 

    I have to mention that it's a bit heartbreaking to me personally - I've spent my last month preparing it and learning a lot of new things only so that I can submit it for the "Art of War" contest, and so that people could enjoy this asset in their scenarios in the base game.

     

    Sadly, I've run into too many issues and didn't manage to finish it on time, but figured I'll at least learn from it, maybe I'll just release it to the workshop as a mod at some point.

     

    Basically, I've made a casket model.

    Just to showcase quickly what I'm talking about:

    20200714222644_1.jpg?width=1665&height=9

    20200714205425_1.jpg?width=1665&height=9

    unknown.png

     

    As you can see, I've put an awful amount of work to make all the details I wanted (also, poly count is like 3k on 0.00 resolution LOD so don't worry about all them creases).

     

    The casket spawns properly (apart from minor issues with tweaking the rvmat's specularity/smoothness) and looks rather nice. My actions which were supposed to open the door also work. 

    However, I didn't want to make it just a static map asset - I wanted to give this casket a "cargo", so that you can place units inside - either for funeral scenes, or for scenarios involving sneaking people in coffins. This, I didn't manage to get to work.

    So first of all, to achieve this I made a custom player animation:

    unknown.png

     

    Which worked well in the animation viewer, but when I loaded the mod and tried doing literally anything in the game, the whole animation cycle was broken.

    I was even following a tutorial on how to place custom cargo animations in the game, but somehow, for me, it wouldn't work of course.

    The result was - characters being stuck in T-pose halfway through the ground, civillians running sideways when asked to go forward, also T-Pose when interacting with Inventory. Here's the config.

     

    class CfgMovesBasic
    {
        class Actions;
        class DefaultDie;
        class ManActions
        {
            CasketCargo = "CasketCargo";
        };
    };
    
    class CfgMovesMaleSdr : CfgMovesBasic
    {
        class States
        {
            class Crew;
    
            class CasketCargo_dead : DefaultDie
            {
                file = "\casket\anim\CasketCargo.rtm";
            };
    
            class CasketCargo : Crew
            {
                file = "\casket\anim\CasketCargo.rtm";
                interpolateTo[] = {"CasketCargo_dead",1};
            };
        };
    };

    Any idea what went wrong here?

    I've tried to edit this configuration in a thousand different ways too, none of them worked.

     

    I also gave the casket some "transport cargo" so that you can transport items inside, which could be also quite useful for some scenarios, and thankfully that worked well, at least.

    Here is the config for the casket itself:

     

    class CfgVehicles
    {
        class Thing;
    
        class Casket_Base : Thing
        {
            displayName = "Casket";
            author = "Vestarr";
            scope = 0;
            cost = 0;
            weight = 60;
    
            simulation = "thing";
            mapSize = 0.9;
            accuracy = 1;
            destrType = "DestructNo";
            waterLeakiness = 0.1;
    
            maximumLoad = 500;
            transportSoldier = 1;
            transportMaxWeapons = 5;
            transportMaxMagazines = 10;
    
            cargoAction[] = {"CasketCargo"};
            cargoIsCoDriver[] = {0};
            castCargoShadow = 1;
            hideWeaponsCargo = 1; 
    
            cargoCanEject = 0;
            memoryPointsGetInCargo = "cargo_action";
            memoryPointSupply = "cargo_action";
            supplyRadius = 2;
            side = 4;
            vehicleClass = "Objects";
            maxSpeed = 0;
    
            class UserActions 
            {
                class OpenTorsoDoor
                {
                    displayName = "Open Torso Door";
                    position = "cargo_action";
                    radius = 3;
                    onlyForPlayer = 0;
                    condition = "true";
                    statement = "this animateSource [""open_torso_door"", 1]";
                };
    
                class OpenLegsDoor
                {
                    displayName = "Open Legs Door";
                    position = "cargo_action";
                    radius = 3;
                    onlyForPlayer = 0;
                    condition = "true";
                    statement = "this animateSource [""open_legs_door"", 1]";
                };
            };
        };
    
        class Wooden_Casket : Casket_Base
        {
            displayName = "Wooden Casket (Openable)";
            scope = 2;
            model = "\casket\model\casket_wood_openable.p3d";
        };
    };

     

    I tried experimenting with other Base Classes as well - Car, LandVehicle, etc. but none of them worked. In fact, LandVehicle and Car complained about "submerged" properties missing which I initially added but then abandoned the idea since it just kept giving me more errors about other missing properties. 

    I tried the Car/LandVehicle base class because I thought that maybe it has to inherit from a proper vehicle class to even enable the "Get In Cargo" functionality. 

     

    From the model perspective, I do have a "cargo_action" point in my Memory LOD, and the 0.00 resolution LOD also contains a cargo proxy.

     

    So, my question here I guess is - what went wrong? How can I do it properly in the future? How to avoid doing mistakes like this?

    As I mentioned - I'm still learning so all this is very new to me, but so far I couldn't find answers to a lot of problems that I found on the way, documentation didn't clarify a lot of things either. I know that there is a ton of community tutorials but how do I know which one provide the knowledge I need? Which ones are legit? They are usually very long and cover very particular examples and it's also very hard to pick the information that I need to learn from them... So if there's anything useful I could do for homework, please let me know.

     

    Also, if someone would be so kind to explain one thing to me:
    How does Geometry LOD know which Components should move during animations? Is there any particular way of assigning them to the components in the resolution LODs? It's been bugging me yesterday a bit but didn't get around to test it.

     

    Thanks in advance.


  6. Hey all,

    Me and my friend are currently working on some edits to the Pandur vehicle from ARMA 3, we wanted to add some variants such as a commander and medical vehicles. 

    My bud managed to make the medical variant with hidden selections and retrexturing the vehicle, which wasn't that hard. However, a commander vehicle is a bit more complicated case since we'd like to at least put some sort of Remote Controlled Weapon Station on top of it. Now, I understand it involves a bit of modelling, I've been playing with this for long enough, but I'm wondering if there's any way we can prepare a separate model file of this RCWS and somehow bind it to the vehicle with config so that it spawns and stays in that position at all times?

    It seems that the Pandur is binarized so editing the original p3d is not really an option here; we have to find a way to work around this and I'm just curious if it's possible to have a vehicle which is built from more than one P3D.

     

    I'll be very grateful for all suggestions.

    Thanks!


  7. Hi all,

    I've recently taken my first steps in arma modding and have successfully created an object in blender, added textures and materials, imported to the game etc etc. Consists of 7 components and 4 different textures. I'm attaching a picture of it below:

    20200312195139_1.jpg?width=1227&height=6

    It's basically an airport taxiway direction sign, for immersion. These 3 "displays" with letters on them are their own components in the custom LOD (display_L, display_M, display_R) and have an emissive material applied to them (no texture in the material), which works pretty great. However, I would like to be able to switch the textures on those displays with scripting (setObjectTexture command), and I''ve been trying to use hiddenSections for that with no luck so far. 

     

    When I run getObjectTextures on the object, it returns the ones that are set in the config.
    If I run setObjectTexture and then getObjectTextures, it gets updated, but nothing changes on the model.

     

    Model has these 7 components and display_L, display_M and display_R have the same textures assigned to them in the object editor as the ones mentioned in the config.

     

    Here's my configs:

    model.cfg

    class CfgModels
    {
        class Default 
        {
            skeletonName = "";
            sectionsInherit = "";
            sections[] = {};
        };
    
        class VAP_DTD_SIGN : Default 
        {
            skeletonName = "VAP_DTD_SIGN_Skeleton";
    
            sections[] = {
                "body",
                "display_L",
                "display_M",
                "display_R",
                "Leg1",
                "Leg2",
                "Leg3"
            };
        };
    };
    
    class CfgSkeletons {
        class Default 
        {
            isDiscrete = 1;
            skeletonInherit = "";
            skeletonBones[] = {};
        };
    
        class VAP_DTD_SIGN_Skeleton : Default 
        {
    	    skeletonBones[] = {
                "display_L", "",
                "display_M", "",
                "display_R", ""
            };
        };
    };


    config.cpp

    class CfgPatches
    {
    	class VESTARR_AIRPORT_PROPS
    	{
    		requiredAddons[] = {"A3_Structures_F"};
            name = "Name";
    		author = "Vestarr";
    		url = "";
    		requiredVersion = 0.1;
    		units[] = {"VAP_DTD_SIGN"};
    		weapons[] = {};
    	};
    };
    
    class CfgVehicles {
        class Thing;
    
        class VAP_DTD_SIGN : Thing {
            displayName = "D-T-D Taxiway Sign";
            author = "Vestarr";
            editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa";
            scope = 2;
    
            mapSize = 0.9;
            accuracy = 1;
            destrType = "DestructNo";
    
            model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d";
            hiddenSelections[] = {"display_L","display_M","display_R"};
            hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa", "\airportshit\data\common\textures\taxiway_mark_a_ca.paa", "\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa"};
        };
    };


    Also my material, in case it matters:
     

    ambient[]={1,1,1,1};
    diffuse[]={1,1,1,1};
    forcedDiffuse[]={0,0,0,1};
    emmisive[]={100, 80, 28,0.2};
    specular[]={0,0,0};
    specularPower=2;
    
    PixelShaderID="Normal";
    VertexShaderID="Basic";

     

    Can anyone shed some light how does this thing work and how to use it properly? I'm really confused.


  8. EDIT: I'll move it to a new topic as it's already kinda out of scope of the question.

    So - quick update.

    After a long research and hundreds of attempts, I've gotten somewhere.
    Finally my model is showing in game, has correct textures, even managed to get the material to be emissive and it's looking good so far.

    However, I still can't get this setObjectTexture thing to work.
    I'm still not sure if I understand sections/hiddenSelections. I've got a few components in my LOD (it's a low poly model so I use one resolution LOD). Here's my model.cfg:
     

    class CfgModels
    {
        class Default 
        {
            skeletonName = "";
            sectionsInherit = "";
            sections[] = {};
        };
    
        class VAP_DTD_SIGN : Default 
        {
            sections[] = {
                "body",
                "display_L",
                "display_M",
                "display_R",
                "Leg1",
                "Leg2",
                "Leg3"
            };
        };
    };
    

    these sections correspond to my Component names in the model.

    Now my CfgVehicles for this object goes like this:

    class CfgVehicles {
        class Thing;
    
        class VAP_DTD_SIGN : Thing {
            displayName = "D-T-D Taxiway Sign";
            author = "Vestarr";
            editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa";
            scope = 2;
    
            mapSize = 0.9;
            accuracy = 1;
            destrType = "DestructNo";
    
            model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d";
            hiddenSelections[] = {"display_L","display_M","display_R"};
            hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9.paa", "\airportshit\data\common\textures\taxiway_mark_a.paa", "\airportshit\data\common\textures\taxiway_dir_b_9.paa"};
        };
    };


    I assumed I'll be able to change these textures in-game with setObjectTexture but it doesn't happen. If I call getObjectTextures afterwards, it returns the updated textures, but it doesn't reflect it on the model, like it's not connected. Am I supposed to set no textures at all to that component in the object editor or something?

     

    Thanks for the help so far!


  9. So - quick update.

    After a long research and hundreds of attempts, I've gotten somewhere.
    Finally my model is showing in game, has correct textures, even managed to get the material to be emissive and it's looking good so far.

    However, I still can't get this setObjectTexture thing to work.
    I'm still not sure if I understand sections/hiddenSelections. I've got a few components in my LOD (it's a low poly model so I use one resolution LOD). Here's my model.cfg:
     

    class CfgModels
    {
        class Default 
        {
            skeletonName = "";
            sectionsInherit = "";
            sections[] = {};
        };
    
        class VAP_DTD_SIGN : Default 
        {
            sections[] = {
                "body",
                "display_L",
                "display_M",
                "display_R",
                "Leg1",
                "Leg2",
                "Leg3"
            };
        };
    };
    

    these sections correspond to my Component names in the model.

    Now my CfgVehicles for this object goes like this:

    class CfgVehicles {
        class Thing;
    
        class VAP_DTD_SIGN : Thing {
            displayName = "D-T-D Taxiway Sign";
            author = "Vestarr";
            editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa";
            scope = 2;
    
            mapSize = 0.9;
            accuracy = 1;
            destrType = "DestructNo";
    
            model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d";
            hiddenSelections[] = {"display_L","display_M","display_R"};
            hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9.paa", "\airportshit\data\common\textures\taxiway_mark_a.paa", "\airportshit\data\common\textures\taxiway_dir_b_9.paa"};
        };
    };


    I assumed I'll be able to change these textures in-game with setObjectTexture but it doesn't happen. If I call getObjectTextures afterwards, it returns the updated textures, but it doesn't reflect it on the model, like it's not connected. Am I supposed to set no textures at all to that component in the object editor or something?

     

    Thanks for the help so far!


  10. I'll use the textures, but thanks for that, I'll definitely need that in the future. 

    However, I'm really struggling with the configs, and both search and google didn't point me anywhere that was helpful, documentation didn't make much sense to me either. Could anyone point me in a direction how to understand some things here? 

     

    First of all, I've got the model - all exported from blender, textured (even normal and specular maps generated, I'll try to generate materials later), but I'm not sure how to configure both my material and model/mod in general. The object is supposed to be a static prop so I believe the config shouldn't be too hard, but samples don't have anything that simple if I'm not wrong. Also, my model components have 4 different textures, 2 of which I would like to control with setObjectTexture in the missions and stuff. Im confused what sections, hiddenSelections are and how to configure them to my needs. Could anyone shed some light on that? Also, can I use setObjectTexture when a component has a custom emissive shader, or is it one or the other? 

     

    Sorry for asking do many questions but I spent a day looking for answers and found nearly nothing. 


  11. Thanks for a quick response. 

    I'll check the samples and documentation. As you said, I don't have much experience with Arma modding itself so I'm kinda trying to find my way around it. I've done some game modding in general in the past and done some scripting for mission in arma though. 

     

    Also thanks for that example. It requires Contact DLC or am I wrong reading it?

    I gave it some thinking and I decided I'll use the texture approach, I'm just gonna write a script in node that will generate necessary letters on an image and save it. I'll also have to figure out how to make it setObjectTexture-friendly and it should be fine. 


  12. Hey all. 

    Apologies if I posted in a wrong section. 

     

    I'm getting into modding and I'm playing around with some different solutions. I was thinking about creating and releasing a mod soon. As a part of it however, I need to create a custom object that can draw a text (from its custom attributes) on its flat surface. I really want to avoid creating textures for every single digit and letter of the alphabet. I'm guessing it's possible, as even aircraft HUD's and dials can display current altitude and speed. I tried looking it up on the forums but I didn't find anything useful. 

     

    Obviously performance is key for me, so if there isn't any good way to solve it, I'm happy to do it with a ton of textures instead. The object is very unlikely to change its text mid-game because it's basically a specific, static sign, so I don't know if having each frame loop to update it is really necessary, unless it doesn't take too much power. 

     

    In case I need to use the textures approach, can anyone shed some light how to create an object that works with setObjectTexture? As mentioned earlier, I would like to provide some extra options in the eden editor's object's attributes to customise the sign's textures, is there a way of making it reflect its textures set in attributes in Eden after they've been changed? Is there a way of creating textures that glow in the dark, or otherwise having a light on an object that turns on at night and lights up the sign? 

     

    Thanks! 


  13.  

     

     

    Hello everyone!

     

    I've recently started my first very own A2:OA Dayz Epoch server. It's all going well and I'm loving it, so I was trying to make some improvements and learn SQF scripting. 

    I've found this mod on this forum some time ago: https://github.com/FullyGored/Cherno-Train-Service and I decided to implement it on my server. It really worked well. The only thing I didnt like about it, is the fact that the wagon is actually the Ikarius bus, so that the players can actuall get in (because normal wagons are not "proper" vehicles - you can get inside of it by climbing the ladder but you can't sit inside of it like you do in a car). It just looked silly to me and wasn't really immersive, so I decided to do something about it.

     

    So if you look at the Train_Start.sqf file, in line 32 it's actually spawning the Ikarius Bus. I replaced it with the wagon and added my custom init script to it.

    _wf = "Land_wagon_box" createVehicle _pos;
    _wf setVehicleInit "nul = this execVM ""scripts\Train\InitWagon.sqf"";";
    processInitCommands;

     

    which contains the following:

    _this addAction ["<t color='#FF0000'>Get on the train</t>", "scripts\Train\GetOn.sqf", [], 6, true, true, "","alive _target"];

    the GetOn.sqf just attaches the player to the wagon:

    _wagon = _this select 0;
    _action = _this select 2;
    
    player removeAction _action;
    player attachTo [_wagon, [1, -2, -0.85]];
    player setDir 270;
    
    player setVariable ["isOnTrain", true, true];

     

    So, here comes my first problem: why does the action menu disappear once the user is attached to an object?

    That would make the whole thing 10x easier, because I would just add an action to get off the train and the problem would be fixed.

     

    I tried many approaches, trying to detect key presses, etc. Basically I've been fighting with this script for 2 weeks time and gotten almost there. User can get on the train but can't get off.

     

    I tried doing this:

    I introduce a public variable on the top of the script after line 4:

    trainCurrentStation = "Berezino Start";
    publicVariable "trainCurrentStation";

    Then, on top, under line 19 I added all station names where the train stops (check _stops variable - it holds all rail names which should )

    _stopNames = ["Berezino Station", "Berezino", "Nizhnoye", "Solnichiy", "Solnichiy Factory", "Solnichiy Factory 2", "Kamyshovo", "Skalisty", "Elektrozavodsk", "Prigorodki", "Chernogorsk", "Balota", "Komarovo", "Kamenka"];

    So then, since the variables are not too descriptive, I figured I can add this piece of code to line 142 - to execute that code every train stop

    if (_i in _stops) then {
    	[_train] spawn _horn;
    	_currentStop = _stopNames select _b;
    	trainCurrentStation = _currentStop;
    	publicVariable "trainCurrentStation";
    };

     

    And then, I added a script for the clients to init.sqf which, I assumed, would listen to the changes in the trainCurrentStation variable and then react to it

    waitUntil { !(isNil "trainCurrentStation") };
    
    "trainCurrentStation" addPublicVariableEventHandler {
    	_station = _this select 1;
    	_isOnTrain = player getVariable "isOnTrain";
    
    	if (!isNil "_isOnTrain") then {
    		_hintText = format ["Thank you for choosing Cherno train services.\n Current station: %1 \n If you'd like to continue your journey, get back on the train.", _station];
    		titleText [_hintText, "PLAIN DOWN"];
    		detach player;
    
    		sleep .3;
    
    		player setVariable ["isOnTrain", nil, true];
    		player setVariable ["st_mh6_enhance_ffv_active",false];
    	};
    };

    I put into the init.sqf this way:

    if (!isDedicated) then {
    	// other DayZ init scripts
    
    	// init train scripts
    	execVM "scripts\Train\clientInit.sqf";
    
    	// other DayZ init scripts
    }

     

    But this script does basically nothing. No script errors in the console (I'm connecting with the -showScriptErrors parameter), players are still stuck on the train forever (or unless you abort and re-join the game).

    The script is getting executed though! I tested that and it runs, but just does nothing for some reason.

     

    Any clue what I'm doing wrong? Is there a better way of doing all this stuff? Any clue if I can find another workaround (or just enable the action menu when the player is attached to an object?).

     

    I was thinking on attaching the player and then forcing the player to sit down in the train and then wait for the change in his stance (if he gets up, then detach from the train) but I'm not quite sure how to do that.

     

    Sorry for the long post, hoping someone can help with it.

     

    • Like 1
×