08-31-2016, 01:28 AM
(08-30-2016, 03:35 AM)DerVVulfman Wrote: Hey, guys. Dunno if anyone scripting noticed, but the 'follow player' feature in all the RPGMaker systems include a bit of randomness. Make an event set to follow the player, and it randomly turns around or something.
Saying that as Ahzoh brought that up about Lycan. Might be something to look into... an alternate 'movement' option.
For example, RMXP's routine that makes events move to the player looks like this:
It includes a few mechanisms that make the event move randomly 18% of the time. If you want to make the events to only go straight to the player (this means you, Ahzoh), you may want to add this to your code instead. This removes all 'randomness' to any event moving to the player.Code:def move_type_toward_player
# Get difference in player coordinates
sx = @x - $game_player.x
sy = @y - $game_player.y
# Get absolute value of difference
abs_sx = sx > 0 ? sx : -sx
abs_sy = sy > 0 ? sy : -sy
# If separated by 20 or more tiles matching up horizontally and vertically
if sx + sy >= 20
# Random
move_random
return
end
# Branch by random numbers 0-5
case rand(6)
when 0..3 # Approach player
move_toward_player
when 4 # random
move_random
when 5 # 1 step forward
move_forward
end
end
Code:#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Move Type : Approach
#--------------------------------------------------------------------------
def move_type_toward_player
move_toward_player
end
end
With the new changes your ABS system makes enemies behave more like what I'd expect them to, whereas the Blizz-ABS doesn't behave quite the same.
"Turning iron ore into iron swords is a hard process, for one must first dig out the rock, and melt it to refine it, then one must pour that metal into a mould, let it cool a bit, and pound on it while it cools even further. Games are no different." - Ahzoh
All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.
Universal Declaration of Human Rights in Vrkhazhian
ʾEšol ḵavud ʾelẕakud lav ʾezʾaẕud zwazaršeru ya lit žalneru lav lit t͛enud. Ṗal sa-ražheru lav raržižu paplam lav ṗal widsaṟam bemaḵu šuku lit ʾeyṭu waẏnilaẇ. All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.