It's been awhile since i posted a new topic and it figures it would be for support lol. Well here's my problem:
This following script piece is a custom targeting choice i was given support on (i cant remember who from

)and what it does is target enemies of the same id only. What i'm wondering is if theres a way to make target two random enemies of the same id?
Thanks to anyone who helps me out and credit will be given!
CODE
when 3 # target a group
return if @target_index == -1 # target index not valid
ptarg = opponents_unit.members[@target_index] # get potential target
return if ptarg.nil? # potential target is out of range (should not happen)
type = opponents_unit.existing_members.find{|member| member.is_a?(Game_Enemy) ? member.enemy_id == ptarg.enemy_id : member == ptarg }
# find first living battler of the selected type
type ||= opponents_unit.smooth_target(@target_index)
# if the type was not found, get another group
if type.is_a?(Game_Enemy) # if enemy
opponents_unit.existing_members.each {|enemy|
selected.push(enemy) if enemy.enemy_id == type.enemy_id target# target all enemies of this id
}
elsif type.is_a?(Game_Actor) # if actor
selected.push(type) # target 'this actor' only
end
# if type points to nil, no targets are added
This post has been edited by Guyver's Bane: Apr 8 2012, 07:04 AM