Jump to content
Sign in to follow this  
somecallmenomad

How to Make a Randomized Weapon/Ammo Crate with Light Beacon

Recommended Posts

^ Title. A supply crate randomly set around the map (Or, ideally, in 1 of a few set positions) with a light beacon over it, or smoke rising very high into the sky. How could this be accomplished? :)

EDIT: Sorry, by "randomized" in the title, I mean placed randomly around the map, with the weapons or ammo I want in it. Just noticed my grammatical error.

Share this post


Link to post
Share on other sites

Place the ammo box on the map. Name it box1.

Give it a placement radius of 500 meters. Every time you start the mission it will start at a place at random in a circle of 500 meters radius.

Or: Change the 500 to any other number.

Now get a search light. In the init of the search light type: this setpos (getpos box1);

The search light will always start on top of the box.

.

Share this post


Link to post
Share on other sites

If you want a preset group of possitions, place a box, place markers at places where you want the box to spawn, and group the box with the markers. every time you start the mission the box will randomly spawn on the location of one of the markers.

To connect light or a smoke you read this: https://community.bistudio.com/wiki/attachTo

Here it how it works:

Name the box

create a marker (or use existing marker)

use this code in your trigger or whatever you use to spawn the box: (green things should be changed by you)

smokename = "SmokeShellRed" createVehicle [getMarkerPos "yourmarkernamehere",0 ]; // this creates and names the smokegrenade.

smokename attachTo [yourboxname,[x,y,z]]; //this attaches the smokegrenade to the box.

XYZ are coordinates change them to 0 (zero) if you want the smoke to be atached to the center of the box.

Share this post


Link to post
Share on other sites

What is the marker for? And where in the trigger would I put that code? I'm still kind of a newbie to this, sorry.

---------- Post added at 22:49 ---------- Previous post was at 22:34 ----------

Actually, nvm, I got it figured out.

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  

×