View Full Version : How to tell to get a weapon from a crate?
AI soldier with no weapon. M16 in a crate called "mycrate"... I got a trigger that activate when enemies come in... In this case i want to get to the crate and take the M16 (with magazines)... How to?
Nov 7 2001, 21:36
I'm not sure if this works, I just thought of it. You might be able to simulate the AI guy picking up the weapon by making a trigger that will AddWeapon "M16" and AddMagazine "M16".
Or you could add the weapon with a script and use playmove command to simulate picking up the weapon.
This is just a theory, I haven't tested it yet.
Yes, should work but it's not the same thing...
If you can use "talk menu / action" to tell to an AI to get the weapon i should can do the same thing using triggers and scripting...
I suppose could be made simply using action["TAKE"] but... Take what? Where?
Nov 8 2001, 11:58
I don't think there's a way to command him to pick up a weapon in scripting, the AI will only pick up ammo if he's low, and thats if he's already got a weapon in his hand.
I think I have an idea. I just tested it out.
You start of with a soldier with no weapons, you make him move to the crate, and use "playmove" command to make him bend down and pretend to pick up a weapon, and you set up a trigger in "switch" mode that is activated after the playmove command is complete, and in the activation field of that switch type
aP AddMagazine "M16"; aP AddWeapon "M16"
and as if by magic the weapon appears out of thin air (or crate). It has to be well timed to look good.
There is a script to do this evidently.
Go to this URL:
Then do a text search for the following:
Easy -Getting an AI Player to rearm (by Mox)
It is a ZIP file to download. I have never tried it, but remembered seeing it on that page and thought it may help you.
Hope this helps.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.