Home   Help Search Login Register  

Author Topic: Please help with Obscuring Smoke ?  (Read 1689 times)

0 Members and 1 Guest are viewing this topic.

CptBravo

  • Guest
Please help with Obscuring Smoke ?
« on: 11 Jan 2004, 07:39:30 »
Hi,

I have heard there was an Obscuring Smoke Grenades/Launcher script that will work with the AI in MP games. The current BIS smoke is no good, it might as well be invisible since AI can see through it.
Your help as always is greatly appreciated.

CptBravo

  • Guest
Re:Please help with Obscuring Smoke ?
« Reply #1 on: 11 Jan 2004, 07:40:54 »
Just to clarify, work with the AI means enemy AI can not see you behind the smoke as in blocked.

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Please help with Obscuring Smoke ?
« Reply #2 on: 12 Jan 2004, 18:49:13 »
Yep, and here's how.

Prerequisites
You need the JAM2 addons.  Get the ECP compatible version while you're at it: JAM Addon (ECP compatible)

How it works
The obscuring smoke grenades works through a bit of event handler magic.  All units that need the capability to throw obscuring smoke grenades (lets call them "OSG" from now on) need a custom fired event handler to detect and handle the creation of OSG.

If you are using JAM-provided soldiers, this step is unneeded since they already have the needed EH. However, standard BIS units and a lot of addon units dont, so they'll need this EH added to them.

The magic
The following needs to be done to all units that should have OSG capability. First the variant you use on units that dont define their own "fired" EH in the config, thereby allowing ECP, if used, to add its fired EH to it. Examples of such units are the standard BIS units:
Code: [Select]
this addEventHandler ["fired", "if ( (_this select 1 in [{Throw},{JAM_AT4Launcher},{JAM_RPG7Launcher},{JAM_M72LAWLauncher}]) or (_this select 4 in [{JAM_MarkerGrenadeammo}]) ) then {_this exec {\JAM_Magazines\FX\firedEH.sqs}}"]
If you are using units that do have their own custom event handlers in their config (such as the standard Marine Assault Pack units), one has to add a bit to it to make it ECP compatible. (This wont have any adverse effects for players not using ECP, so one might as well have it there)
Code: [Select]
this addEventHandler ["fired", "_this call ECP_EH_handler_fired; if ( (_this select 1 in [{Throw},{JAM_AT4Launcher},{JAM_RPG7Launcher},{JAM_M72LAWLauncher}]) or (_this select 4 in [{JAM_MarkerGrenadeammo}]) ) then {_this exec {\JAM_Magazines\FX\firedEH.sqs}}"]

(That should be one line only)

Good luck!

« Last Edit: 12 Jan 2004, 19:05:02 by Killswitch »

CptBravo

  • Guest
Re:Please help with Obscuring Smoke ?
« Reply #3 on: 13 Jan 2004, 05:10:41 »
hey Killswitch,
Thanks for the response. I have tried it but I must be doing something wrong?  ???
I have put that second code in the init field of my Marine, I throw the smokeshells and I still keep getting shot by the enemy AI from behind the HEAVY smoke? Do you by any chance have a demo mission to show rookies like us how do it??  ;D

Thanks.

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Please help with Obscuring Smoke ?
« Reply #4 on: 13 Jan 2004, 12:45:05 »
To tell the truth, I havent tested this feature much. :-X Since the OFP engine cannot actually do "real" smoke, the JAM OSG:s use a trick in that they work something like this:

1 - the event handler detects (among other things) that you chuck a BIS smoke
2 - after 5 secs, its replaced with another smoke grenade (that keeps pumping out smoke, perhaps a bit thicker than the default smoke, I havent compared the numbers.
3 - an invisibile AI LOS-blocking object (a box?) is created on top of the smoke grenade, thereby simulating vision-impairing smoke.
4 - after 80 secs the visual smoke is gone and the invisible box is removed

Now, what I'd like to know is the shape and size of this "blocker object" in order to use the smoke grenades properly. Any of you JAM guys around?

Aah... smoke and wind...two of many wishes for OFP2  ;D
« Last Edit: 13 Jan 2004, 12:45:16 by Killswitch »

CptBravo

  • Guest
Re:Please help with Obscuring Smoke ?
« Reply #5 on: 13 Jan 2004, 16:26:07 »
I think you're right. After EXTENSIVE testing, I found out it does work under certain conditions:

You need to use a LOT of smoke. I had to use 4 smoke grenades to block one AI soldier!
You were also right about time. It takes a few secondes for it to work.
Finally it also depends on your position from the AI enemy which goes back to how big the "invisible" blocker object is.

On a releated topic, anyway to force AI (yours and the enemy) to use the smoke grenades in battle?

I certainly hope smoke will be a main feature in OFP2 since it is a main feature in any battle.

HuNtA

  • Guest
Re:Please help with Obscuring Smoke ?
« Reply #6 on: 16 Jan 2004, 22:34:11 »
use the fire command to make em throw em, something like this:

man fire ["throw","smokeshell","smokeshell"]

or along those lines (wrong order with the throw and smokeshell bits I think)