Creating a Mag System with a Unlocking System and Copy Array Information and Transfert to other Array

Sorry for the bad English! but I want to talk about this I hate that i think i have the theory of what i need to do.
But i don’t know how to do it? and i don’t know where to learned what i need to know better

Pretty much i am working like i say on the stream on a Mag System and i Know that Array is the best way to handle it
But also i am using a system for unlocking more mags [ 4 , 5 , 6 ] you start with 3 mags and as you progress you get more

On top of that i am doing the if there is a bullet on the chamber and i think that is working fine in theory i think? like try to be very realistic system of gun system i guess

so the theory is that when you unlock a new mag you copy the current array info and pass it to the new one and then repeat the process until we reach unlock 6 mags but i don’t know how to grab the values of 1 Array and then transfer to the next one.

the theory is something like this i guess? but i don’t know what to do due i don’t know array and how they work correctly

i am still don’t know very well how to even work the array in self but yeah indeed is the best way to work this is just sucks on how to find information and stuff like that but i am pretty sure that is the way i can make the system work correctly and i know that you can just grab the data of array and move to and other one and then set that one as the new array system for the mags system is just i lack the knowlegs to do it

also i am still thinking on how to refill mags or the slots? like if you pick a new mag it will remove the mag with less ammo but still don’t know very well how to handle that still thinking about it

I don’t know if some one will help me out with this one or even read it but if you try to help me out i will be very grateful but usally i never get responds when i ask question of bluepritns stuff and this is a more complex situacion i guess too

I suspect you don’t get many responses, because it’s pretty much impossible to debug some else’s code :wink:

I can tell you, though, if you want to copy one array to another, it’s just

image

1 Like

what happen to the info that is on array 2

for example Array 1 has 3 index with diffrent values right? but array 2 will have 1 additional value that is already set if use array 1 to set array 2 what happen to that value inself?

something like this

Array 1
Index 0 10
Index 1 9
Index 2 12

Array 2

Index 0 0
Index 1 0
Index 2 0
Index 3 15

what happen to the Index 3 of Array 2? it keep as 15 or it become like 0 due array 1 don’t have that index 3?

Array 2 just becomes an exact copy of Array 1 :slight_smile:

( there will be no index 3 )

then is not a good solution for the problem of progressing saddly

1 Like

If you want to only overwrite the existing parts, then you just have to write your own array copy code :slight_smile:

I try to do the example better I guess?

so you start using array 1 until you unlock the new mag that is a new Array so the idea is transfer the data of array 1 of that moment to Array 2 like the example that i draw and so on until array 5

the thing is that i don’t know how to handle array at all i don’t know for the moment how it works or coded it on the blueprint but i know the theory of it?

this is so far the code in theory but i don’t know how to connect the stuff and i know i missing parts to make it work

for example Max Of Int Array i can use it to get the mag with the most bullet on the array and use that on the gun like in modern shooters where you always select the full or close to full mag rather than the empty or cycle between mags

but i don’t know how to connected to the system

I think the Set Array Elems it can be use to refill the mag when they reach 0 and it will be reset to max mag ammo to the item with the lower value of all the items of the array sound logical?

You don’t need arrays to do mags :slight_smile:

Each mag has a number of bullets, right? That’s an int. One int.

You only need ONE array to do ALL mags. Each int in the array, is how much is in each mag.

If have 3 mags, first is empty, second has 2 bullets, and the third has 15, it looks like this

If you want to re-shuffle the bullets, it just means moving those integers.

I get that from the start but you can’t add a new index into the array for as far i know , i am trying to do a Unlock Progression system for the mags is not a static array with always 3 mags

Yes, you can :slight_smile:

image

will add an extra index on the end.

Or

image

will create the index if it does not exist.

After a few days and alot of talking with other ppl they teach me how to work with array and i learnd how to do a Mag System with Unlocking or expansions! thank you for give me some dirrection where to look at it was hard to get it at the start

everything else need it i will share the solution here so other can find there way to creatying mag system too!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.