Home   Help Search Login Register  

Author Topic: chemical smoke!  (Read 1077 times)

0 Members and 1 Guest are viewing this topic.

titan

  • Guest
chemical smoke!
« on: 14 Apr 2003, 20:06:29 »
heres an idea, how cld u make it so u can throw down a smoke nade, and if anyone goes within a set distance of it...they get injured or die!

(dont shout at me if its been done!)

neogenesis

  • Guest
Re:chemical smoke!
« Reply #1 on: 20 Apr 2003, 16:42:04 »
It should be a script that is activated when you throw the smokebomb it creates a trigger with setdamage in it. But Sorry I'm not good enough :P to make it.

jamie_psx

  • Guest
Re:chemical smoke!
« Reply #2 on: 26 Apr 2003, 07:35:17 »
Don't know about anything dynamic as throwing a grenade, but I made a mission once for the NBC soldiers.

Basically I had a toxic waste dump with several of OFP's barrels.
And several elliptical triggers (at different angles) centered on the barrels. Triggers were set at "Repeatedly"
In the Condition field, I used the thislist command to detect if any objects of type Man  were in the trigger (don't remember exactly what I typed but I can look it up for you if you're interested).
And in the On Activation field I made it that the first person to enter the trigger died (setdammage 1.0).

The reason that I used several elliptical triggers instead of one circular trigger, was because when I tried this with one trigger. If two or more guys entered the trigger within a very short time of each other, only the first guy would be affected.

By superimposing several elliptical triggers, at different angles (it looks like the shell of an atom), I improved the chances that everyone entering the trigger would be affected.

Anyway it worked.
BTW, you can use two trigger levels.
For example if you come within 50meters of the toxic zone (trigger radius 50), your health gets cut in half.
If you come within 25meters (second trigger's radius 25) you die.

Also I used the CamCreate command and SmokeShell (on a loop) to generate green and white smoke around the toxic barrels, for visual effect.

Cheers

titan

  • Guest
Re:chemical smoke!
« Reply #3 on: 26 Apr 2003, 22:51:54 »
it wld be easy to make 'chemical smoke' using a fixed point on the map, or even anywhere where it cld be camcreated...cause u will know its name. But it wld be hard to make a version of a throwable nade, as u will have to find the name of that nade, then put a script into effect over it!

jamie_psx

  • Guest
Re:chemical smoke!
« Reply #4 on: 26 Apr 2003, 23:35:33 »
I'm thinking that the easiest way to do what you're suggesting would be to edit an OFP smoke grenade.

Depbo it, and adjust for lethality and lethality-radius.

That way you don't have to script for knowing whose grenade landed where, since that is done for every projectile (from bullets to tank shells) by the actual OFP engine.

Pandoz

  • Guest
Re:chemical smoke!
« Reply #5 on: 28 Apr 2003, 17:48:54 »
Well im not at my house right now....stupid school....but ill make sure to get u a script in which the smoke supposedly does damage to people within a set distance.Im not sure if it works....cause ive never tried it...but it looks as if it works.

jojojoni

  • Guest
Re:chemical smoke!
« Reply #6 on: 28 Apr 2003, 21:02:20 »
Take a look at this scripts. I didnÂ't write them, but they really work. It can detect the position of a grenade or a flare (you can specifie the shelltype to be detected) when itÂ's launched by a specified unit. If you want a group of three black ops using chemical gas (for example) youÂ'll have to execute the script three times. To make chemical gas you would have to make it in another script. In your init.sqs script or in the init field of any unit write this:

[ unittocheck, "shelltype", repeatedly (ToF), delay (ToF), "scriptyouwanttoactivate" ] Exec "LnchDet.sqs"

And here are the scripts:

LnchDet.sqs

;Smoke signal script, intitial part
;Version 1.01
;by Sefe

_Params = [[]] + _this
_Params Exec "LnDetRec.sqs"

Exit


LnDetRec.sqs

_IgnoreArr = _this Select 0
_Unit = _this Select 1
_ShellType = _this Select 2
_Repeatedly = _this Select 3
_Delay = _this Select 4
_ScriptName = _this Select 5

;Check for the presense of a smoke shell
#Loop1
_Shell = NearestObject [_Unit, _ShellType]
_Pos = GetPos _Shell
? ((_Pos Select 0) != 0) and ((_Pos Select 1) != 0) and ((_Pos Select 2) != 0) and not (_Shell In _IgnoreArr) : Goto "Skip1"
~0.05
Goto "Loop1"

;Execute the specified script if the smoke shell is present
#Skip1
? not _Delay : Goto "DontWait"

~3

#DontWait

;Get shell position
_ParamCount = Count _this

;Read out additional script parameters
_ScriptParam = []

_i = 6

#Loop2
? _i >= _ParamCount : Goto "Skip2"
_ScriptParam = _ScriptParam + [_this Select _i]
_i = _i + 1
Goto "Loop2"
#Skip2

;Execute external script
_ExecParam = [_Shell, GetPos _Shell] + _ScriptParam
_ExecParam Exec _ScriptName

;Recursion
_ExecParam = [_IgnoreArr + [_Shell], _Unit, _ShellType, _Repeatedly, _Delay, _ScriptName] + _ScriptParam
? _Repeatedly : _ExecParam Exec "LnDetRec.sqs"

Exit

An example of a "third script", made by Sefe:

Showpos.sqs

;Shows the position of the smoke shell.
Hint Format ["%2 %1", _this Select 1, _this Select 2]

Thanks Sefe, wherever you are!
« Last Edit: 28 Apr 2003, 21:16:08 by Jo-Jo-Joni »