Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Anyone?
« previous next »
  • Print
Pages: [1]

Author Topic: Anyone?  (Read 5145 times)

Offline Street_Samurai

  • Harman Smith is looking for you... Watch out
  • Initiate
  • *
  • Posts: 89
Anyone?
« on: April 14, 2009, 03:22:44 AM »
Does anyone know if it is possible to create an AMMO COUNT in RPG Maker 2K3?
If so, is it also possible to make a RELOAD command?
And have it all work?
Logged
In The Name Of Harman

Offline _JeT_

  • Exemplar
  • *
  • Posts: 1,316
  • A larger Mysterious Mystery of Mysteriousness
Re: Anyone?
« Reply #1 on: April 14, 2009, 03:32:54 AM »
Use a variable to store your ammo amount.
Then uses many conditional branches that show a picture of the number of bullets you possess; the variable.
Like this...
>Parallel process       
  >conditional branch: if variable Bullet count is X
    >show picture X

And repeat for each value.

For a reload command, you can have another variable for a clipsize, which subtracts from the ammo variable whne reloading, and then a common event that goes something like...

>parallel process         
  >key input process (check the box next to which key you want to use, note that each has a number next to it) store in variable:reload
    >conditional branch -if variable reload equals (the number next to the key from the key input process)
       >subtract X from var ammo
       >add X to var clip

For auto reload...

>Parallel process         >Activated by switch fire (this switch should be on when you fire)
  >Conditional branch if clip is 0
     >subtract X from var ammo
     >add X to var clip
  >else
     >subtract 1 from clip

This should work
Logged

Offline Street_Samurai

  • Harman Smith is looking for you... Watch out
  • Initiate
  • *
  • Posts: 89
Ahh
« Reply #2 on: April 14, 2009, 06:27:22 AM »
Alittle complicated and tedious it seems, but nontheless exactly what I was looking for.
Thank you friend, i'll just save and paste this to look at it as I learn this art.
Thanks again!
Logged
In The Name Of Harman

Offline Rahl

  • Lord Of Gamedwellers
  • Leader
  • *
  • Posts: 2,356
Re: Anyone?
« Reply #3 on: April 14, 2009, 06:35:42 AM »
If I feel like it later possibly tommorow I'll make a tutorial for this.
Logged



Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Anyone?
« Reply #4 on: April 14, 2009, 06:39:08 AM »
Found this ammo tut laying around. Hope it's useful.

Quote from: Someone
I've read many of the ammo system tutorials for the DBS on this site and I have to say that they are either not explained very well or are way too complicated. With a lot of help from Carius, I have found a simple way to track ammo use in the DBS.

You only need the most basic knowledges of variables and switches. Note that this method doesn't take reloading into account, instead treating your ammunition as individual rounds instead of clips.

First thing you need to do is create your weapon. It is a standard weapon, you don't have to do anything special to it, just name it, set its power and attack animation, and so on. Then create the individual round for that weapon, and set it as a common item. For this example we'll use a Colt 1911, we'll call it Colt 1911, for the weapon and have it fire a .45 ACP round, we'll call it .45 ACP.

Weapon Name: Colt 1911
Common Item name: .45 ACP

We'll need a variable that stores the amount of that particular round of ammo. Let's call it 45ACP. We'll also need a switch to see if your character has that particular weapon equipped. For our example, we'll call it heroEquipped1911. You'll need a different switch for each hero and ammo based weapon that hero can use.

Ammunition Variable Name: 45ACP
Weapon Check Switch Name: heroEquipped1911

We are going to create a common event with the call trigger that checks to see if your character has a certain weapon equipped. We'll call it heroCurrentWeapon. This event will have conditional statements in it, one for each of the ammo based weapons that the character can use. The conditional will check to see which weapon the character has equipped and turn the appropriate switch on or off.

Name: heroCurrentWeapon Trigger: Call
------------
<>Branch if Hero Colt 1911 Equipped
<><>Switch Operation: [xxxx:heroEquipped1911] ON
<><>
:Else Handler
<><>Switch Operation: [xxxx:heroEquipped1911] OFF
<><>
:END
<>
------------

You'll need one of these branches for each ammo based weapon they can use. All of these branches go under the same common event, the one that checks the equipped weapon for that particular character. If you have more characters you can also throw their branches into this same event, but giving them their own common event just like the above will make these common events much clearer to read.

In the battle events in the monster groups tab, we'll be making at least two pages of events, more if you have more gun-toting characters. One of the tabs, preferably the first, will call the weapon checking common events. Use the turns elapsed trigger and set it to 0 so that it executes at the beginning of the battle. At this point we will also set our ammo variables equal to the amount of ammunition we have. In this case our ammo variable 45ACP will be set equal to the amount of .45 ACP rounds currently in inventory.

Trigger: Turns Elapsed

---------------
<>Call Common Event:heroCurrentWeapon
<>Variable Oper:[xxxx: 45ACP]Set, .45 ACP Possessed
---------------

If your other gun characters have their own weapon checking common events, call them here, too. Also, set the variable here for every type of ammunition you have.

Now for the meat of the code. Create a second battle event page. This page will be triggered by a specific hero using the fight command. This page will check to see which weapon checking switches are on and execute the appropriate branch of code. You will need one of these pages for each character that can use ammo based weaponry.

Trigger: [Hero] uses the [Fight] command
---------------------
<>Branch if Switch [xxxx:heroEquipped1911] is ON
<><>Branch if Var [xxxx:45ACP] is 1 or more
<><><>Change Items: .45 ACP 1 Remove
<><><>Variable Oper:[xxxx: 45ACP]Set, .45 ACP Possessed
<>
<><>:Else Handler
<><><>Change Equipment:Hero Weapon Unequip
<><><>
<><>:END
<>
:END
--------------------

What this is doing is checking to see if a character is using the fight command. Then it checks to see if the weapon check switch is on, which is determined by the current weapon. If it's on, then it will go into another branch that checks the ammo variable we set in the first battle event page. If it's at least 1, then it will remove 1 round of ammunition from your inventory. It will then reset the variable to the new amount.

If you don't have enough ammo, meaning you have none, then the character will unequip their weapon and attack unarmed instead. The reason you unequip the weapon is because if you don't, the character will still use the gun despite not having any ammo for it.

All the weapons this character can use will go in this page. Other characters will have their own pages similar to this one, and you will have these same battle events for each monster group in your game.

And there it is. No fake ammo, no new skills to memorize and forget, no new battle animations, so on and so forth. Just a weapon, its ammo, a common event, a switch, a variable, and some battle event pages. Just do the same thing for each weapon you have.

Also, to help in coding, where ever I use the word hero in this tutorial, I suggest you use the name of the character it will pertain to. It will make life easier. Trust me.

Special thanks to Carius for helping me out with this in the forums.
« Last Edit: April 14, 2009, 06:40:48 AM by Prpl_Mage »
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline Street_Samurai

  • Harman Smith is looking for you... Watch out
  • Initiate
  • *
  • Posts: 89
Thank you... And also--
« Reply #5 on: April 14, 2009, 06:42:00 AM »
Ah, you humble me Purple Mage, thanks again...
Oh--
And not to be brash, but does anyone know how I could post my game somewhere for someone else to play?
As in, if I wanted my friend to play the game I was creating, a demo, or full game,
from his house, on his PC;
How would I go about doing that?
« Last Edit: April 14, 2009, 06:50:14 AM by Street_Samurai »
Logged
In The Name Of Harman

Offline Darkfox

  • These spectacles do nothing
  • Staff
  • Over 9000!
  • *
  • Posts: 10,215
    • Chaos Realm - Home of the God Beasts
Re: Anyone?
« Reply #6 on: April 14, 2009, 07:06:49 AM »
Try storing the demo on an online fileholding site like www.sendspace.com and copying the link down.
Logged



Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Anyone?
« Reply #7 on: April 14, 2009, 07:07:50 AM »
Quote from: Street_Samurai on April 14, 2009, 06:42:00 AM
Ah, you humble me Purple Mage, thanks again...
Oh--
And not to be brash, but does anyone know how I could post my game somewhere for someone else to play?
As in, if I wanted my friend to play the game I was creating, a demo, or full game,
from his house, on his PC;
How would I go about doing that?

1. You need to RAR or ZIP the project's folder.(WinRAR is used for this for example).
Make sure that ALL resources used in the game have been imported and that your friend owns a copy of RPGm2k3 and the RTP if used.

After RAR/ZIP-ing it you upload it on a website such as Rapidshare.
You copy the exact link to the page and sends it to your buddy through mail or chat.
He goes there, download the file. Unpack it into the game folder. Open the game folder, double-click the "Play icon"(guy holding sword)

2. Put the project folder on your USB memory.
Take it to your friend.
Plugg it in.
Open up the USB
Open project file
Double click the play icon.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline Darkfox

  • These spectacles do nothing
  • Staff
  • Over 9000!
  • *
  • Posts: 10,215
    • Chaos Realm - Home of the God Beasts
Re: Anyone?
« Reply #8 on: April 14, 2009, 07:13:31 AM »
PRPLs second option is easier. But Rapidshare is a bit of a jerk at times. That's why I suggest something like sendspace.com, it is a temporary storage and is pretty quick to set up. No registration required.
Logged



Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Anyone?
« Reply #9 on: April 14, 2009, 07:21:26 AM »
Quote from: Darkfox on April 14, 2009, 07:13:31 AM
PRPLs second option is easier. But Rapidshare is a bit of a jerk at times. That's why I suggest something like sendspace.com, it is a temporary storage and is pretty quick to set up. No registration required.

Actually, you don't need to register for rapidshare.
But waiting to be allowed to download is approx 30secs on rapidshare.- Being member cuts that time.
So yeah, rapidshare is slow when it comes to uploading and downloading.
BUT the file uploaded will be deleted after 60 days after last download. So you won't need like 5 different versions of a demo forever on.

The reason why I wrote rapidshare was because I couldn't think of any other hosting sites at the moment though. Any file upload site will work as long as it's RAR or ZIP.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline Darkfox

  • These spectacles do nothing
  • Staff
  • Over 9000!
  • *
  • Posts: 10,215
    • Chaos Realm - Home of the God Beasts
Re: Anyone?
« Reply #10 on: April 14, 2009, 07:30:36 AM »
Doesn't membership cost money?
Logged



Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Anyone?
« Reply #11 on: April 14, 2009, 07:33:21 AM »
Quote from: Darkfox on April 14, 2009, 07:30:36 AM
Doesn't membership cost money?

It does, but the only thing member does is:
you get a page with all your uploaded thingies.
You don't have to wait to download stuff.

But it also exists as free accounts back in the day. They've changed it now.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Anyone?
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum