namreg 0 Posted June 4, 2008 Hi, I would like to bomb a whole town for a cutscene and I wonder If there's any way to place bombs in the sky and just let them fall free and explode...... I tried to use some units to do it in the init menu I inserted this: Quote[/b] ]this addmagazine "6rnd_gbu12_av8b"; this addweapon "bomblauncher" then I put an invisible marker on the map and with the setpos command I send the unit there and by a trigger they fired the weapon: Quote[/b] ]kamikaze1 fire "bomblauncher" Then it exploded..... but you always see a guy flying around, and if I wanted to explode more bombs it was impossible or completely slow... I know there's a good way to do this, could anyone tell me the script?? THX Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted June 4, 2008 That's the most hilarious method I've ever heard of . It's much easier to just spawn the bomb directly. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Bomb = "Bo_GBU12_LGB" createVehicle [getPos MyGameLogic select 0, getPos MyGameLogic select 1, AltitudeInMeters]; Place a named game logic on the map, and subsitute MyGameLogic with the name of your game logic and AltitudeInMeters with the desired spawn altitude. AltitudeInMeters should work with 0 if that's the desired effect. Share this post Link to post Share on other sites
namreg 0 Posted June 4, 2008 jajaja, I know man I knew that the createvehicle command was involved in this, at first I created a marker and used the getpos command to try to place the bomb there but I couldn't.... anyway, THX a lot man.... There are many things I don't know about scripting, and I see a lot of difficult scripts out there that just blow my mind....jejeje... yours is great, just what I needed.... Share this post Link to post Share on other sites
[frl]myke 14 Posted June 4, 2008 Just for completeness: With markers getpos wont work, use getmarkerpos insted should do the trick Share this post Link to post Share on other sites
namreg 0 Posted June 4, 2008 I tried <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Bomb = "Bo_GBU12_LGB" createVehicle [getMarkerPos MyMarker select 0, getMarkerPos MyMarker select 1, AltitudeInMeters]; instead of <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Bomb = "Bo_GBU12_LGB" createVehicle [getPos MyGameLogic select 0, getPos MyGameLogic select 1, AltitudeInMeters]; But it doesn't work with markers.... thing that would be neat so there are not so many game logics spread all over the place, just markers that can be hidden... what am I doing wrong?? Share this post Link to post Share on other sites
mandoble 1 Posted June 4, 2008 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Bomb = "Bo_GBU12_LGB" createVehicle [getMarkerPos "MyMarker" select 0, getMarkerPos "MyMarker" select 1, AltitudeInMeters]; Marker names between quotes allways. Share this post Link to post Share on other sites
charliereddog 9 Posted June 5, 2008 I've been using the createvehicle array recently for similar purposes, and discovered that it wouldn't take a perfectly valid x,y,z coord. It would create the bomb at ground level in the right place. I had to then set the height of the bomb using setpos, passing it the exact same coords as I'd used to create?? Share this post Link to post Share on other sites
hicks88 0 Posted June 5, 2008 make sure that you don't use getmarkerpos for the last set of coordinates as all makers are at ground level, make sure you are using a just a number Share this post Link to post Share on other sites
charliereddog 9 Posted June 5, 2008 Hicks, I've got the position set as a local variable, and the height is NOT taken from the marker, in fact there isn't even a marker in my particular script. The bomb is created 3 mtrs below a flying plane, or at least it would be if it worked. I use exactly the same local variable in the setpos and it works correctly. Share this post Link to post Share on other sites
LoboE 0 Posted June 12, 2008 Sorry for stupid question, but can i use tricker to activate gamelogig bombs? I want to spawn few bombs when certain point has reached, I am using this code: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Bomb = "Bo_GBU12_LGB" createVehicle [getMarkerPos "target" select 0, getMarkerPos "target" select 1, 50];Bomb = "Bo_GBU12_LGB" createVehicle [getMarkerPos "target_1" select 0, getMarkerPos "target_1" select 1, 70] I have placed 2 markers to map, called target and target_1 Share this post Link to post Share on other sites