Getting Troop Drops On The Map (Without entering a battle)

Status
Not open for further replies.

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
269
Reaction score
408
First Language
Not English
Primarily Uses
RMVXA
So I'm facing an issue when trying to make an assassination passive that allows you to instantly kill enemy symbols on the map without engaging them directly in a battle, naturally this prevents the player from getting any loot the enemy would have otherwise dropped from killing them normally. While it is possible to manually add separate drop pools in this situation via eventing it is without a doubt the route of pain and suffering so I am looking for an alternative.

Is it possible to use a script call to get the drops from a specific troop (factoring into their individual drop rates and drop rate boosts) from the map or is a script necessary for this?

Thanks in advance.
 

Binder28

Veteran
Veteran
Joined
Sep 15, 2020
Messages
93
Reaction score
26
First Language
Portuguese
Primarily Uses
RMVXA
Well...if the enemy dies by the use of this skill...after the event happened (on the enemy event itself) you can just make a "change items/weapon/armor" that will drop whatever the enemy was carrying...you can even make the drops random using variables and conditional branches...(tough that would be a little more work)

Edit: Here's a little settup I have...(Mine here would be the stat...I changed the "atk" stat to mine...anyway)

Help.png
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,048
Reaction score
7,135
First Language
Indonesian
Primarily Uses
RMVXA
Code:
$game_troop.setup(troop_id)
$game_troop.make_drop_items.each do |item|
  $game_party.gain_item(item, 1)
end
Change the troop id.
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
269
Reaction score
408
First Language
Not English
Primarily Uses
RMVXA
@TheoAllen
Thanks for the snippet (only find this out today as somehow I forgot to watch this thread thinking I'd be notified lol) but the code doesn't seem to give any results, even on a fresh project - no errors, no items gained, nothing. Not sure if I need to do anything other than changing the troop ID?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,048
Reaction score
7,135
First Language
Indonesian
Primarily Uses
RMVXA
Turned out that the make drop item function took from a dead battler. Which was the reason why it doesn't work.

In that case, a script snippet would be required.
Code:
class Game_Troop
  def force_drop_items
    members.inject([]) {|r, enemy| r += enemy.make_drop_items }
  end
end
Then the script call would be.
Code:
$game_troop.setup(troop_id)
$game_troop.force_drop_items.each do |item|
  $game_party.gain_item(item, 1)
end
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
269
Reaction score
408
First Language
Not English
Primarily Uses
RMVXA
@TheoAllen That works now. Thanks a ton. :rock-right:

I noticed one additional issue however, since $game_party.gain_item is called directly instead of command_126 in the interpreter, there is no indication that the player has received the item and therefore they are unable to tell what actually dropped.

I am currently using a item popup script (http://sepher.jp/game/rgss3/RGSS3_getinfo_plus.txt) for normal usage (that works fine on Change Items event command) but had no luck to make it work with this function since gain_item obviously doesn't call the popup function, is there a possible variation of the script call that can capture your snippet and run the modified command_126 in the above link?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,048
Reaction score
7,135
First Language
Indonesian
Primarily Uses
RMVXA
Apparently what you need to do is simply using
Code:
e = $game_temp.streffect
e.push(Window_Getinfo.new(id, type, text, value))
Which mean it goes by
Code:
$game_troop.setup(troop_id)
$game_troop.force_drop_items.each do |item|
  value = 1
  type = 0
  id = item.id
  text = CUSTOM_GET_WINDOW::ITEM_TEXT_ADD
  e = $game_temp.streffect
  e.push(Window_Getinfo.new(id, type, text, value))
end
Of course, I haven't tried it yet.
 

CraneSoft

Filthy Degenerate
Veteran
Joined
Apr 16, 2016
Messages
269
Reaction score
408
First Language
Not English
Primarily Uses
RMVXA
Ah that was exactly what I tried but was missing the item.id part, works perfectly now. Many thanks again!

This can be closed now.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,150
Reaction score
14,206
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.



Please report your thread and ask for it to be closed, in future, instead of just adding adding it as a comment to your post. Thanks.
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

treele.jpg
A them/they in a forest... a still for the game I'm working on.
Making a blue-magic-heavy game is very fun but there's a lot of extra hassle as well. Balancing skills for both enemy and player usage isn't easy.
BTW everyone on staff who made the forum jump, thank-you! This time I am not panicked and lost all rounds.
I'm not searching for bugs, just pleasant surprises, for now on ^^
Been a while since I've been here, whoops. My computer's been acting really stupid so I wasn't able to work on my projects, but the good news is I've got a new one, meaning I can get back to work. And I've got a nice idea in mind, I'll just need to find some good scripts for the Aesthetic.

Forum statistics

Threads
108,838
Messages
1,039,943
Members
141,301
Latest member
sxips
Top