FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
Okay, again I need the helpt of yours.

first, the victory aftermath script is awesome. but.. I got a little issue with that.

in my game, many of the monsters dont drop gold (why would a monster carry gold o_O) so they are dropping other items instead.

unfortunately shows the script every amount of gold you receive after battle, even if it is 0! 

Here is the Victory Aftermath Script

I managed to get rid of the displaying that 0 gold is received. but... the script still draws the box of it, which looks just stupid.

I changed this part:

#-------------------------------------------------------------------------- # draw_gold #-------------------------------------------------------------------------- def draw_gold(rect) text = Vocab.currency_unit draw_currency_value(@gold, text, rect.x, rect.y, rect.width) endto this:

#-------------------------------------------------------------------------- # draw_gold #-------------------------------------------------------------------------- def draw_gold(rect) if @gold > 0 text = Vocab.currency_unit draw_currency_value(@gold, text, rect.x, rect.y, rect.width) end endbut where do I get rid of the box?? 

here is a gif to show what I mean exactly.

I hope someone can give me a clue. =)
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,942
Reaction score
1,332
First Language
English
Primarily Uses
RMMV
Try overwriting the gain_drop_items method with this:

#————————————————————————–
# overwrite method: self.gain_drop_items
#————————————————————————–
def self.gain_drop_items
drops = []
$game_troop.make_drop_items.each do |item|
$game_party.gain_item(item, 1)
drops.push(item)
end

# only show the spoils if there ARE any spoils!
if($game_troop.gold_total > 0 || drops.length > 0)
SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
set_victory_text(@victory_actor, :drops)
wait_for_message
 end
end
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,186
Reaction score
15,544
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
@Shaz: whoops, sorry! >.<

@Uzuki:

this.. doesn't really work. even it is zero gold you receive, the script count that still as a reward! so the empty box ist there everytime!! that means, there are spoils, no matter what...
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
sorry for doublepost, but... bump! 

need really help about this...
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,932
Reaction score
3,161
First Language
English
Primarily Uses
RMMZ
Change draw_item(index) to this:

def draw_item(index)

    item = @data[index]

    if @gold > 0

      rect = item_rect(index)

      draw_gold(rect)

    else

      rect = item_rect(index - 1)

    end

    reset_font_settings

    if item.nil?

      return

    end

    rect.width -= 4

    draw_item_name(item, rect.x, rect.y, true, rect.width - 24)

    draw_item_number(rect, item)

  end

 

The problem was that because database items start their indexes at 1, there's never anything in @data[0], so the item rect index is always considering 1 for items regardless of whether there's gold being printed. Doing it the way I've amended it to means that if there's 0 gold it treats each item's placement as if it's being drawn for the index below it, so everything shifts nicely into place.
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
Thanks a lot! =D
I never considered in this case that the indexes start at 1 ... thanks for your help!
 

Latest Threads

Latest Posts

Latest Profile Posts

Evening humans! How goes the game make?
The anime characters we saw 20 years ago,
still have the same age when we see them now.
Somehow it's strange but also beautiful.
It's like no matter how much we change,
there's certain part of ourselves we can reconnect to when we see them again.
Took a long, long time, way longer than it should to be honest...but I've finally finished the big content update to my demo!
Lots of not good things happening IRL but I'm not gonna let this day end like this. Quote time:
"Success is not final, failure is not fatal: it is the courage to continue that counts." -Winston Churchill

So, keep going, lads. Whatever you do keep going. Until next time.

It's a Spanish devlog don't get scared!. (please)

Forum statistics

Threads
117,247
Messages
1,105,835
Members
153,413
Latest member
Noobcreator12
Top