The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: BPKS0 on December 03, 2006, 04:11:48 AM

Title: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 03, 2006, 04:11:48 AM
Ok well I'm trying to do something for a netplay+ game... Neways I need a script that sets each item in the database to a 5 digit number. For example
DB#        ID#
001        00001
002        00002
003        00003
004        00004
127        00127

Ok well yea just set up the script with like the first 5 and I will edit it and add the rest of the numbers. Now the next part, I need another script that would be something like this in event form

If ActorName Paul applied
conditional branch (Some button) is being pressed
show text, enter Item ID
input number5 digits

Now wen I put in the 5 digits it should check that script and whatever item has those
5 digits.. for expample if I filled in 00001 It would give me item 001 out of the database wich would be a red potion.

Now if at all possible I would like to also have an item amount thing... Like I input the 5 digits then another one pops up thats 2 digits and lets me fill in the quanity of how many I want.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Falcon on December 03, 2006, 01:36:19 PM
Why the hell do you need that many items, isn't 999 enough :P
It may not be possible though, since the database class isn't editable in Ruby.

I believe Me(TM) and Mr.Mo are working on item spawn, I'll ask them sometime.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Blizzard on December 03, 2006, 02:49:03 PM
Seph is working on event spawning as far as I know. During the work on my ABS I noticed, it's actually not that hard to make... -_-
I also don't know why you actually need so many items.

If I did get it right, you need a script that allows GMs and admins to give out items to player in a user-friendly enviroment, am I correct?

BTW, you can easily make a script that makes the database larger. The user would need to enter all the item stats in the script per text. Then just during the game startup it would need to load the additional items into the $data_items array.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Falcon on December 03, 2006, 02:56:22 PM
Wouldn't that take like, fucking forever, having to define each items and all?

But yeah, item spawning is easy, post on the N+ forums if anyone is planning to make it, an amateur RGSS person could probably do it.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Blizzard on December 03, 2006, 03:35:46 PM
Well, if he's planning on making 10000 items... yes, it would.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 03, 2006, 03:45:38 PM
nonono Im not going to use all 5 spots... that would be to many xD I would use it for something like... erm

db#  ID#
185  01785

idk thats sorta how its set up on RO xP if u want to make it only up to 999 (3 characters) thats fine xD
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Falcon on December 03, 2006, 04:22:40 PM
RMXP has support for 999 items by default.
Why the hell do you want a stupid script like that anyways?

As I've said before on the N+ forums, if you don't know basic RGSS, don't make an MMORPG. Item spawning is very easy, its an event with one line of code.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Blizzard on December 03, 2006, 04:28:48 PM
If you really want pseudo-random ID numbers get a script that makes you IDs with 12 numbers. ::)
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 03, 2006, 09:52:19 PM
I do know basic RGSS I just don't know how to do this. Y do I want a script like this? Well I reely don't feel like going and killing monsters wenever I need something. If I'm an admin I should be able to get whatever I want with a single ID number.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Falcon on December 03, 2006, 10:03:08 PM
Item spawning is ridiculously simple. You don't need a scene or anything, just a list of corresponding item numbers and an event.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 03, 2006, 10:07:15 PM
can u help or not? =\
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Falcon on December 03, 2006, 10:08:13 PM
Try it yourself, I already know how to do it. It's extremely simple if you know how to use variables.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 03, 2006, 10:08:41 PM
Can u give me a simple start? Like tell me how to set it up for item 001
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Falcon on December 03, 2006, 10:12:48 PM
Look through Scene_Shop.

If you can't figure it out in an hour, I'll give you the code.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 03, 2006, 10:15:56 PM
k...
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 03, 2006, 10:17:47 PM
[doublepost] Does it have something to do with this?

      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end


Edit

and this?

        when RPG::Item
          $game_party.gain_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.gain_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.gain_armor(@item.id, @number_window.number)
        end
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Falcon on December 04, 2006, 12:44:59 AM
$game_party.gain_item(@item.id, @number_window.number)

Replace the @item.id with a variable, and @number_window.number with an another and then make an event which defines both variables and then calls the code.
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: BPKS0 on December 04, 2006, 02:00:11 AM
wut? xD
Title: Re: super request... Easy Hard? Blizzard or someone good help xD
Post by: Blizzard on December 04, 2006, 01:05:49 PM
If you still need more than 999 items, here is the RPG::Item class with the variables except the @menuse variable, because it's an RPG::AudioFile and they are a little bit more difficult to load into the variable as you would need a pointer that points to that file in the RAM. :-\

class RPG::Item

  def init_no_item(id)
    @id = id
    case id
    when 1000
      @animation1_id = 0
      @animation2_id = 0
      @recover_hp = 0
      @recover_sp = 0
      @recover_hp_rate = 0
      @recover_sp_rate = 0
      @name = "Item 1000"
      @icon_name = "item_id_1000"
      @description = "This is an item with the ID 1000, ZOMG!"
      @plus_state_set = []
      @minus_state_set = []
      @element_set = []
      @consumable = true
      @price = 0
      @pdef_f = 0
      @mdef_f = 0
      @hit = 0
      @variance = 0
      @common_event_id = 0
      @occasion = 0
      @scope = 0
      @parameter_type = 0
    end
  end

end