Jump to content

Newbie to coding


STOOPMAN

Recommended Posts

28 minutes ago, SMG_Man said:

so take what I'm suggesting with a grain of salt; this is how I would do it, not necessarily the only (or even the best) way to handle it.

 

With what you're describing up there, you probably need to have a separate ammo from bullets that your weapon actually fires (which will be the number shown on the left side in the default status bar). Using some form of number-checking code, when reloading the gun would check how much ammo is left in the magazine (if any), then take however many "Bullets" are needed in order to put the magazine back up to 30 ammo. E.g., if the magazine is empty, it will take away 30 bullets and give you 30 mac-10 ammo; if the magazine has 8 rounds left, it will take away 22 bullets and give you 22 more mac-10 ammo for the magazine. I would offer an actual example of this, but I'm not that good at writing DECORATE code without referencing other stuff.

 

Which leads into my next point - like Act mentioned, it's a good idea to check out how others do similar stuff. Either go through the Brutal doom package, or maybe find a weapon on Realm667 that already functions like this and see how it handles reloading.

stupid question but should I use Zscript or decorate for my weapons, after searching around it seems that Zscript is more compatible with reloads

Share this post


Link to post
3 minutes ago, STOOPMAN said:

stupid question but should I use Zscript or decorate for my weapons, after searching around it seems that Zscript is more compatible with reloads

 

It depends on how familiar you are with coding in general. If you have experience with coding in languages like Javascript or C++, then you'll probably have a better time with ZScript. On the other hand, if you're like me and have absolutely no outside coding experience, it may be easier to stick with DECORATE.

 

This is difficult for me to say if one's "better" than the other, so give both an honest shot before deciding "Okay, this is the one I want to do all my coding in". See which one makes more sense to you.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...