Jump to content
ziptlytical

Infiltrating enemy base via truck [Solved]

Recommended Posts

I'm trying to make a mission at night where the player has the option to get in an enemy cargo truck in the back and enter their base via truck undetected. Because originally the player can't enter an enemy truck 

 

How can i make this with as little scripting as possible?

 

  • Like 1

Share this post


Link to post
Share on other sites

Heya Ziptlytical-

That is a fun idea! However, when a unit occupies a vehicle, it changes the vehicle's side (and I am fairly sure localizes the vehicle to the unit's machine; in this case the server). You can demonstrate this easily by placing an empty OPFOR vehicle in front of a BLUFOR AT soldier. The soldier will decide to attack the vehicle based on the faction of the driver. For this reason, the occupants of the same vehicle cannot be from different sides, even civilian. So I am pretty sure you will have to get very creative with you solution. 

Off the top of my head, you could try to create an invisible vehicle (perhaps apply a homemade transparent texture instead) and attach it to the back of your truck. Then script a "Get In" event handler that, when the player is inside the invisible vehicle, makes the player invisible as well. And another event handler for when the player exits the vehicle. I don't see any way of getting your idea to work within the standard capabilities of the Eden Editor (and Arma engine). 

Will reply if I get a better method..

  • Like 1

Share this post


Link to post
Share on other sites

The other idea I am thinking involves making the player unit disappear and setting the player camera to follow the enemy vehicle. Basically simulating that the player is riding the vehicle, when he actually isn't. 

There is a mod that does this trick: Duda's Advanced Train Simulator (ATS). Very popular, and doesn't require loading a mod to make it work (the mod simply loads script files on everyone connected to the server and then has each client run the scripts on their own). If you're willing to put in the work, I am certain you can get inspired by the scripting method of that mod to achieve the result of the player walking up to a vehicle, getting an action to enter it, "riding" it in third person mode, and being able to get off, just like a normal vehicle. 

Good luck.

  • Like 1

Share this post


Link to post
Share on other sites

what about making the player captive and assigning him to that enemy vehicle then making him not captive after he reaches destination? There has to be a mission where this has been done before i just don't know the name of it.

Share this post


Link to post
Share on other sites
8 hours ago, Melody_Mike said:

Heya Ziptlytical-

That is a fun idea! However, when a unit occupies a vehicle, it changes the vehicle's side (and I am fairly sure localizes the vehicle to the unit's machine; in this case the server). You can demonstrate this easily by placing an empty OPFOR vehicle in front of a BLUFOR AT soldier. The soldier will decide to attack the vehicle based on the faction of the driver. For this reason, the occupants of the same vehicle cannot be from different sides, even civilian. So I am pretty sure you will have to get very creative with you solution. 

Off the top of my head, you could try to create an invisible vehicle (perhaps apply a homemade transparent texture instead) and attach it to the back of your truck. Then script a "Get In" event handler that, when the player is inside the invisible vehicle, makes the player invisible as well. And another event handler for when the player exits the vehicle. I don't see any way of getting your idea to work within the standard capabilities of the Eden Editor (and Arma engine). 

Will reply if I get a better method..

 

 

ya something like this may work & ya that's the sad part "My ideas are usually above the means of the editor" hehe

Share this post


Link to post
Share on other sites
10 hours ago, ziptlytical said:

what about making the player captive and assigning him to that enemy vehicle then making him not captive after he reaches destination? There has to be a mission where this has been done before i just don't know the name of it.

I think this the less complicated way to go. How do you make the player choose to get in the truck? The easiest way will be with an add-action, that prompt the player as soon as he comes close to the back of the truck:

"HIDE IN THE TRUCK's CARGO" (or something like that), where inside that add-action you set the player captive first, then teleport him as cargo. Then you could use a "getoutMan" event handler to reverse the captive state of the player. 

Cheers mate!

 

EDIT: you could use a "hold-action" as well...and with 3den enhanced is built-in every object and very easy to set up.

  • Like 3

Share this post


Link to post
Share on other sites
42 minutes ago, zagor64bz said:

I think this the less complicated way to go. How do you make the player choose to get in the truck? The easiest way will be with an add-action, that prompt the player as soon as he comes close to the back of the truck:

"HIDE IN THE TRUCK's CARGO" (or something like that), where inside that add-action you set the player captive first, then teleport him as cargo. Then you could use a "getoutMan" event handler to reverse the captive state of the player. 

Cheers mate!

 

EDIT: you could use a "hold-action" as well...and with 3den enhanced is built-in every object and very easy to set up.

thanks , i'll give this a try and post my results if it works

Share this post


Link to post
Share on other sites

Very nice i can work with this idea. This is how i did it;

 

1) Created an "empty truck" and moved enemy AI into driver and front seats of truck so the player has to go in back.  (soldier1 moveindriver truck1, soldier2 moveincargo truck1) 

2) Created a trigger around the truck - player   "addAction ["Hide in truck", "getintruck.sqf"]"

3) Created script getintruck.sqf

player moveincargo truck1;
player setcaptive true;

4) Then once the player uses the addaction "getout" of truck, anytime he decides to get out, the setcaptive will be false. or gets out of truck at anypoint

 

That's done the trick for me. Very easy way to do it. 

  • Like 2

Share this post


Link to post
Share on other sites

Wow @ziptlytical. I did not know the game allowed this for setCaptive units. I learned something today! Thanks. 

Feel I need to give something back. Did some experimenting. Players do not need to be captive before using the action. And you can choose which part of the truck gets a trigger with the addaction. Here's a code you can add to your truck's init so it doesn't need a trigger spot and activates only when player is standing near the back:
 

this addAction["Hide in truck", 
   {
player setCaptive true; 
player moveincargo truck1; 
player setcaptive true;
   },
 nil,   
 1.5,   
 true,   
 false,  
 "",    
 "true",   
 5, 
 false, 
 "",  
 "pos cargo" ];

Once player is inside the truck, he can stop being captive. So at the destination you can create a trigger with OnActivation "player setCaptive false;" or make an event handler in the player init such as this:
 

this addEventHandler ["GetOutMan", 
   { 
 player setCaptive false; 
   }];

-Which runs when player leaves (this case any) vehicle.

Good luck with the mission!

  • Like 1

Share this post


Link to post
Share on other sites
On 1/25/2021 at 7:23 PM, Melody_Mike said:

Wow @ziptlytical. I did not know the game allowed this for setCaptive units. I learned something today! Thanks. 

Feel I need to give something back. Did some experimenting. Players do not need to be captive before using the action. And you can choose which part of the truck gets a trigger with the addaction. Here's a code you can add to your truck's init so it doesn't need a trigger spot and activates only when player is standing near the back:
 


this addAction["Hide in truck", 
   {
player setCaptive true; 
player moveincargo truck1; 
player setcaptive true;
   },
 nil,   
 1.5,   
 true,   
 false,  
 "",    
 "true",   
 5, 
 false, 
 "",  
 "pos cargo" ];

Once player is inside the truck, he can stop being captive. So at the destination you can create a trigger with OnActivation "player setCaptive false;" or make an event handler in the player init such as this:
 


this addEventHandler ["GetOutMan", 
   { 
 player setCaptive false; 
   }];

-Which runs when player leaves (this case any) vehicle.

Good luck with the mission!

thanks for the help , i don't plan on doing this mission for awhile, i have other missions in mind i want to do first, look out for my of my missions. I plan to upload least 10+ or more as i can. 

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

×