Home   Help Search Login Register  

Author Topic: Make AI drop their gun  (Read 2710 times)

0 Members and 1 Guest are viewing this topic.

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Make AI drop their gun
« on: 02 Feb 2003, 10:24:05 »
Hallo,

since Resistance i can drop my weapon to the gound. Can i order the AI to do the same ?
How can i order them to pick up a weapon which is lying around ?

Yours Kuro

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Make AI drop their gun
« Reply #1 on: 02 Feb 2003, 12:02:36 »
Welcome to the forums, Kuro

Please be aware that this is specifically an editing site, so we don't do gameplay tips. However I'll give you the benefit of the doubt this time and assume you want the scripting solution rather than the gameplay solution...

To get a unit to drop it's main weapon you can use this line:

unit action ["DROP WEAPON", unit, 0, 0, (primaryweapon unit)]

hmm...
ok ok... the gameplay tip method:

Go to the map screen and click on the gear section of the briefing. Move through to the guy you want to drop his weapon, and click the drop weapon button (looks like an arrow pointing down).

You can order a soldier in your group to pick up a weapon by using the action section of the radio menu (6).

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:Make AI drop their gun
« Reply #2 on: 02 Feb 2003, 12:36:17 »
Hallo  Sui,

many thanks for your answer, actually i was looking for the scripting solution (the gameplay solution i already knew).

By the way how do i get the unit to pick up a weapon by scripting ?

Many thanks
Kuro

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Make AI drop their gun
« Reply #3 on: 03 Feb 2003, 00:15:34 »
Good good... didn't mean to jump down your throat there mate ;)

Take weapon is similar, with a couple of differences:

unit action ["Take Weapon", weaponsource,0,0,"weapon"]

Where weaponsource is where the weapon is (name of an ammo crate, vehicle or the name of some guy who just died.
Weapon is of course, the type of weapon (eg. "m16")

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:Make AI drop their gun
« Reply #4 on: 03 Feb 2003, 01:11:00 »
Hallo Sui,

many thanks for the very fast answer.  BTW (i took no offence by your answer), i am working on a "capture the enemy script".  Could you do me a last favour ? If i want to delete the weapon which the guy dropped, how can i do it. If have no Name of it and no objectid (or is is it the return value of the action ?)

e.g. deletevehicle ?????  

Yours
Kuro

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Make AI drop their gun
« Reply #5 on: 03 Feb 2003, 01:28:49 »
Hmm... You might be able to do that using the nearestobject command, but that command is horribly imprecise at the best of times...

deletevehicle (nearestobject [ unit,"weaponholder"])

Like I said, it's not very accurate though...

weaponholder is what your gun is put into if you drop it on the ground.
If you drop a LAW Launcher, you'll need to put 'secondaryweaponholder' instead ;)
« Last Edit: 03 Feb 2003, 01:31:08 by Sui »

Josef

  • Guest
Re:Make AI drop their gun
« Reply #6 on: 03 Feb 2003, 13:50:53 »
You could use removemagazine to empty the weapons before they drop them...

I thats what u wanna do...

Offline benreeper

  • Members
  • *
  • I'm a llama!
Re:Make AI drop their gun
« Reply #7 on: 13 Feb 2003, 07:28:23 »
I was looking for that answer and searched 3 times and could not find it, thanks.  

BTW what is the syntax for putting a weapon into something?

Ben

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Make AI drop their gun
« Reply #8 on: 13 Feb 2003, 11:34:00 »
weaponsource1 addmagazine "M16"; weaponsource1 addweapon "M16; weaponsource1 addmagazine "M16"; weaponsource1 addmagazine "M16"


Always add a mag first so that the weapon is loaded.    Works for ammocrates, vehicles and troopers.     If you put it in the init field of the unit use "this" instead of the name.
Plenty of reviewed ArmA missions for you to play

Offline benreeper

  • Members
  • *
  • I'm a llama!
Re:Make AI drop their gun
« Reply #9 on: 13 Feb 2003, 18:56:26 »
Thanks but I'm referring to the action "PUT" which is similiar to the action "DROP".  The remove command sort of functions outside the game while "PUT" and "DROP" functions within the game (they are something that a player can do).  I need the player to do it.   Also these actions are the cleanest way to remove the weapon and its associated mags.

Ben

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Make AI drop their gun
« Reply #10 on: 21 Feb 2003, 05:29:01 »
unit action ["Take Weapon", weaponsource,0,0,"weapon"]

Sui -- How did you find out the syntax for that command? I've been looking for it forever (well for a few hours at least).

I was trying this...
unit action["take weapon",source,"weapon"]

What the hell do those two 0's mean? is that the position the commander shouts out?
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Make AI drop their gun
« Reply #11 on: 21 Feb 2003, 05:37:22 »
I guess the numbers mean nothing. ;D

One thing I noticed is that when you give the action the unit is able to pick up the weapon even if the weapon is a mile away.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Make AI drop their gun
« Reply #12 on: 21 Feb 2003, 09:06:45 »
I'm not too sure where I picked up that bit of info... It's in my snippets file, which means it could have come from anywhere on the internet ;D

To tell you the truth I've never played around with the numbers, so I'm not sure what they mean.
Distance North - Distance East?
Maximum distance to run?
How many time to bend over?
Could be anything I guess... I might have a muck around if I get the time later and find out :)

SSG Plazmoid

  • Guest
Re:Make AI drop their gun
« Reply #13 on: 27 Feb 2003, 20:35:19 »
is the a list of possible actions/commands you can give to units/groups in script? The only way I'm learning them is to come across them by chance in these types of messages.

thanks,
Plaz

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Make AI drop their gun
« Reply #14 on: 27 Feb 2003, 22:14:30 »
Look in the Editors Depot

If you take a look down the left hand side you will find a thing called Commands.  (Under References)    Go play.

For downloadable versions, look in Tutorials - References - Command References.   There you will find both the official and unofficial command reference guides.
Plenty of reviewed ArmA missions for you to play