Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

4 Pages V   1 2 3 > »   
Closed TopicStart new topic
> [Disposable Ammo], Version 1.0 since September 10, 2008
cmpsr2000
post Aug 27 2008, 02:21 PM
Post #1


Keeper of the Ruby Code of DOOM!
Group Icon

Group: Revolutionary
Posts: 355
Type: Scripter
RM Skill: Masterful




Disposable Ammo

Version: 1.0
Author: Cmpsr2000
Release Date: September 10, 2008

Introduction
This script allows for the definition of Ammunitions and weapons that can consume them.


Features
  • Create an unlimited number of ammo "types."
  • Fire more than one type of ammo per weapon.
  • Deplete ammunition with skills as well as attacking.
  • Limit the amount of ammo equipable for each weapon (clip size)
  • Reload ammo automatically or by using a skill.


Script

Attached File  Redefinitions.txt ( 18.11K ) Number of downloads: 385

Attached File  Ammo.txt ( 2.78K ) Number of downloads: 301

Attached File  Game_Ammo.txt ( 4.84K ) Number of downloads: 290



Customization


General customization:
CODE
#-------------------------------------------------------------------------------
#
# This script allows for the definition of Ammunitions and weapons that can
# consume them. To build an ammunition type, first add the name to the Ammo
# Vocab entry in the redefinitions section of the script.
#
# To declare a weapon in the database as an ammunition:
# Include the name of the ammo type surrounded by <> in the notes field.
# for example: <arrow>
#
# To declare a weapon that consumes ammunition:
# Include the term uses: followed by the ammo type surrounded by <> in the
# notes field. for example: <uses:arrow>
#
# NOTE: Weapons can use more than one type of ammo! Include multiple tags
# for each ammo type you wish to be equipable.
# For example: <uses:bullet> <uses:grenade>
#
# To restrict the maximum equipable ammo for a weapon:
# Include the max: attribute in the uses tag followed by the amount.
# For example: <uses:bullet max:30>
#
# NOTE: If you include max: for one ammo type on a weapon, you must include
# it for ALL ammo types for that weapon!
#
# To reload ammunition when using ammo-restricted weapons:
# Include the reload tag in the notes of the skill.
# For example: <reloads>
#
# To use ammo with skills:
# Include the spendsAmmo tag followed by the amount to spend in the notes
# field of the skill.
# For example: <spendsAmmo:3>
#
#-------------------------------------------------------------------------------


In Redefinitions::

Set ammo type names and the generic ammo term here:
CODE
module Vocab
#-----------------------------------------------------------------------------
# You can define the names of your ammo types here. These are the terms used
# in the notes field to delcare items as part of the system
#-----------------------------------------------------------------------------
Ammo = [ #Ammo1 Name
"Arrow",

#Ammo2 Name
"Bullet",

#Ammo3 Name
"Grenade"
]
AmmoGeneric = "Ammo"
end


To add your own damage calculations for ranged weapons:
CODE
#-----------------------------------------------------------------------------
# includes the calculations for weapons that use ammunition
#-----------------------------------------------------------------------------
def hit
if two_swords_style
n1 = weapons[0] == nil ? 95 : weapons[0].hit
n2 = weapons[1] == nil ? 95 : weapons[1].hit
n = [n1, n2].min
elsif weapons[0] != nil and weapons[0].usesAmmo?
n1 = weapons[0].hit
n2 = weapons[1] == nil ? 95 : weapons[1].hit
case $game_ammo.hitRateCalcType
when 0 #addative
n = n1 + n2
when 1 # average (rounds up)
n = ((n1 + n2).to_f / 2).ceil
when 2 #average (rounds down)
n = (n1+ n2) / 2
when 3 #min
n = [n1, n2].min
when 4 #max
n = [n1, n2].max
#-------------------------------------------------------------------------
# scripters can add their own damage calulation for ranged weapons here
# by adding additional "when" statements to the case
#-------------------------------------------------------------------------
end
else
n = weapons[0] == nil ? 95 : weapons[0].hit
end
return n
end


In Game_Ammo:

Select which damage formula to use:
CODE
#---------------------------------------------------------------------------
# set the type of hit calculation for ammos here
# 0: Addative (weapon dmg + ammo dmg)
# 1: Average (rounds up)
# 2: Average (rounds down)
# 3: Min
# 4: Max
#---------------------------------------------------------------------------
@hitRateCalcType = 0


Set auto-reloading behaviors:
CODE
#---------------------------------------------------------------------------
# Set this to true if you would like the characters to automatically
# reload their weapons when they expend equiped ammunition.
#---------------------------------------------------------------------------
@autoReload = false

and
CODE
#---------------------------------------------------------------------------
# Set this to true to enable the system to search for the first available
# equipable ammo. Set to false to disable this capability.
#---------------------------------------------------------------------------
@allowBlindReload = true


Compatibility
Requires RGSS2. (RMVX)

EXTENDS:
  • RPG::BaseItem
  • Vocab
  • Game_Actor

REDEFINES:
  • Scene_Title.create_game_objects
  • Scene_Battle.execute_action_attack
  • Scene_Battle.]execute_action_skill
  • Window_ActorCommand.setup
  • Game_Actor.skill_can_use?
  • Game_Party.gain_item
  • Window_Equip.refresh

OVERRIDES:
  • Scene_Battle.update_actor_command_selection
  • Game_Actor.hit
  • Game_Actor.weapons
  • Game_Actor.armors
  • Game_Actor.change_equip_by_id
  • Game_Actor.change_equip
  • Game_Actor.skill_effect
  • Window_EquipItem.include?



Screenshot
Coming Soon! (running out of time before class @.@)


DEMO
Attached File  Disposable_Ammo.zip ( 897.28K ) Number of downloads: 1012


Installation
Copy the script files into your game under the materials section. Configure database according to customization instructions!


Todo List:
  1. Increase Compatibility
  2. Add "quiver" system if possible


FAQ
None yet!


Terms and Conditions
Feel free to use this in your game, but please give me a shout in the credits! Also, feel free to edit this for your own personal purposes but please do not repost an edited version without my consent first.

Thanks ^^/


__________________________
Go to the top of the page
 
+Quote Post
   
Lukedevoux
post Aug 27 2008, 05:16 PM
Post #2


Level 11
Group Icon

Group: Revolutionary
Posts: 181
Type: Developer
RM Skill: Beginner




I was wondering, if you used the skills, Dual, Double or Tripple Attack (or any skill but those where the three skills set in for the character), shouldn't the Ammo be depleted as well?


__________________________
[Show/Hide] Knights of the old Republic Joke

There are two Mandalorians are out in the woods. One of them collapses. He doesn't seem to be breathing and his eyes are glazed. The other Mandalorian takes out his communicator and contacts his commander. He gasps: "My partner has collapsed! I don't know what to do!" After a moment, the commander responds: "Calm down. I can help. First let's make sure your partner is dead." There is a silence then a blaster shot is heard. Back on the communicator, the Mandalorian says: "Okay, now what?"

Go to the top of the page
 
+Quote Post
   
cmpsr2000
post Aug 27 2008, 06:10 PM
Post #3


Keeper of the Ruby Code of DOOM!
Group Icon

Group: Revolutionary
Posts: 355
Type: Scripter
RM Skill: Masterful




QUOTE (Lukedevoux @ Aug 27 2008, 07:38 PM) *
I was wondering, if you used the skills, Dual, Double or Tripple Attack (or any skill but those where the three skills set in for the character), shouldn't the Ammo be depleted as well?


Yeah that's on the todo-list for the "real" release. I just needed to see if everything that is already implemented actually works. laugh.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Netto
post Aug 27 2008, 06:26 PM
Post #4


芸術家
Group Icon

Group: Revolutionary
Posts: 708
Type: None
RM Skill: Skilled




Great job Cmpser laugh.gif


__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting
Current Project[VX]: Obsidian Trilogy just started 08/12/2008
Current Project[XP&RM2K3]: none
Go to the top of the page
 
+Quote Post
   
Poko4Sho
post Aug 27 2008, 06:36 PM
Post #5


Poko2Pro
Group Icon

Group: Revolutionary
Posts: 366
Type: Writer
RM Skill: Masterful




So could I use this to make disposable arrows? I mean, I know you said ammo and are thinking what would be the difference, I just wanna make sure. And is this just for a Action battle system or what?

Also, your link is broken...I think, its giving me a page load error when I click it.


__________________________
Go to the top of the page
 
+Quote Post
   
Lukedevoux
post Aug 27 2008, 07:16 PM
Post #6


Level 11
Group Icon

Group: Revolutionary
Posts: 181
Type: Developer
RM Skill: Beginner




QUOTE (Poko4Sho @ Aug 27 2008, 06:58 PM) *
So could I use this to make disposable arrows? I mean, I know you said ammo and are thinking what would be the difference, I just wanna make sure. And is this just for a Action battle system or what?

Also, your link is broken...I think, its giving me a page load error when I click it.


The link isn't actually broken, he just posted it backwards, so you just need to Copy + Paste, the http that's posted as a link.


__________________________
[Show/Hide] Knights of the old Republic Joke

There are two Mandalorians are out in the woods. One of them collapses. He doesn't seem to be breathing and his eyes are glazed. The other Mandalorian takes out his communicator and contacts his commander. He gasps: "My partner has collapsed! I don't know what to do!" After a moment, the commander responds: "Calm down. I can help. First let's make sure your partner is dead." There is a silence then a blaster shot is heard. Back on the communicator, the Mandalorian says: "Okay, now what?"

Go to the top of the page
 
+Quote Post
   
Rukaroa
post Aug 27 2008, 07:20 PM
Post #7


Level 4
Group Icon

Group: Member
Posts: 52
Type: Event Designer
RM Skill: Beginner




Can you make ammo equippable? Say you use the "two swords style" option. One hand holds the weapon, the other holds the ammunition and it would have a specified number of shots.


__________________________
Go to the top of the page
 
+Quote Post
   
cmpsr2000
post Aug 27 2008, 09:55 PM
Post #8


Keeper of the Ruby Code of DOOM!
Group Icon

Group: Revolutionary
Posts: 355
Type: Scripter
RM Skill: Masterful




QUOTE (Poko4Sho @ Aug 27 2008, 08:58 PM) *
So could I use this to make disposable arrows? I mean, I know you said ammo and are thinking what would be the difference, I just wanna make sure. And is this just for a Action battle system or what?

Also, your link is broken...I think, its giving me a page load error when I click it.


Fixed it.

QUOTE (Rukaroa @ Aug 27 2008, 09:42 PM) *
Can you make ammo equippable? Say you use the "two swords style" option. One hand holds the weapon, the other holds the ammunition and it would have a specified number of shots.


Yes, that is exactly what this script does. However, you do not need to specify 2 swords style. The system is smart enough to know that if you equip an ammo you need a weapon to use it and vice versa.


__________________________
Go to the top of the page
 
+Quote Post
   
Rukaroa
post Aug 28 2008, 04:53 AM
Post #9


Level 4
Group Icon

Group: Member
Posts: 52
Type: Event Designer
RM Skill: Beginner




QUOTE (cmpsr2000 @ Aug 28 2008, 12:17 AM) *
Yes, that is exactly what this script does. However, you do not need to specify 2 swords style. The system is smart enough to know that if you equip an ammo you need a weapon to use it and vice versa.


I just tried the demo and haven't found a problem yet. Keep it up!


__________________________
Go to the top of the page
 
+Quote Post
   
The Wizard 007
post Aug 29 2008, 02:57 PM
Post #10


Jack of all trades
Group Icon

Group: Revolutionary
Posts: 118
Type: Developer
RM Skill: Skilled




Hey Composer. I must say that was fast in getting a beta-demo up. The script works well in the demo and I haven't noticed any bugs. I'm going to try it on a project with several scripts to see if their is any incompatability. Nice work on the setup it's nice and smooth and makes sense.

A feature I would really like to see is possibly a reload option, where Handgun A for instance can hold 10 rounds and if all 10 rounds are used the user must reload the weapon provided their is sufficient ammo to do so, maybe make it into a skill called 'reload'. I know this would take some editing of the battle menu and such and may cause some incompatibilies but it would be great to see. You could even put shots left/ max shots in the equip menu like the ammo. Like Handgun A 4 / 8.

Another feauture would be a use multiple ammo per attack. For instance Machine Gun A needs to use 5 rounds per attack or if there is say 3 rounds remaining it'll just do 3 shots instead of the 5 for less damage.

I understand these may be a pain or maybe you've already taken these into consideration. Just my two-cents.

Keep up the amazing work that you do.



__________________________
Currently working on:

Underground Syndicate (mafioso/modern type RPG)
Mind Maze (old school dungeon crawler with a different feel)
Dragon Adventure (Dragon Quest type fangame with more customization)
Dark Grind (Survival horror RPG)
Go to the top of the page
 
+Quote Post
   
Rukaroa
post Aug 29 2008, 04:13 PM
Post #11


Level 4
Group Icon

Group: Member
Posts: 52
Type: Event Designer
RM Skill: Beginner




Ah, to add to the suggestions, instead of having ammunition that shows how much you have left, I was thinking if there could be an option of having clips/magazines/quivers that have a specific number of ammunition. As the script stands right now, ammo seems like it will run out fast and keeping a healthy supply will be tough without having items that hold multiple shots.

This post has been edited by Rukaroa: Aug 30 2008, 05:23 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Shadow Lord
post Aug 30 2008, 05:05 AM
Post #12


Level 2
Group Icon

Group: Member
Posts: 23
Type: Developer
RM Skill: Masterful




Is there any way you could make this compatible with the Tankentai SBS? If you can, thank you so much!
Go to the top of the page
 
+Quote Post
   
Mr. Bubble
post Aug 30 2008, 05:59 AM
Post #13


If I see one more Face Maker avatar...
Group Icon

Group: Revolutionary
Posts: 599
Type: Developer
RM Skill: Intermediate




If you want to use this with the Tankentai SBS, please read this!

Go into your Config script and find these lines which are near the top of the configurations:

CODE
  # Damage% modifications when using two weapons
  #                   1st Atk, 2nd Atk
  TWO_SWORDS_STYLE = [50,100]


Change TWO_SWORD_STYLE to:
CODE
  # Damage% modifications when using two weapons
  #                   1st Atk, 2nd Atk
  TWO_SWORDS_STYLE = [100,50]


The "2nd Atk" variable can be any value you want, just make sure "1st Atk" is 100. To put it simply, the SBS recognizes the Ranged Weapon+Ammo as Two-Swords Style. Thus, the damage from the Ranged weapon will be 50% unless you change the TWO_SWORDS_STYLE "1st Atk" percentage to normal. In my next release, I'll have [100,50] as the default so no confusion happens.

If anyone wants to use the ammo script with Tankentai, please use a specialized ranged attack addon such as Kylock's Bow Addon. If you don't, the actor will walk up to the monster and hit it two times.

Otherwise, everything I've checked works well with the Tankentai SBS. Nice job, cmpsr. biggrin.gif
Go to the top of the page
 
+Quote Post
   
cmpsr2000
post Aug 30 2008, 11:41 PM
Post #14


Keeper of the Ruby Code of DOOM!
Group Icon

Group: Revolutionary
Posts: 355
Type: Scripter
RM Skill: Masterful




Good deal. I'm glad this is working well for the most part. I am at dragon-con at the moment, but as soon as I return and have a little more time I'll post the new version with all the fixes and some of the mentioned improvements.


__________________________
Go to the top of the page
 
+Quote Post
   
cmpsr2000
post Sep 2 2008, 06:07 AM
Post #15


Keeper of the Ruby Code of DOOM!
Group Icon

Group: Revolutionary
Posts: 355
Type: Scripter
RM Skill: Masterful




QUOTE (ZeroArtist @ Sep 2 2008, 07:31 AM) *
Hey, I am the only guy who has a problem with it sad.gif

I get this error when the game even tries to start:

I copied the three scripts at the end of the demo (Redefinitions, Ammo and Game_Ammo) and also made arrows and a bow at the moment.
I haven't made any bullets, grenades or any weapons that need them yet.

Can you help me find what the problem is?


I'll take a look at it today and see if I can replicate the problem.


__________________________
Go to the top of the page
 
+Quote Post
   
GuyInTraining
post Sep 2 2008, 11:01 PM
Post #16


Aiming for 999999 graze points on UFO
Group Icon

Group: Revolutionary
Posts: 244
Type: Artist
RM Skill: Intermediate




Just to add, an error will happen when an unarmed character attacks in battle.

@cmpsr2000: AWESOME!!!


__________________________

Forever!

Signature
Userbars


Play with Tokari!


Charming Miscellany




Go to the top of the page
 
+Quote Post
   
cmpsr2000
post Sep 3 2008, 11:30 AM
Post #17


Keeper of the Ruby Code of DOOM!
Group Icon

Group: Revolutionary
Posts: 355
Type: Scripter
RM Skill: Masterful




QUOTE (GuyInTraining @ Sep 3 2008, 01:23 AM) *
Just to add, an error will happen when an unarmed character attacks in battle.

@cmpsr2000: AWESOME!!!


Good catch, I'll add a fix for that before publishing the next release candidate. I went ahead and added in the ability to reload, which took more time than I anticipated. I'm troubleshooting an equip-amount error, then I think it will be ready to be posted.

and thanks! biggrin.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Shadow Lord
post Sep 3 2008, 11:55 AM
Post #18


Level 2
Group Icon

Group: Member
Posts: 23
Type: Developer
RM Skill: Masterful




Any way that when it's released it could be compatible with DerVVulfman's Multi-Slot VX script?

Here's the script:
http://www.rpgrevolution.com/forums/?showtopic=11828

It doesn't want to allow the extra slots to exist. If you make it allow them with edits, it makes the wrong number of ammo display and will let only Two Swords Style actors use ammo. Help, please!

This post has been edited by Shadow Lord: Sep 3 2008, 12:00 PM
Go to the top of the page
 
+Quote Post
   
cmpsr2000
post Sep 3 2008, 08:49 PM
Post #19


Keeper of the Ruby Code of DOOM!
Group Icon

Group: Revolutionary
Posts: 355
Type: Scripter
RM Skill: Masterful




QUOTE (Shadow Lord @ Sep 3 2008, 02:17 PM) *
Any way that when it's released it could be compatible with DerVVulfman's Multi-Slot VX script?

Here's the script:
http://www.rpgrevolution.com/forums/?showtopic=11828

It doesn't want to allow the extra slots to exist. If you make it allow them with edits, it makes the wrong number of ammo display and will let only Two Swords Style actors use ammo. Help, please!


The odds of this being compatible with a multi-slot equip script are slim since the code *requires* redefining a Window_Equip method that is also going to be redefined by any multislot system that overwrites the current equip system instead of implementing a completely separate Scene. After a full version of this is released I will attempt to address this problem, but I am fairly confident it would require some code-patching to work.

Also, I'm working on something else that may help the problem, but it's a surprise!


__________________________
Go to the top of the page
 
+Quote Post
   
Shadow Lord
post Sep 4 2008, 11:11 AM
Post #20


Level 2
Group Icon

Group: Member
Posts: 23
Type: Developer
RM Skill: Masterful




Thanks, Cmpsr. I thought it might be difficult, since I'm a competent scripter and couldn't make any headway. I can't wait for your surprise!
Go to the top of the page
 
+Quote Post
   

4 Pages V   1 2 3 > » 
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 12:13 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker