Remove ammo from magazine?

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
Gunner98
Posts: 6001
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

Remove ammo from magazine?

Post by Gunner98 »

Have been trying to delete ammo from a magazine with this:

ScenEdit_AddWeaponToUnitMagazine({guid='795bcb77-1bc0-457b-93d4-cc28fc26c0dc', wpn_dbid=1383, number=72, remove=y})

I must have something messed up because it adds the 72 weapons instead of removing them. Any ideas?

Thanks
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
hasler
Posts: 39
Joined: Mon Jul 31, 2017 8:28 pm

RE: Remove ammo from magazine?

Post by hasler »

Does putting in a negative integer work
TyphoonFr
Posts: 188
Joined: Thu Nov 23, 2017 4:27 pm
Location: FRA
Contact:

RE: Remove ammo from magazine?

Post by TyphoonFr »

Replace "y" with "true"

ScenEdit_AddWeaponToUnitMagazine({guid='795bcb77-1bc0-457b-93d4-cc28fc26c0dc', wpn_dbid=1383, number=72, remove=true})

Christophe

To all English teachers of the forum, sorry if English is not my mother language.
TyphoonFr
Posts: 188
Joined: Thu Nov 23, 2017 4:27 pm
Location: FRA
Contact:

RE: Remove ammo from magazine?

Post by TyphoonFr »

I noticed that you use 'y' instead of 'true' regularly.

For example 'Lua - Hurc Ammo delivery Stykkishólmur' in 'Northern Fury 25 Jar Heads on Ice!' :
ScenEdit_AddWeaponToUnitMagazine ({Side='USN',guid='f3fd8561-af44-4013-944f-09a77762c644',wpn_dbid= 1814,number=16,w_max=250,new=y}) --- Mk-82

A binary variable (Bool), a two possible values called 'true' and 'false'.You think 'new =y' works but in your case, you do not need to use 'new=true'

try without:
ScenEdit_AddWeaponToUnitMagazine ({Side ='USN',guid ='f3fd8561-af44-4013-944f-09a77762c644',wpn_dbid=1814, number=16,w_max=250}) --- Mk-82
Christophe

To all English teachers of the forum, sorry if English is not my mother language.
User avatar
Gunner98
Posts: 6001
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Remove ammo from magazine?

Post by Gunner98 »

Thank you - 'true' works.

The negative integer does not work, but good idea.

Thanks guys


B
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
User avatar
michaelm75au
Posts: 12467
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Remove ammo from magazine?

Post by michaelm75au »

To remove, use the 'remove=true'. The number is always positive.
Michael
Post Reply

Return to “Lua Legion”