The RPG Maker Resource Kit

Other Game Creation => Game Creation General Chat => Topic started by: kenth21v on July 15, 2011, 03:12:19 AM

Title: Item Limitation and multiple item drop RPG MAKER XP
Post by: kenth21v on July 15, 2011, 03:12:19 AM
1. How do you limit the item drop? i mean making the item unique that if the player gained the item ones, it will never drop again from monsters.
2. I am making a rpg of retrieving lost pages so after making limitations of only 1 copy of each page, i need to make it like: after the player gained the 1st page, the next item to be dropped by monsters is the 2nd or 3rd pages.

need help ! tnx !  ;D
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: Sashikinaroji on July 15, 2011, 05:36:10 AM
hrm... when it comes down to it, it might be better to have the pages appear as a boss battle ending, as an scripted event (that is, an event that is part of the story, not an event through a script) or have pages be one item that you get several of, each time, you learn more.
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: doomed2die on July 15, 2011, 05:42:31 AM
I can't help you do it perfectly without scripting, but there is a way to event it to work similarly.

Make a new event on EVERY map where the monsters are that will drop page 1. Make all monsters drop page 1.

Make the event a parallel event (check the lower left corner where it says Trigger and let the trigger be the action button)

@Control Variable [A] = [Page 1]    (Note that A is any number to your liking. Choose a variable)
@Conditional Branch: Variable [A] > 1
   @Change Items [Page 1], -1
   @Change Items [Page 2], +1
@else


@control Variable = [Page 2]
@Conditional Branch: Variable > 1
   @Change Items [Page 2], -1
   @Change Items [Page 3], +1

etc. etc. and let's say you want 10 pages?

@Loop
   @Control Variable [J] = [Page 10]
   @Conditional Branch: Variable > 1
      @Change Items [Page 10], -1
@Else
@Repeat Above



     
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: kenth21v on July 16, 2011, 03:29:42 PM
 :D thanks ! i'll try it !
but its ok for me to use scripting if you'll kindly provide codes. ^_^
i am used to coding, but not this ruby language? i think.
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: doomed2die on July 16, 2011, 05:20:01 PM
lol... Yeah, I know what you mean. I can program some, just not in ruby ^^

No worries, but eventing is a lot like coding. You have a goal and you just need to think exactly how you're going to get it. You just don't know all the functions yet, but you will.
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: kenth21v on July 19, 2011, 03:20:13 AM
Quote from: doomed2die on July 16, 2011, 05:20:01 PM
lol... Yeah, I know what you mean. I can program some, just not in ruby ^^

No worries, but eventing is a lot like coding. You have a goal and you just need to think exactly how you're going to get it. You just don't know all the functions yet, but you will.
can you show me how to script this:
eg. Bronze sword drop rate is 50% while mithril sword has 10% drop rate in same monster.
i think it required scripting. or if not please show me. :lol:
i made something like
Control Variable:[Treasure] = Random no. (0-9)

Conditional Branch: Variable[Treasure] == 0
              $data_enemies[33].item_id = 1                         >>>>>for example is the bronze sword
Branch End
Conditional Branch: Variable[Treasure] == 1
              $data_enemies[33].item_id = 2                         >>>>>for example is the mithril sword
Branch End

there, so if i can just make it like "Conditional Branch: Variable[Treasure] == 0 - 4" then it will be a 50% drop rate right? how can i do that?

hoping for help from you or anyone... Thanks guys ! :D
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: doomed2die on July 19, 2011, 04:28:05 AM
Yeah.

Try this:
Make an event (in battle) with the starting trigger to be: Enemy #1, "dead" (or whatever) inflicted.
Conditional Branch: Variable[Treasure] <= 4 (less than or equal to)
     Add item:
     Show text: You got  ____
Else
Conditional Branch: Variable[Treasure] ==5
   Add item:
   show text: you got ____
Else
Conditional Branch: Variable[Treasure] =>6
Else



That way you can just get the item mid battle anyway xD
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: pacdiggity on July 19, 2011, 11:59:01 AM
Alternatively, through script, first assign your variable normally through event commands. Then,

if $game_variables[VARIABLE_ID] == 0
  $data_enemies[ID].item_id = 1
elsif $game_variables[VARIABLE_ID] == 1
  $data_enemies[ID].item_id = 2
elsif $game_variables[VARIABLE_ID] == 2
  etc...
end
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: kenth21v on July 21, 2011, 08:25:12 AM
Quote from: Pacman on July 19, 2011, 11:59:01 AM
Alternatively, through script, first assign your variable normally through event commands. Then,

if $game_variables[VARIABLE_ID] == 0
  $data_enemies[ID].item_id = 1
elsif $game_variables[VARIABLE_ID] == 1
  $data_enemies[ID].item_id = 2
elsif $game_variables[VARIABLE_ID] == 2
  etc...
end


i think i'll use this. but thanks to everyone who replies. i also tried those. ^_^ i really appreciate your help guys.
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: pacdiggity on July 21, 2011, 08:34:39 AM
There's a quicker way to do that, I realized.
for i in 0..99 (or however many items you have)
  if $game_variables[VARIABLE_ID] == i
    $data_enemies[ENEMY_ID].item_id = i
  end
end

That will make the enemy specified have an item with the ID of the variable.
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: kenth21v on July 21, 2011, 12:41:43 PM
ahh yes looping tnx tnx.. uhm...
What is the alternative of "Conditional Branch:[Bronze Sword] in inventory" in scripts?
can you give me some lecture in scripting?  :)
stuffs like these:
$game_variables[1]
$data_enemies[1]

i love using scripts, it makes me do more.
thanks.
Title: Re: Item Limitation and multiple item drop RPG MAKER XP
Post by: pacdiggity on July 21, 2011, 12:55:37 PM
Well, XP isn't my native engine, but lemme take a look...
It seems that it's hidden in the weapon_number method of Game_Party.
Perhaps:if $game_party.weapon_number(ID)

And for the other things, $game_variables is what the game saves the used instance of the Game_Variables class. The index included after, in the braces, is the index in the array that is referenced. The same applies to $data_enemies, except not for Game_Variables, it's a reference to the data file Enemies. The index represents which enemy is being referenced, because (I believe) the enemies' data is stored in a compact array.