Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Req] Ammo add-on


Me Gusta
 Share

Recommended Posts

I was wondering if someone could help me find out how to add an ammo system to Captain Wabbit's projectile system. I'll try my best to find out how and if I do I'll make a tutorial, but in the mean time I'm asking if anyone could find it first to post it as a tutorial. Thanks in advanced
~Me Gusta~
Link to comment
Share on other sites

  • 2 months later...
I'm trying to do this at the moment but cant seem to get it right.

I was going to have it so that in the Item Editor you have a extra value: "Ammo Type" choosing from 1-3 (Each one being different ammo types, such as Normal Rounds, Shotgun Rounds…ect) then when making weapon you select what ammo the gun uses, then if you had the ammo in your inventory it would fire weapon and if it didn't it would state no ammo.

Issue is I cant seem to get the value to stay on Item when saved, or how make client check players inventory when firing to use ammo. I'm still noobish when it comes to VB, and just looking through engine code and learning from there :P

The Extra value I copied from the "Projectiles Speed" and changed name to "Ammo".

Anyone got any idea's on this or can give a little guidance that would be awesome.

Thanks
Link to comment
Share on other sites

Why not just add a new varible to the player rec, and when you 'buy' or find ammo. It adds to that, and we you fire your gun/bow. It removes the amount you fire.

Player picks up 5 rounds > player(index).Bullets = player(index).bullets + 5 or What ever amount you picked up

Player fires 5 rounds > player(index).Bullets = player(index).bullets - 5 Or what ever amount you shot.
Link to comment
Share on other sites

Imo I wouldn't do it that way. If you have multiple types of bullets it will just create a clutter. Get 1 extra variable on the weaps, Bullettype, and whenever someone shoots loop through player inv to find bullets, if found shoot + remove 1\. That way you dont have to add silly variables.
Link to comment
Share on other sites

@Joost:

> Imo I wouldn't do it that way. If you have multiple types of bullets it will just create a clutter. Get 1 extra variable on the weaps, Bullettype, and whenever someone shoots loop through player inv to find bullets, if found shoot + remove 1\. That way you dont have to add silly variables.

I was giving a damn example, i know storing multiple variables would be silly, and you wouldn't have to create new variables for each bullet. Simply use:
```
Bullets As BulletRec
```and reduce the clutter. Variables aren't silly if you actually know how to use them.
Link to comment
Share on other sites

Again, I see what you're trying to accomplish and it would 100% work, but my question is, why? Why not use the inventory system that works perfect? Why not check for bullets in inv every time someone shoots, and remove 1 when shot fired? It seems less complicated, more user-friendly (since bullets are displayed as normal items), it allows you to easily set up a lot of different bullet types and easier to program so I wouldn't add new variables for it.
Link to comment
Share on other sites

Okay, how about if you keep track of bullets with a  player(index).Bullets instead of inventory, how will a player pick up/buy/trade bullets? If you make it an item, that's not a problem. If you set up a new variable for it, you need to set up some way to buy bullets and trade them.

I'm not saying your method wouldn't work, but if you want to add bullets programming-wise it'd be much simpler to do it from inv. Things like above are all things that'd have to be adjusted for your system.
Link to comment
Share on other sites

@Joost:

> Okay, how about if you keep track of bullets with a  player(index).Bullets instead of inventory, how will a player pick up/buy/trade bullets? If you make it an item, that's not a problem. If you set up a new variable for it, you need to set up some way to buy bullets and trade them.
>
> I'm not saying your method wouldn't work, but if you want to add bullets programming-wise it'd be much simpler to do it from inv. Things like above are all things that'd have to be adjusted for your system.

You annoy me, laziness should never supplement for clean, well organized code. Your way may be easier, but isn't as effective as what me and Stein are suggesting. You have so much more working space with our system over yours.
Link to comment
Share on other sites

Actually, my way is clean well organised code. It's using the fucking inventory system that's already in there, in contrast to your way of adding a new variable, a new way to buy items and a new way to trade items. Your way is epicly retarded. I tried saying it polite, but I annoy you? Holy shit dude, your idea is the most ineffective way to do it.
Link to comment
Share on other sites

Your forgetting that everyone does not want to have the bullets stored in the inventory. Your way may be effective, but my opinion still stands that stein's and my way of doing it is better. Don't like it? Then suck some goober berries.

Like stein said, the simple solution is not always the way to go, it really shows what kind of person you are (Likes to take the easy way out). When it only takes a bit more effort to improve a system.
Link to comment
Share on other sites

The easy way is the best way, for all those reasons I mentioned like the shop system, like dropping bullets, like trading them. To code everything like that again for bullets with absolutely no gain other than using more data is absolutely fucking stupid. You've never even given a single reason as to why your system is better, Ill tell you why, because it's not.
Link to comment
Share on other sites

@Joost:

> The easy way is the best way, for all those reasons I mentioned like the shop system, like dropping bullets, like trading them. To code everything like that again for bullets with absolutely no gain other than using more data is absolutely ducking stupid. You've never even given a single reason as to why your system is better, Ill tell you why, because it's not.

> Rarely do we find men who willingly engage in hard, solid thinking. There is an almost universal quest for easy answers and half-baked solutions. Nothing pains some people more than having to think.

- Martin Luther King

You want a reason of why the extra trouble would be worth it? Well i have one word, Dynamic.

And where do you get the idea that you would have to reprogram all those systems? You can simply have a method that when a certain item is picked up (Shotgun Bullet) it is stored in the bullet rec.
```
Player(index).bullets.Shotgun = Player(index).bullets.Shotgun + Amount
```
Link to comment
Share on other sites

Dynamic what? What could you possibly need that you cant use the item data for?

Because I think you have absolutely no clue what you are talking about all I'm going to do is post the ItemRec so you can see how much easier + perfect it is to use that. Trying to argue with retards is a waste of my time.

```
Private Type ItemRec
    name As String * NAME_LENGTH
    Desc As String * 255
    Sound As String * NAME_LENGTH

    Pic As Long

    Type As Byte
    Data1 As Long
    Data2 As Long
    Data3 As Long
    ClassReq As Long
    AccessReq As Long
    LevelReq As Long
    Mastery As Byte
    price As Long
    Add_Stat(1 To Stats.Stat_Count - 1) As Byte
    Rarity As Byte
    Speed As Long
    Handed As Long
    BindType As Byte
    Stat_Req(1 To Stats.Stat_Count - 1) As Byte
    Animation As Long
    Paperdoll As Long

    AddHP As Long
    AddMP As Long
    AddEXP As Long
    CastSpell As Long
    instaCast As Byte
End Type

```
PS, if you actually think doing complicated stuff for no reason at all (0) is good programming then you really should not be posting in the help section.
Link to comment
Share on other sites

@Joost:

> Dynamic what? What could you possibly need that you cant use the item data for?
>
> Because I think you have absolutely no clue what you are talking about all I'm going to do is post the ItemRec so you can see how much easier + perfect it is to use that. Trying to argue with retards is a waste of my time.
>
> ```
> Private Type ItemRec
>     name As String * NAME_LENGTH
>     Desc As String * 255
>     Sound As String * NAME_LENGTH
>    
>     Pic As Long
>
>     Type As Byte
>     Data1 As Long
>     Data2 As Long
>     Data3 As Long
>     ClassReq As Long
>     AccessReq As Long
>     LevelReq As Long
>     Mastery As Byte
>     price As Long
>     Add_Stat(1 To Stats.Stat_Count - 1) As Byte
>     Rarity As Byte
>     Speed As Long
>     Handed As Long
>     BindType As Byte
>     Stat_Req(1 To Stats.Stat_Count - 1) As Byte
>     Animation As Long
>     Paperdoll As Long
>    
>     AddHP As Long
>     AddMP As Long
>     AddEXP As Long
>     CastSpell As Long
>     instaCast As Byte
> End Type
>
> ```
> PS, if you actually think doing complicated stuff for no reason at all (0) is good programming then you really should not be posting in the help section.

Did you ever consider that a person may want more then one damn bullet type? They are still going to have to put it in the damn item rec! Please stop arguing on this matter, you look rather ignorant.
Link to comment
Share on other sites

Lol, are you a moron? If they want more than 1 bullet type they can create more than 1 bullet items. It would work 100% perfect w/o modifications, with as many different bullets as you want. All that has to be done is finding the bullet in inv and taking it away when shooting. Any bullet data you want you can store in the itemrec. Do you really not understand basic programming?

BTW, so far u've given 0 actual arguments and instead say stupid shit like my way'd only work for 1 bullet, which again gives me the impression you don't know how to program and are just saying something you heard someone else say./
Link to comment
Share on other sites

God damn your annoying, consider the fact that someone may want more advanced systems then just taking the damn bullet out of the inventory. Such as random damage, animations, in pact chances, etc. Storing different bullets in a rec would allow that to be done easily.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...