OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: vrbanec on 29 Jan 2005, 21:42:15

Title: ai reload?
Post by: vrbanec on 29 Jan 2005, 21:42:15
Ok, I found out nobody knows how to make ai reload with action menu.

Is there some alternative way to make enemy solider reload when I want him to and when he doesn't actually need to?
Title: Re:ai reload?
Post by: rhysduk on 30 Jan 2005, 02:43:42
To be honest, i dont think there is.

You can SIMULATE this by using an action, but i dont think it can actually be done.

Rhys
Title: Re:ai reload?
Post by: StonedSoldier on 30 Jan 2005, 02:57:04
hows about taking his ammo away then giving it back to him?? untested tho
Title: Re:ai reload?
Post by: Rokket on 30 Jan 2005, 03:48:58
I played around with this awhile ago and gave up, but I think it's worth trying.  If I remember right, I think I got StonedSoldier's method to work somewhat - I could give them a few mags, but they didn't actually reload. I switched one to Player and saw that I sudden;y had some mags, but I had to physically slap a clip in. It could ahve been the way I was doing it, think it was a small script thru a trigger, and I'm not rerally a scripter.
Title: Re:ai reload?
Post by: Dubieman on 30 Jan 2005, 03:55:44
Can't there be an action to do it?

man action ["Reload", "M16"]

Maybe... :P
Title: Re:ai reload?
Post by: macguba on 30 Jan 2005, 13:11:14
There is apparently an action load magazine but nobody knows how it works or what it does.    You could experiment with stuff like

loon1 action ["load magazine", "M16"]
or
loon1 action ["load magazine", 0, 0, "G36aMag"]
or
all variations thereon.

and see how you get on.
Title: Re:ai reload?
Post by: bedges on 30 Jan 2005, 13:29:32
if there are so many problems doing it properly, why not cheat?

Code: [Select]
loon removemagazine "magazine_name"
loon playmove "CombatReloadMagazine"
loon addmagazine "magazine_name"

(from the comref on 'removemagazine' - "Note: you may create invalid combinations with this function. When doing so, application behaviour is undefined.")

as mentioned above, whether this actually reloads the magazine is debatable, but at least it'll look like it is ;)
Title: Re:ai reload?
Post by: vrbanec on 30 Jan 2005, 14:53:02
I made it work and it looks okay. he has to reload when he looses all his magazines and then gets them back so I made it that way. it's lot of typing, but it works.

thanks to all.
Title: Re:ai reload?
Post by: Rokket on 02 Feb 2005, 09:17:58
Can you spell out exactly what you do to make it work? Bedcause my small brain has never been succeessful...thx