Jump to content
smorency44

Script needed to enable players enter/exit cargo "only" when vehicle ramp is open.

Recommended Posts

Hello, scripting is not my strong point, is there a simple script I can use with my config to enable players to enter/exit the cargo space of my APC "only" when vehicle ramp is open.

 

here's some model.cfg info:

 

Quote

class rampdoor: HatchGunner
            {
                source="Ramp";
                selection="Ramp";
                axis="Ramp_axis";
                angle1="rad 100";
            };

           

 

I also have an animation used by players to open/close Ramp (Config.cpp):

 

Quote

class OpenRamp /// next version will have Ramp open option
            {
                displayName = "<t color='#56FD34'>Open Ramp</t>";
                position = "zamerny";
                onlyforplayer = 1;
                radius = 6;
                condition = "(this animationPhase ""rampdoor"" == 0) AND Alive(this) "/*AND Driver(this)"*/;
                statement = "this animate [""rampdoor"",1];";
            };
            class CloseRamp: OpenRamp
            {
                displayName = "<t color='#ff0000'>Close Ramp</t>";
                condition = "(this animationPhase ""rampdoor"" == 1) AND Alive(this) "/*AND Driver(this)"*/;
                statement = "this animate [""rampdoor"",0];";
            };

 

Thank you!

 

Steph

Share this post


Link to post
Share on other sites

Just an idea. I would try other way if I had an access to the model and its textures:
1. Make the APC walkable inside (add Roadway LOD for its floor nad the ramp) and adjust Geometry LOD accordingly so that players would be able to walk inside (you may also lift the ceiling part of the geometry a bit if required for stand up moving inside the vehicle). You would need to animate ramp selection in Roadway LOD as well through the same animation class from model.cfg that animates the ramp in Resolution and Geometry LODs.
2. Create CargoTurret for every single seat. You may even name those seats like "Seat front left" or "Seat #1" and go even further by texturing those seats with numbers so a player would be able to recognise which seat they would be sitting on

3. Make separate "memoryPointsGetInGunner" and "memoryPointsGetInGunnerDir" for every seat (within each CargoTurret definition)

4. Make separate "getInRadius" for every seat but such small enough that isn't accesible from outside of the vehicle (0.5-1.0m)

5. Obviously, having every cargo seat defined as "turret" will help in making it as FFV position if needed (isPersonTurret = 1; gunnerAction = "passenger_inside_1";)
This way is free of scripting (which I hate do, tbh).  People would have to actually go inside the vehicle when ramp's open to chose and take their seats. There are cons of that way tho - people could get out of the vehicle while it is moving (if "canEject=1") and get trapped inside its moving geometry which may result in injuries or death. There is also problem with people getting out in fast pace inside the confined space which may also lead to unexpected things. Another problem is emergency evacuation from fully or partialy submerged vehicle - swiming animation needs more space than you can find inside APC which also can lead to injuries or being stuck in geometry.  At least, the latter might be prevented by animating getIn/getOut mem points beyond the geometry of the vehicle in connection with "inWater" or "altSurface" animation sources - if feasible, but it will brake an immersion. It isn't error-free solution, unfortunately.
Being inspired by konyo's MH47 addon, I did it once for a large helicopter and it worked great in SP testing but never tested with AI and other players tho. So, you shouldn't expect 100% working solution with this path.

Share this post


Link to post
Share on other sites

Thank you for the well-explained reply, I have already created all 8 APC Cargo to FFV, so I will test the rest of your recommendations and get back to you... again, thank you very much for this!

 

SM

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, smorency44 said:

Thank you for the well-explained reply, I have already created all 8 APC Cargo to FFV, so I will test the rest of your recommendations and get back to you... again, thank you very much for this!


You're very welcome, mate! I am glad to be some sort of help and interested to see if it works for you. An APC isn't easy to configure this way due to typically cramped space in its passanger compartment, I guess.

Share this post


Link to post
Share on other sites

You're right, not easy to configure and sooo many people out there with similar issues and different solutions... Anyhow, so far, all cargo turret work and two of them are sentry (they can turn out), so for immersion, the inside view is amazing.  Now I will build a walkable inside by fixing both "roadway and Geometry", looking forward to the result 🙂

 

BTW, the vehicle I'm working on is a Canadian LAV6 that I purchased, it looks amazing and will be released on workshop within the Task Force Canada (TFC) Canadian Armed Forces mod pack.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you again Nightintruder, the vehicle works well and ready for Beta testing.  I wish there was a get-in/get-out animation that would keep the soldier crouching, the only one I found was getin_low, which is ok but still a little high. Here are pics of the vehicle:

https://imgur.com/OLxBW19

https://imgur.com/XsA9XZF

https://imgur.com/VBfDiHi

https://imgur.com/0zCjdvm

https://imgur.com/LYcmK6M

https://imgur.com/DkEu2RV

https://imgur.com/kZx1v1A

https://imgur.com/cQ0kgmo

https://imgur.com/a7COHss

https://imgur.com/5zja1IR

 

Thank you again!

 

Steph

  • Like 2

Share this post


Link to post
Share on other sites

If anyone wants's to know how I created the working cargoturrets within my LAV6, just let me know, I'll share the model.cfg and config.cpp content

 

Cheers!

 

SM

  • Like 2

Share this post


Link to post
Share on other sites

Happy to see you sorted things out! Indeed, the model and textures look amazing, surely comparable to A3 standards 🙂

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×