Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> [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
   

Posts in this topic
- cmpsr2000   [Disposable Ammo]   Aug 27 2008, 02:21 PM
- - Lukedevoux   I was wondering, if you used the skills, Dual, Dou...   Aug 27 2008, 05:16 PM
|- - cmpsr2000   QUOTE (Lukedevoux @ Aug 27 2008, 07:38 PM...   Aug 27 2008, 06:10 PM
- - Netto   Great job Cmpser   Aug 27 2008, 06:26 PM
- - Poko4Sho   So could I use this to make disposable arrows? I ...   Aug 27 2008, 06:36 PM
|- - Lukedevoux   QUOTE (Poko4Sho @ Aug 27 2008, 06:58 PM) ...   Aug 27 2008, 07:16 PM
- - Rukaroa   Can you make ammo equippable? Say you use the ...   Aug 27 2008, 07:20 PM
|- - cmpsr2000   QUOTE (Poko4Sho @ Aug 27 2008, 08:58 PM) ...   Aug 27 2008, 09:55 PM
- - Rukaroa   QUOTE (cmpsr2000 @ Aug 28 2008, 12:17 AM)...   Aug 28 2008, 04:53 AM
- - The Wizard 007   Hey Composer. I must say that was fast in getting...   Aug 29 2008, 02:57 PM
- - Rukaroa   Ah, to add to the suggestions, instead of having a...   Aug 29 2008, 04:13 PM
- - Shadow Lord   Is there any way you could make this compatible wi...   Aug 30 2008, 05:05 AM
- - Mr. Bubble   If you want to use this with the Tankentai SBS, pl...   Aug 30 2008, 05:59 AM
- - cmpsr2000   Good deal. I'm glad this is working well for t...   Aug 30 2008, 11:41 PM
- - GuyInTraining   Just to add, an error will happen when an unarmed ...   Sep 2 2008, 11:01 PM
|- - cmpsr2000   QUOTE (GuyInTraining @ Sep 3 2008, 01:23 ...   Sep 3 2008, 11:30 AM
- - Shadow Lord   Any way that when it's released it could be co...   Sep 3 2008, 11:55 AM
|- - cmpsr2000   QUOTE (Shadow Lord @ Sep 3 2008, 02:17 PM...   Sep 3 2008, 08:49 PM
- - Shadow Lord   Thanks, Cmpsr. I thought it might be difficult, si...   Sep 4 2008, 11:11 AM
- - GuyInTraining   Um.... well, the demo link is broken. Can you fix ...   Sep 7 2008, 06:11 AM
|- - cmpsr2000   QUOTE (GuyInTraining @ Sep 7 2008, 08:33 ...   Sep 10 2008, 08:15 PM
- - GuyInTraining   *bows in to report* I found some errors that does...   Sep 11 2008, 01:48 AM
|- - cmpsr2000   QUOTE (GuyInTraining @ Sep 11 2008, 04:10...   Sep 11 2008, 10:08 AM
- - Rukaroa   Haven't noticed anything on this end, but I...   Sep 11 2008, 09:33 PM
|- - cmpsr2000   QUOTE (Rukaroa @ Sep 11 2008, 11:55 PM) H...   Sep 13 2008, 09:30 PM
|- - kingoftheroad   QUOTE (cmpsr2000 @ Sep 13 2008, 09:52 PM)...   Sep 14 2008, 05:02 AM
- - GuyInTraining   Everything's up and running like breeze, sir...   Sep 13 2008, 07:46 PM
- - The Wizard 007   NIce work Composer I've been waiting for this ...   Sep 15 2008, 02:26 PM
- - lahandi   Hey composer, great script you made! I've...   Sep 15 2008, 09:07 PM
|- - cmpsr2000   QUOTE (The Wizard 007 @ Sep 15 2008, 04:4...   Sep 16 2008, 10:47 AM
- - Slye_Fox   Can this system be used to make grenades? But inst...   Sep 20 2008, 06:35 PM
- - cmpsr2000   I've updated the OP with proper instructions a...   Sep 23 2008, 02:21 PM
- - Slye_Fox   This ia a great system. easy to install and setup....   Sep 23 2008, 04:39 PM
|- - cmpsr2000   QUOTE (Slye_Fox @ Sep 23 2008, 07:01 PM) ...   Sep 23 2008, 05:33 PM
|- - Slye_Fox   QUOTE (cmpsr2000 @ Sep 24 2008, 01:55 AM)...   Sep 23 2008, 05:37 PM
- - Lil_J93637   Not sure if anyone has found this yet. But int eh ...   Sep 23 2008, 06:38 PM
- - Supergodjesus   That's easy to fix. Just go to the reload ski...   Sep 23 2008, 06:59 PM
|- - cmpsr2000   QUOTE (Supergodjesus @ Sep 23 2008, 09:21...   Sep 23 2008, 07:32 PM
- - Poko4Sho   I was trying to use this in GubiD's tactical b...   Sep 23 2008, 07:58 PM
- - Slye_Fox   I'm useing the Tankentai SBS, which works fine...   Sep 24 2008, 10:53 AM
- - Shadow Lord   I believe I saw a reply to that question by the ma...   Sep 24 2008, 11:00 AM
- - The Wizard 007   Hey Composer, just wanted to report a bug. I trie...   Sep 28 2008, 03:06 PM
- - andani   Hey there Composer! I have a slight problem wi...   Sep 28 2008, 10:18 PM
- - Twilight   If your looking for a way to make a quiver you can...   Oct 6 2008, 05:37 PM
- - KPaxian   Thanks it's very nice! Congrats!   Oct 8 2008, 04:10 AM
- - Jonny   I get an reeor if the actor id unequiped, will thi...   Oct 9 2008, 05:40 AM
|- - cmpsr2000   QUOTE (Twilight @ Oct 6 2008, 08:37 PM) I...   Oct 14 2008, 10:24 AM
- - Jonny   Basically, whenever an actor has no weapon equiped...   Oct 20 2008, 07:15 AM
- - lahandi   I got same error too when the actors doesnt equip ...   Oct 24 2008, 08:58 AM
- - GuyInTraining   QUOTE For the last suggestion, it would be tremend...   Oct 25 2008, 12:24 AM
- - lahandi   QUOTE Don't worry, the skill still works even ...   Oct 25 2008, 03:39 AM
- - GuyInTraining   @lahandi> Eh? Masa sih? Punyaku bisa tuh... Eh...   Oct 26 2008, 02:03 AM
- - chakshuriken   hey, ive already found a bug well i might be i th...   May 28 2009, 09:54 PM
- - erkhunter   thanks cmpsr! you are a very good scripter.. t...   May 30 2009, 12:27 PM
- - dividedbyzero   I get the following error any time any character t...   May 31 2009, 03:27 PM
|- - FauxMask   QUOTE (dividedbyzero @ May 31 2009, 04:27...   Jul 24 2009, 09:28 AM
- - choas legacy   How do make more than 3 ammo types i tryed to make...   Jul 6 2009, 06:46 PM
- - Michel   Hello I'm Michel from Austria! I have bee...   Jul 20 2009, 09:06 AM
- - Znikomek   I find some bug: Example: After battle i have 8/1...   Jul 21 2009, 02:52 AM
- - FireRMVX   I'm very impressed. However, I'm also disa...   Mar 20 2010, 10:40 AM
- - Nonameknight   i am new to scripting and using scripts so could a...   Apr 22 2010, 08:39 PM
- - silvershadic   Whenever I try equipping ammo, i get this error. C...   Jul 24 2010, 10:57 AM
- - SamieltheMDS   QUOTE (cmpsr2000 @ Aug 27 2008, 06:21 PM)...   Aug 29 2010, 07:37 PM
- - Prelude Dikter   That's a great cript! I've been look...   Aug 29 2010, 08:15 PM
|- - SamieltheMDS   QUOTE (Prelude Dikter @ Aug 30 2010, 12:1...   Aug 30 2010, 05:19 PM
- - silvershadic   Does anyone have an aliased version of this that w...   Jan 23 2011, 02:35 PM
- - Kread-EX   I doubt it. cpmsr2000 left a long time ago anyway,...   Jan 24 2011, 03:20 AM


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: 23rd May 2013 - 09:36 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker