multiply drop quantity with variable in event

Fridjah

Veteran
Veteran
Joined
Jan 13, 2015
Messages
155
Reaction score
7
First Language
French
Primarily Uses
RMVXA
Hello. I'd like to know if I can multiply drop with a variable.


For the idea, I tried that


( Don't pay attention to "RPG::SE" It's just for me to find out if the script runing well in my conditions )


class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# * Create Array of Dropped Items
#--------------------------------------------------------------------------
def make_drop_items
dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items }
if $game_variables[10]==1
RPG::SE.new("Down3", 100, 150).play
r *= 2
else
if $game_variables[10]==2
RPG::SE.new("UP4", 100, 150).play
r *= 3
end
end
end
end


Well I hear the SE, but it crashes at "r*=x" and get a  ( No method) stuff.


EDIT : I dont need a complicated script, just need to controle quantity with a single variable for conditions in troops.


I got time to try more, and this looks to work:


class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# * Create Array of Dropped Items
#--------------------------------------------------------------------------
def make_drop_items
if $game_variables[10]==1
RPG::SE.new("Down3", 100, 150).play
dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items*2 }
else
if $game_variables[10]==2
RPG::SE.new("UP4", 100, 150).play
dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items*3 }
else
dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items }
end
end
end
end


But now, my left wish is to find out how to "exclude" a not desired multiplied item.


DEEPER explaination:


The commun drop item can be multiplied, but not the rare/bonus one.


So, I dont want to see drop like that, if the multiplied is 3:


- Tortule scale x3 (commun) ok


- Cactus needle x3 (commun) ok


- Dragon heart x3 (rare) not ok ! Must be x1


I tried this, but I don't know how to use condition with it ... cause it looks to be already a condition:


class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# * Create Array of Dropped Items
#--------------------------------------------------------------------------
def make_drop_items
if $game_variables[10]==1
dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items*2 }
[12].any? {|i| $game_temp.drops.include?($data_items)}
#Then I wish to remove 1 extra item[12]
RPG::SE.new("Down3", 100, 150).play
else
if $game_variables[10]==2
dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items*3 }
[12].any? {|i| $game_temp.drops.include?($data_items)}
#Then I wish to remove 2 extra item[12]
RPG::SE.new("UP4", 100, 150).play
else
dead_members.inject([]) {|r, enemy| r += enemy.make_drop_items }
end
end
end
end


I also have NoMethodError with "Theolized - Yanfly Engine Ace - Dynamic Victory Aftermath (Addon)


http://theolized.blogspot.ch/2014/01/yea-dynamic-victory-aftermath-addon.html


Line 284


Thank you
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Script releases is for finished scripts - and your topic foesn't sound like it is working already...


Depending on what exactly you want, this should probably moved to either "learning RGSS" or to "Scripts in Development" - please state where you want it moved
 

Fridjah

Veteran
Veteran
Joined
Jan 13, 2015
Messages
155
Reaction score
7
First Language
French
Primarily Uses
RMVXA
My bad ! You're right.


Can you TELEPOOOoooooooooooort me to: (RGSSx Script Support) pleeeeeease ?  ;)


Thank you and Happy New Year Andar !
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

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

Latest Threads

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,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top