Does it just skip directly to two?
If that is the case, just change your == to >=. That way, if you kill more than the needed amount, you can still complete it.
It sounds like the battle is ending before the variable gets changed. I don't have RMXP installed right now, so I can't troubleshoot it though.
This is exactly what is happening!
Let's say I'm fighting 2 goblins and 1 snake, and I want the variable to increase with the 2 goblins:
If I have it set to turn, like you say, and kill the first goblin, and then the second goblin, and then it takes 3 more turns to kill the snake, for each turn that the hps of both goblins are below 0 it increases the variable.
I countered this with a conditional branch
if self-switch A is on
[do nothing]
else
increase variable +1
self-switch A = On
Which seems to work. EDIT: This doesn't work after all =(
Ok well, anyways
Let's say I'm fighting just 2 goblins:
- If I kill both in the same turn, it registers as only 1.
- If I use an attack that attacks all enemies and kills both at the same time, it registers as 0!
Please help! I have a whole job system I set up and a bunch of the jobs are 'Kill X amount of this monster and come back to get X XP and X Gold.' This kinda messes that all up =) Please help!
ps I scoured google on how to find out how to do this quest, and your post is the only one I could find. Thanks for posting it! =)
--Problem Solved!
EDIT:
Thanks to ForeverZero for making me this script. This adds 1 to the variable at the end of battle to whatever enemy is specified, completely fixing all my problems! Thanks again ForeverZero!
"Place the script anywhere below Game_Enemy and fill out the simple configuration at the top of the script."
class Game_Enemy
#-------------------------------------------------------------------------------
# CONFIGURATION
#-------------------------------------------------------------------------------
# Define the variable used for each enemy here. Follow this pattern:
#
# when ENEMY_ID then VARIABLE_ID
#
# If more than one eneky share the same variable, you can define multiple
# IDs on one line. For example, say you had a Goblin whose ID was 1, and an
# Orc whose ID was 17. You wanted both of them to be of the same "type", and
# use the variable with ID of 6:
#
# when 1, 17 then 6
#
#-------------------------------------------------------------------------------
def enemy_variable(enemy_id)
return case enemy_id
when 1 then 1
when 2 then 2
when 3 then 3
when 4 then 4
when 5 then 5
end
end
#-------------------------------------------------------------------------------
# END CONFIGURATION
#-------------------------------------------------------------------------------
def increase_count(enemy_id)
var_id = enemy_variable(enemy_id)
if var_id != nil
$game_variables[var_id] += 1
end
end
alias zer0_enemy_type_attack attack_effect
def attack_effect(attacker)
result = zer0_enemy_type_attack(attacker)
if self.dead? && @counted == nil
increase_count(@enemy_id)
@counted = true
end
return result
end
alias zer0_enemy_type_skill skill_effect
def skill_effect(user, skill)
result = zer0_enemy_type_skill(user, skill)
if self.dead? && @counted == nil
increase_count(@enemy_id)
@counted = true
end
return result
end
alias zer0_enemy_type_item item_effect
def item_effect(item)
result = zer0_enemy_type_item(item)
if self.dead? && @counted == nil
increase_count(@enemy_id)
@counted = true
end
return result
end
end