Jump to content
Sign in to follow this  
420memelordxDlmao

Drone leaflet drop scripting

Recommended Posts

I'm trying to create a scenario where some drones fly in and drop leaflets over a town before the invasion starts (literally an event that happens in the laws of war dlc). I'm copying the code here https://community.bistudio.com/wiki/Arma_3_Leaflets except changing "myDrone" to "this".

 

Drones init is:

this addWeapon "Bomb_Leaflets";  
this addMagazine "1Rnd_Leaflets_West_F";

The drone has a waypoint that it flies off to where I'd like it to drop leaflets. This is the on activation function for the waypoint:

this fire "Bomb_Leaflets";
hint "leaflets should have dropped...";

Which prints out "leaflets should have dropped..." as expected, but no leaflets.

 

Would really appreciate any help given, thank you.

Share this post


Link to post
Share on other sites

It's counter-intuitive, but use addMagazine before addWeapon as shown in the wiki page you linked:

myDrone addMagazine "1Rnd_Leaflets_West_F";
myDrone addWeapon "Bomb_Leaflets";

This is a general rule, not leaflet-specific.

Share this post


Link to post
Share on other sites
1 hour ago, Harzach said:

It's counter-intuitive, but use addMagazine before addWeapon as shown in the wiki page you linked:


myDrone addMagazine "1Rnd_Leaflets_West_F";
myDrone addWeapon "Bomb_Leaflets";

This is a general rule, not leaflet-specific.

 

Should have mentioned that I tried that first.

Share this post


Link to post
Share on other sites

I think I figured it out, solution:

 

In your waypoint onActivation, you want to do:

(vehicle this) fire "Bomb_Leaflets";

You need (vehicle this) because `this` is the group leader that activated the trigger, not necessarily the vehicle. Appending vehicle before `this` will get the vehicle of that object if it exists (which in this case is the drone).

Share this post


Link to post
Share on other sites

Oh, I missed that. 

 

thislist select 0 fire "Bomb_Leaflets"; 
hint "leaflets should have dropped...";

"This" isn't passed to OnAct, so it is meaningless. "Vehicle this" as well.

 

*edit* - And I should probably go to sleep. I'm talking about triggers, you are using the waypoint as an activator.

Share this post


Link to post
Share on other sites

Tried it the way you are doing it,

vehicle this fire "Bomb_Leaflets";

works fine, no parentheses required.

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
Sign in to follow this  

×