Home   Help Search Login Register  

Author Topic: Get an AI to throw a smoke grenade  (Read 2502 times)

0 Members and 1 Guest are viewing this topic.

Offline CharlieReddog

  • Members
  • *
Get an AI to throw a smoke grenade
« on: 06 Jun 2008, 20:02:10 »
I've created a smallish ambush mission, but what I'm finding is it's a little too easy to wipe out the enemy. What I'd like is on the firing of a particular trigger (Already set up), the leader of the ambushed squad to throw a smoke grenade. The location being what it is, the direction of the smoke probably doesn't matter, because as soon as it pops it's going to obscure much of the ambush position.

I've tried the following, but nothing seems to work. I have of course equipped the leader (m1) with the
Code: [Select]
this addmagazine "smokeshellred".

Code: [Select]
m1 fire ["smokeshellredmuzzle","smokeshellredmuzzle","smokeshellred"] (this is in Mr Murray's manual.
Code: [Select]
m1 fire ["throw","smokeshellredmuzzle","smokeshellred"]
Code: [Select]
m1 action ["smokeshellredmuzzle","smokeshellredmuzzle","smokeshellred"]
None of the above seem to work. Of course the loon in question has other weapons, do I need to order him to switch weapons or something? ???

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Get an AI to throw a smoke grenade
« Reply #1 on: 07 Jun 2008, 11:55:24 »
Ummm, try:

m1 fire ["throw","smokeshellred","smokeshellred"];

I can't try it myself for reasons of hardware failure.   :dry:


Planck
« Last Edit: 09 Jun 2008, 18:45:15 by Planck »
I know a little about a lot, and a lot about a little.

Offline CharlieReddog

  • Members
  • *
Re: Get an AI to throw a smoke grenade
« Reply #2 on: 07 Jun 2008, 12:28:46 »
Tried and nope, that's not it. This is annoying! thanks for the help though.

Offline Pirin

  • Members
  • *
Re: Get an AI to throw a smoke grenade
« Reply #3 on: 08 Jun 2008, 07:12:39 »
The Domination mission has AI that pops smoke almost every time they are fired at.  Might want to pick that apart to see how they did it.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Get an AI to throw a smoke grenade
« Reply #4 on: 08 Jun 2008, 12:31:00 »
This works for me:
Code: [Select]
m1 fire ["SmokeShellRedMuzzle"]
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Rommel92

  • Members
  • *
Re: Get an AI to throw a smoke grenade
« Reply #5 on: 08 Jun 2008, 15:54:21 »
The Domination mission has AI that pops smoke almost every time they are fired at.  Might want to pick that apart to see how they did it.

As far as I know, thats a simple createVehicle (camCreate?) or something similiar, no Smoke grenade is "thrown" as such.

Offline CharlieReddog

  • Members
  • *
Re: Get an AI to throw a smoke grenade
« Reply #6 on: 08 Jun 2008, 18:43:24 »
I don't get it then. I have set up a radio trigger with m1 fire ["smokeshellred"] as h- suggests, but it doesn't work. What am I doing wrong?

Offline Xeno

  • Members
  • *
Re: Get an AI to throw a smoke grenade
« Reply #7 on: 08 Jun 2008, 23:58:42 »
no Smoke grenade is "thrown" as such.

Starting with version 3.0 a smoke grenade is "thrown" as such. The script is even checking each unit in the group for a smokeshell and the unit that has one actually throws it.

Part of the x_dosmoke.sqf script:
Code: [Select]
_one_shell_muzzle = (switch (_one_shell) do {case "SmokeShell": {"SmokeShellMuzzle"};case "SmokeShellRed": {"SmokeShellGreenMuzzle"};case "SmokeShellRed": {"SmokeShellRedMuzzle"};});
_shell_unit selectWeapon _one_shell_muzzle;
sleep 0.121;
if (_shell_unit == _leader) then {
_shell_unit doTarget _killer;
sleep 0.234;
_shell_unit fire _one_shell_muzzle;
} else {
_shell_unit commandTarget _killer;
sleep 0.234;
_shell_unit fire _one_shell_muzzle;
};

And I guess the error that you make is that you don't use the muzzle name.

Xeno

Offline CharlieReddog

  • Members
  • *
Re: Get an AI to throw a smoke grenade
« Reply #8 on: 10 Jun 2008, 22:24:16 »
I've edited this for my test mission as follows. I've even made M1 a squad leader which should have the redsmoke shell anyway so nolonger adding a magazine.

Code: [Select]
_shell_unit=M1;
_one_shell_muzzle = "SmokeShellRedMuzzle";
_Killer=P1;
_shell_unit selectWeapon _one_shell_muzzle;
sleep 0.121;
if (_shell_unit == _leader) then {
_shell_unit doTarget _killer;
sleep 0.234;
_shell_unit fire _one_shell_muzzle;
} else {
_shell_unit commandTarget _killer;
sleep 0.234;
_shell_unit fire _one_shell_muzzle;
};

And it still doesn't work. Will someone please just give me the code!!! PLEASE! :dunno:

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Get an AI to throw a smoke grenade
« Reply #9 on: 11 Jun 2008, 06:21:01 »
Well according to the comref it takes it as (muzzle, mode, magazine) or (muzzle, mode).

So try it using the appropriate muzzle:

m1 fire ["smokeshellredmuzzle","smokeshellred","smokeshellred"];

or

m1 fire ["smokeshellredmuzzle","smokeshellred"];


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

Offline Xeno

  • Members
  • *
Re: Get an AI to throw a smoke grenade
« Reply #10 on: 13 Jun 2008, 10:13:41 »
And it still doesn't work. Will someone please just give me the code!!! PLEASE! :dunno:

Code: [Select]
_shell_unit=M1;
_shell_unit addMagazine "SmokeShellRed";
_one_shell_muzzle = "SmokeShellRedMuzzle";
_Killer=P1;
_shell_unit selectWeapon _one_shell_muzzle;
sleep 0.121;

_shell_unit commandTarget _killer;
sleep 0.234;
_shell_unit fire _one_shell_muzzle;

Works fine here. Though the unit needs to have a SmokeShellRed, otherwise it won't work.

Xeno