Page 1 of 2
Spawning with less than the maximum ammunition.
Posted: Mon Jul 26, 2010 4:28 pm
by fasty
Is it possible to have a unit spawn with say, 100 out of a max of, 200 shots for his rifle? Can he start out with less than the max amount of ammo and can get more?
Re: Spawning with less than the maximum ammunition.
Posted: Mon Jul 26, 2010 4:31 pm
by mswf
I don't remember that that's possible.
Re: Spawning with less than the maximum ammunition.
Posted: Mon Jul 26, 2010 4:31 pm
by myers73
never seen it done
Re: Spawning with less than the maximum ammunition.
Posted: Mon Jul 26, 2010 4:52 pm
by fasty
Yeah, I don't think its possible

. I've been fooling around with my units odf. Tried adding stuff like, WeaponAmmo = 5/10 and such, but no success

.
Re: Spawning with less than the maximum ammunition.
Posted: Mon Jul 26, 2010 5:47 pm
by Darth_Squoobus
Expirement and find out.
Re: Spawning with less than the maximum ammunition.
Posted: Mon Jul 26, 2010 8:08 pm
by DarthD.U.C.K.
editing the units odf wont work since the ammorelated lines only control the absolute ammo you can have
Re: Spawning with less than the maximum ammunition.
Posted: Tue Jul 27, 2010 4:57 pm
by Lagomorphia
When you change class you have less than full ammo and abilities such as sabotage can reduce things, so it's probably possible but also probably complicated.
Re: Spawning with less than the maximum ammunition.
Posted: Tue Jul 27, 2010 8:30 pm
by fasty
Yeah, I thought about using the sabotage bonus :cantina: . I still would rather figure out how it works, though.
It wouldn't work for what I want also.
Re: Spawning with less than the maximum ammunition.
Posted: Tue Jul 27, 2010 8:47 pm
by Fiodis
The sabotage bonus, I think, deals a certain amount of damage to a side's vehicles immediately upon them spawning - it has nothing at all to do with ammo, and cannot be applied here. Changing classes preserves the amount of ammo you have at the moment - if you change classes while you have full ammo, you will respawn as your new class with full ammo. That effect, also, can't be applied here.
In fact, I don't think there is any way to do this.
Re: Spawning with less than the maximum ammunition.
Posted: Tue Jul 27, 2010 9:06 pm
by fasty
Wouldn't surprise me if it isn't possible. Just a little idea I had for my map

. I'm still experimenting of course. If anyone has any suggestions of what I could try, just throw them at me.
Re: Spawning with less than the maximum ammunition.
Posted: Wed Jul 28, 2010 2:44 pm
by Lagomorphia
Maybe there is a way to make the units 'use' 50% of their ammo as they spawn?
Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 5:42 am
by lucasfart
Thats a good idea, but i can't really see how you would implement it in the lua...
Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 10:11 am
by CressAlbane
Or when after he spawns use a setproperty to make his ammo higher?
Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 10:30 am
by lucasfart
That might work. Give it a try and tell us if it works

Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 10:36 am
by Fiodis
Lagomorphia wrote:Maybe there is a way to make the units 'use' 50% of their ammo as they spawn?
You cannot force a unit to fire a weapon via lua, so no.
CressAlbane wrote:Or when after he spawns use a setproperty to make his ammo higher?
Example Finder gives no instance of "CurAmmo" or "CurAmmunition" anywhere. You can use SetProperty with CurHealth to play with health, but you can't use it to affect ammunition.
In short, I don't think there's any way to do this. Feel free, of course, to say "but maybe if we did
this", but fully expect someone to post a reason why you can't.
Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 5:54 pm
by fasty
Maybe something along these lines, or am I totally off?
Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 6:53 pm
by Fiodis
fasty wrote:Maybe something along these lines, or am I totally off?
By the way, it doesn't work. What a surprise.
Fiodis wrote:Example Finder gives no instance of "CurAmmo" or "CurAmmunition" anywhere. You can use SetProperty with CurHealth to play with health, but you can't use it to affect ammunition.
Indeed, what an unexpected surprise.

Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 7:09 pm
by [RDH]Zerted
Spawning and attempting to increase the max ammo count would mostly likely (if it is possible) crash the game in MP. I know messing with weapons almost always causes crashes.
I don't know if an ammo pick-up could have a negative ammo count, which in theory would cause anyone picking it up to lose ammo. If so, you could try creating one directly on the locations of any spawning units.
Re: Spawning with less than the maximum ammunition.
Posted: Thu Jul 29, 2010 11:37 pm
by SW_elite
I was thinking of something along those lines but I didn't bother posting because I have no clue how to get it working.
Re: Spawning with less than the maximum ammunition.
Posted: Fri Jul 30, 2010 1:33 am
by fasty
It's a great idea but I don't know how to get it working either. Whenever I mess with the com_item_powerup_ammo, nothing happens in game although, I noticed it does munge it in VisualMunge. I can't get it to subtract ammo, or add any.