Home   Help Search Login Register  

Author Topic: Adding smoke to a chopper  (Read 2201 times)

0 Members and 1 Guest are viewing this topic.

Offline Sixgun

  • Members
  • *
  • I'm a llama!
Adding smoke to a chopper
« on: 04 Feb 2005, 21:52:43 »
OK, here is a softball, I think. I hate to even ask, but my searches have come up short.

I want to add smoke grenades to a helicopter. I have tried addweapon in the init field, putting addmagazine first, but when I get into the chopper, although I can select the smokeshell, and I get the proper reticle for firing, there is no ammo, and it won't give me a reload action.

How can you have a Pink Team without red smoke grenades in the Loach?

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Adding smoke to a chopper
« Reply #1 on: 05 Feb 2005, 03:12:26 »
To add mags and weapons to a vehicle, you need to use:
Code: [Select]
_unit addMagazineCargo ["_weapon",_number]
where _weapon is the weapon
_number is the number of guns or mags
_unit is the ammo crate or vehicle

e.x.
Code: [Select]
Loons_Loach addMagazineCargo ["JAM_M16",3]

that should do it mate :D
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Sixgun

  • Members
  • *
  • I'm a llama!
Re:Adding smoke to a chopper
« Reply #2 on: 05 Feb 2005, 03:54:41 »
Tyger,

I don't think that will work. What I am trying to do is have the smoke grenades available as a weapon on the chopper, not as a supply item.

In Vietnam, we employed the OH-6A Cayuse as a scout helicopter to search out the Vietcong on the ground. Teamed with the OH-6 (Light Observation Helicopter, or "Loach") was often an AH-1 Cobra gunship. When the Scout pilot (who was hovering just inside translational lift speed at treetop level) spotted the enemy on the ground, he called in the Cobra (who was orbiting a couple of thousand feet higher in an opposite direction so he could always see the Loach) who would come down and engage the enemy with rockets.

The Loach pilot (or the observer) would drop a red smoke grenade on the enemy to mark him for the much higher Cobra and then un-ass the area as the Cobra rolled in hot. Loach drivers carried red smoke grenades by the case, and strung a few up in the cockpit  on safety wire within easy reach just for this purpose.

Offline XCess

  • Former Staff
  • ****
Re:Adding smoke to a chopper
« Reply #3 on: 05 Feb 2005, 04:16:55 »
do this:

 "smokeShellRead" camCreate getPos heloName

this will create a red smoke shell that ill drop to the ground starting from the helos position, simulatin a smokeshell being dropped from the window.. you could use:

[(getpos heloName select 0)+x,(getPos heloName select 1)+y,(getPos heloName select 2)+z]

instead of getPos heloName.. change x y and z to whatever and ull have complete control of where it's created around the helo. you could also use setVelocity to change the direction of the smoke to whatever u want.

Offline Sixgun

  • Members
  • *
  • I'm a llama!
Re:Adding smoke to a chopper
« Reply #4 on: 05 Feb 2005, 04:28:04 »
Xcess,

Will I be able to fire the shell out of the chopper on command (me flying, or another player) ?

When I do the addweapon init thing, I get the weapon added to the chopper's weapons fine, grenade aimer and all, just no ammo.
« Last Edit: 05 Feb 2005, 04:29:00 by Sixgun »

Dubieman

  • Guest
Re:Adding smoke to a chopper
« Reply #5 on: 05 Feb 2005, 05:08:03 »
Well generally addweapon means you have to addmagazine to shoot something. :P

As for Xcess's way, you can use actions to control the smoke shell release. It'd be better than making a new addon where the weapon would be added to the chopper itself in the first place. :-\


Offline XCess

  • Former Staff
  • ****
Re:Adding smoke to a chopper
« Reply #6 on: 05 Feb 2005, 06:00:38 »
I believe camCreate would be the only way to do it purely with scripting though... altho maybe u could make a fired eventHandler for the smokeShell weapon, but I thought that was class under throw  ???

Offline OFPWiZard

  • Members
  • *
Re:Adding smoke to a chopper
« Reply #7 on: 05 Feb 2005, 09:05:10 »
I could think of something maybe or just merdge some stuff together that i have been working on.

All i need is this questiont o be anwsered:

Do you want the chopper to drop the smoke once you get in a trigger or by a script or even in your action menu.  I could do them all.

If so it would create two sqs files... one launching the other script which the first one was triggered by a trigger or something.  The second one would give the chopper the smoke after getting the position and stuff.

I'll post again when i get up... really tired to try it out.

But i did something like that before.

Offline Sixgun

  • Members
  • *
  • I'm a llama!
Re:Adding smoke to a chopper
« Reply #8 on: 06 Feb 2005, 06:31:20 »
What I really want to do is add red smoke shells as a weapon to the SEB 0h-6A, so that in a co-op mission, the player scout pilot can mark targets for the player Snake pilot to hit with rockets.

I would be fine with launching them with the action menu..., I would prefer to be able to hit the change weapons key and bring them up like guns or rockets, etc. So far, I can successfully add the weapon "smokeshellred" to the chopper, and select it from the weapons menu, but there is never any ammo... I think I am just missing something small.

For those of you who did not read my original post, YES, I ADDED MAGAZINES BOTH BEFORE AND AFTER THE ADDWEAPON IN THE INIT FIELD. I even tried adding magazines incargo like Tyger suggested, just to say I did. No dice.

Am I nuts?  <<this addmagazine "smokeshellred">> Is this proper syntax? I get no errors in the editor, but in the chopper, no ammo for the smokeshell weapon. I am trying to be as clear as possible but maybe I am not explaining things well enough. :(

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Adding smoke to a chopper
« Reply #9 on: 06 Feb 2005, 10:41:32 »
Hi Sixgun

I was just passing by and saw your post and thought I'd help, if possible.  I'm not sure if this is what you want but here you go.

Create your helo and put this in its Init field -

shellsOnBoard = 24; this addaction ["Drop smoke", "dropSmoke.sqs"]

Then create the following script and put it in your mission folder -

;   dropSmoke script

? _droppingShell == 1 : exit
_droppingShell = 1

? shellsOnBoard < 1 : hint "No more smoke shells left", exit
shellsOnBoard = shellsOnBoard - 1
hint format ["Smoke away, %1 shells left !", shellsOnBoard]

"smokeShellRed" camCreate getPos helo

~3

_droppingShell = 0


Cheers !



Roni

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Adding smoke to a chopper
« Reply #10 on: 07 Feb 2005, 05:57:42 »
Not sure if this will work... I'd probably go along with the addaction script if I were you... but try:

LOH addmagazine "Smokeshellred"; LOH addweapon "throw"

A smokeshell isn't a weapon in OFP, it's a magazine. The weapon that's used to 'fire' it is called throw. As I said, it's a long shot... ;)

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Adding smoke to a chopper
« Reply #11 on: 07 Feb 2005, 06:36:39 »
It does work - I made the mini-mission to prove it !  ;D

I was working on something else but decided to add the above OH-58 and script and make the pilot the player just for a minute to test it out - bingo !

Attached is the actual script.  As I said, simply create an OH-58 named helo with the following in its Init field -

shellsOnBoard = 24; this addaction ["Drop smoke", "dropSmoke.sqs"]

It takes practice to drop right on target but after a few tries you should get it no probs.  I've mapped my "Look Around" function to the C on my keyboard - simply fly over your target and look past your toes and drop about a half second after you see the target pass under you and you should be dead on.

Happy hunting !  :D



Roni

Offline Sixgun

  • Members
  • *
  • I'm a llama!
Re:Adding smoke to a chopper
« Reply #12 on: 08 Feb 2005, 05:00:04 »
Roni,

First of all, thank you.

I Tried to do what you said, and I got really excited when I took off, "dropped smoke" through the action menu, and got the nice little reminder that I had only 23 shells left.

Unfortunately, I never did see any smoke, even after dropping 16 shells.

Obviously I did something wrong somewhere. I cut and pasted your script, and your addaction init line.

I will say that the chopper in question is empty on the runway at the start of my test mission, does that change anything? :'(

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Adding smoke to a chopper
« Reply #13 on: 08 Feb 2005, 05:08:08 »
Did you try what Sui suggested above?


Planck
I know a little about a lot, and a lot about a little.

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Adding smoke to a chopper
« Reply #14 on: 08 Feb 2005, 05:20:06 »
Hi Sixgun

First off - look behind you !

I had what I thought was the same problem the first time that i tried it too - trust me, the smoke IS dropping, it just takes a few seconds to start "billowing".  If you go to "Command" view and zoom around so that you're looking behind yourself you will see the smoke spewing out all over the ground.

The problem I think is the limitation of the "drop" command - the actual effect is created by only a few small particles which look dense only when they're all together.  When the shell is falling the "trail" consists of only  a few particles at any point in the line.  Of course, once the shell hits the ground it starts to billow nicely !

I combined my little marking runs with Manual Fire and a follow up rocket attack - lots of fun !  I've mapped my Look Around and Command views to convenient keys (for me at least) - after I drop smoke i jump in and out of Command vew to check my aim, then turn around for the follow up attack.

BTW - after I threw the script together I thought about how much fun it would be with a custom sound effect (hiss and fizz in the cockpit as the grenade is primed and dropped), a "hit" event handler to create much louder pinks and banging noise when the ground fire hits you and some sort of extra routine attached to the smoke script to direct your gunship buds to drop down and service the target !

If you ask nice maybe Santa will come early this year !  ;)

Cheers


Roni