Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Consumed item swapping script(let), it simply implies what zelda has. use a potion and get an....
ASCIIgod
post Mar 16 2010, 02:31 AM
Post #1


Demonic God of Snippets of Doom +10
Group Icon

Group: Revolutionary
Posts: 271
Type: Scripter
RM Skill: Intermediate




Description 1: simply implies what zelda has. use a potion and get an empty bottle
Decription 2: this script(let) helps you make item that changes or perhaps i could say, swapped upon being consumed. this eliminates the tedious work on the old fashioned common event swaps.

credits: me and only me ASCIIgod

[Show/Hide] the script for VX
CODE
################################################################
#
###############
# #
# #
# ASCIIgod's consumed item swapping script(let) #
# Ver.0.1 #
################################################################################
# #
# this script(let) allows you to have an item that swaps or pherhaps i should #
# say, changes upon consming. This script(let) has a little equallity to the #
# system the zelda games uses. like for example, link got a bottle that has #
# nothing in it. so we buy a potion or pherhaps caught a fairy. instead of #
# using the tradfitional and tedios 'common event' i cam up a solution. #
# so instead of the item disappearing it will rather evolve to a new one. like #
# drinking a bottle of potion, instead of throwing away the bottle the heroes #
# can recycle it to reduce waste but thats out of the scripts capabilities ^V^ #
################################################################################
# #
# note that i did it under a default clean project so it might not compatible #
# with scripts that changes the scene_item itself like the grid inventory from #
# modern algebra or the tem weight script(which i dont know the name of the #
# author).... so im going to make the compatible soon.... also note that the #
# substitution process take place AFTER the item is consumed(in and out) #
# of battle. so you must check your inventory again to see what item changes #
################################################################################
# #
# instruction: just jam all the item ids in the has under the module of the one#
# you want to have a substitutional item. then next to the => command is the #
# item that will substitute after the item is consumed.... thats just easy.... #
################################################################################
# #
# final note: i tested it nad it works but. the second time you're gonna get #
# subtitution item you may notice it does count well the fix for that is simply#
# get out of the item screen and return. the addition will now be applied. i'll#
# fix it sometime. sorry. #
################################################################################
module ASCII
module ITEM_SWAP

#put the item id you want to have a subtitute upon consuming

ITEM_SWAPPING =
{
# item_id => swap_id
1 => 2,
3 => 2,
}

end
end

# be warned that editing below here needs a lv20+ scripter to survive or else,
# you may suffer from under level sickness and easily be pawned by the lvl50 programming
# porings and lose all your HP in one try ^v^..... you've been warned.

class Game_Party < Game_Unit

def consume_item(item)
if item.is_a?(RPG::Item) and item.consumable
lose_item(item, 1)
swap = ASCII::ITEM_SWAP::ITEM_SWAPPING[item.id]
gain_item($data_items[swap], 1)
end
end

end



[Show/Hide] the script for XP
CODE
#################################################################
###############
# #
# #
# ASCIIgod's consumed item swapping script(let) #
# Ver.0.1 XP ver #
################################################################################
# #
# this script(let) allows you to have an item that swaps or pherhaps i should #
# say, changes upon consming. This script(let) has a little equallity to the #
# system the zelda games uses. like for example, link got a bottle that has #
# nothing in it. so we buy a potion or pherhaps caught a fairy. instead of #
# using the tradfitional and tedios 'common event' i cam up a solution. #
# so instead of the item disappearing it will rather evolve to a new one. like #
# drinking a bottle of potion, instead of throwing away the bottle the heroes #
# can recycle it to reduce waste but thats out of the scripts capabilities ^V^ #
################################################################################
# #
# note that i did it under a default clean project so it might not compatible #
# with scripts that changes the scene_item itself like the grid inventory from #
# modern algebra or the tem weight script(which i dont know the name of the #
# author).... so im going to make the compatible soon.... also note that the #
# substitution process take place AFTER the item is consumed(in and out) #
# of battle. so you must check your inventory again to see what item changes #
################################################################################
# #
# instruction: just jam all the item ids in the has under the module of the one#
# you want to have a substitutional item. then next to the => command is the #
# item that will substitute after the item is consumed.... thats just easy.... #
################################################################################
module ASCII
module ITEM_SWAP
#put the item id you want to have a subtitute upon consuming
SWAP_ITEM =
{

1 => 2,

}

end
end
# be warned that editing below here needs a lv20+ scripter to survive or else,
# you may suffer from under level sickness and easily be pawned by the lvl50 programming
# porings and lose all your HP in one try ^v^..... you've been warned.
class Game_Party
def lose_item(item_id, n)
# Reverse the numerical value and call it gain_item
swap = ASCII::ITEM_SWAP::SWAP_ITEM[item_id]
gain_item(item_id, -n)
gain_item(swap, +1)
end



end


This post has been edited by ASCIIgod: Mar 17 2010, 07:29 AM


__________________________

Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 11:31 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker