[ACE] Yanfly's Victory Aftermath - No Gold Error

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,933
Reaction score
1,326
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

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
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
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
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!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top