Then just do what Garry said.  There is nothing stopping you from using
a single 320 element array instead of a 32x10 array.
All you have to do us manually index into it for the current magazine.

Ammo[ammo_type * 10 + magazine]

or

Ammo[ammo_type * 10 + (magazine % 10)]

if you want a circularly index the mags.

Even though it's possible, I think you're heading down a road plagued
with problems with this idea.  You're setting a maximum on the amount of
mags each type you can hold and standardizing among all types, even
though that's really not the case most of the time.  This adds extra
network data that is unnecessary.  And just from a players stand point;
rather annoying.  Because I'm not going to be able to condense my ammo
into one mag before a long fight, instead I will have to sequentially
iterate through each magazine to get to the ammo that might be 4-5 mags
away.  In the middle of a battle.  Combined with the usual time of
animation for reloads, that may be several seconds of being completely
unable to attack.  yikes.

Plus, you will also have to keep up with the last mag for each ammo
type.  Because you don't want players to have to reload....9 times just
to get to the last magazine in the group because that's the only one
with any ammo, because they changed ammo types, and were reset to the
first magazine.


Jed wrote:
Yeah but we're doing it slightly different in that you can use half
the ammo in a mag, reload which switches to the next and eventually if
you keep reloading you come back to the first which is still half
empty.

Basically for each ammo type I need to define 10 magazine slots and be
able to set/get how much ammo is in each.

- Jed

On 16/07/07, Tony omega Sergi <[EMAIL PROTECTED]> wrote:
--
[ Picked text/plain from multipart/alternative ]
i did a magazine type thing, and didn't need to change any of that.
i just divide total ammo count by the size of the magazine to get
totals.


On 7/15/07, Jed <[EMAIL PROTECTED]> wrote:
>
> No I agree - It sounded bad when I thought of it, hence wanting to
> feel out my lunacy with you folks.
>
> I cant do MyArray[320] as it's related to the ammo types carried by
> the player. Currently their just indexed as Ammo[x] where x is the
> ammo type defined in the game rules.
>
> I want to implement a magazine type system so for the ammo the player
> is carrying Ammo[x][y] would have x pointing to the ammo type and x to
> one of the magazines of that type being carried.
>
> - Jed
>
> On 14/07/07, Garry Newman <[EMAIL PROTECTED]> wrote:
> > Sounds like an awful idea, but can't you just do MyArray[320].
> >
> > Also, one thing to be aware of with CNetworkArray is that if you
> > change one element it sends the whole thing - not just the element
> > that changed.
> >
> > On 7/14/07, Jed <[EMAIL PROTECTED]> wrote:
> > > OK heres a tricky one.
> > >
> > > How can I sent a 2 dimensional array as a network variable? I.e.
> > > instead of having myArray[x] I want myArray[x][y].
> > >
> > > I've already got CNetworkArray( int, myArrray, 32 ) but how
could I do
> > > a 32 x 10 array as a network var?
> > >
> > > _______________________________________________
> > > To unsubscribe, edit your list preferences, or view the list
archives,
> please visit:
> > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > >
> > >
> >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list
archives,
> please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


--
-omega
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list
archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to