x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Ammo Magazine System / Array Useage Help please!

I have an advanced ammo system that I've been working on that accounts for actual magazines which are put into an array of magazines. This system works great. Say you have 3 mags (12 rounds each), you fire 5 out of MAG0, reload, fire 12 out of MAG1, reload, fire 12 out of MAG3, reload, it cycles back to MAG0 with 6 rounds left over from before.

I'm working on a magazine repacking system with "Ammo Boxes" but I've hit a snag and maybe I'm missing something... I'll post what I have so far.

Here's the set up of the Mag system on start, works great. alt text

Here's the set up of the ammo repacking item when you click on it to use it, I've annotated a few points: alt text

Basically what I'm wanting in the end is for when the player uses the ammo box, it repacks, each mag in the Array from Mag0 to however many are left until the ammo box runs out of bullets or all the mags are full. I'm storing the completely empty mags in a different variable for now and will deal with that later (I'll end up adding them back to the array and adding delicious bullets into them if there's remaining ammo in the box after repacking current mags)

There's a step I'm missing and I'll post specifically where alt text

How do I tell it that for each loop, it should grab the proper index and add ammo to that proper magazine? Am I even doing this correctly or is there a better mathy way than going "full yet? nope, add one. full yet? nope, add one. etc etc etc" Because right now it basically just checks if the mag is full yet, if the ammo box is empty, adds one bullet, subtracts one bullet from the box count and loops until there's a stop. I feel like there's a better way of running through an array and doing the same action, I just can't quite figure it out or maybe there's a better node I haven't heard of that can do some math on the whole array at once to any of the mags that are less than full?

Any help on this would be GREATLY appreciated. I'm a bit new with blueprints but really starting to dig my teeth into it and I'd love to learn something from this if anyone has some better nodes or ways of accomplishing this! Thanks!!

Product Version: UE 4.8
Tags:
more ▼

asked Feb 26 '16 at 05:54 AM in Blueprint Scripting

avatar image

NineHydras
13 3 6 14

avatar image Kitav Apr 23 '18 at 06:06 PM

i know this post is a couple years old, but did you ever figure this system out? If so would you be willing to share your work? I'm designing a game that uses a magazine system like you have and just can't figure it out.

avatar image goncasmage Apr 23 '18 at 08:17 PM

Make a new post and label it with "blueprint scripting", i'll help you with that ;)

avatar image Kitav Apr 24 '18 at 04:14 AM

Thanks, i posted it. The title is "Help with blueprint for ammo into magazines". Any help is greatly appreciated.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question