Ammo dispenser/recharger?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Silver_Ibex

Member
Feb 27, 2001
654
0
16
I need the code for an ammo dump/storage crate actor to replace the standard UT power ups.

What it needs to do, is when a player walks over it, it should check the weapons they are carrying against a list and then sets those weapons they have back to a specified ammo amount, sort of like the ammo crates from the Half-Life mod Firearms.

It needs to remain in place; it is a dispenser, not a pickup item.

I was curious as to how you would implement such a feature, any suggestions?
 

Postal

I apear to have lost my pin.
Nov 14, 1999
1,388
0
0
WoD.BeyondUnreal.com
The WAR mod was going to make one of these, were were going to have the actor just do a loop thru the players inventory, then upon any ammo types it finds, it would set them to have the max ammo. We planed to have a pickup, a zone, and a touchpad that would do that.

Well good luck.
 

Techno JF

He Who Has Powerful Words
I see it as being implemented as an actor subclassing the Triggers class. That way, you can put a regular trigger wherever you want the actor to have an effect, and you can just have the triggers activate the actor. This also enables you to use a single one of these actors that is referenced by multiple triggers.

I also see it as containing at least these variables:
Code:
var() class<Weapon> WeaponChecks[16];
var() int AmmoValues[16];
var() bool bKillInitialAmmo;

The first array is a list of weapon classes to check the player's inventory for. The second array is used to determine how much ammo to give the player. The boolean variable would just add the amound of ammo in the second array to the player's inventory if it was False, or it would reset the player's AmmoCount to that exact number if it were True.

With this construction, you can just put specific values into the actor's default properties to make the actor behave the way you want it to in its natural state. For example:
Code:
defaultproperties
{
   WeaponChecks[0]=class'Botpack.ShockRifle'
   AmmoValues[0]=50
}
This would mean that the actor would bring the player's ammocount for the Shock Rifle up to 50, simply because these values would already exist in the actor when it was spawned.