Enemy distraction mechanic?

Denisowator

Villager
Member
Joined
Apr 18, 2017
Messages
13
Reaction score
0
First Language
Polish
Primarily Uses
RMVXA
So my game will involve blind enemies, walking around within the world. And I want some of them to be guarding items used to progress the story, but I can't figure out how I would, for example, make the player be able to throw something to make sound and distract them.

I've looked online but can't find anything. And I've been trying to figure out, what set of commands would logically make this possible, but I can't think of anything.

I don't need the object to be visually there, and like flying towards its destination (but that would be good to add). It can be something as simple as it being in your inv, the player using it within a certain tile (I would make multiple tiles checking for the player having the item in their inv, before starting the throwing mechanic), a sound playing and it appearing somewhere, and then triggering a cutscene (the enemy going to the object).

Anyone got any ideas? Even simple pointers would help.
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
Hm, I had thought about such a mechanic considering that I worked with Script in Move Route.

1. First, new methods for Game_Character:
Code:
class Game_Character < Game_CharacterBase
def distraction_point(dis)
#1 = y, 2 = x
$game_variables[1] = $game_player.y
$game_variables[2] = $game_player.x
case @direction
when 2
 $game_variables[1] = $game_player.y + dis
when 4
 $game_variables[2] = $game_player.x - dis
when 6
 $game_variables[2] = $game_player.x + dis
when 8
 $game_variables[1] = $game_player.y - dis
end
end

def move_toward_distraction
  sx = distance_x_from($game_variables[2])
  sy = distance_y_from($game_variables[1])
  if sx.abs > sy.abs
    move_straight(sx > 0 ? 4 : 6)
    move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0
  elsif sy != 0
    move_straight(sy > 0 ? 8 : 2)
    move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0
  end
end

end
2. Common Event, no trigger. It should at least run a Script with
Code:
$game_player.distraction_point(5)
$game_switches[1] == true
if you want the point to be five tiles from where you are standing.

3. The enemy's Custom Move Route: This Script move towards the distraction when the switch is on:

Code:
if $game_switches[1]; move_toward_distraction; end
---

Of course, this is assuming you can make the noise anywhere, and that switch stays on, so still needs some altering, but that's my take on it.
 

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

Latest Threads

Latest Posts

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,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top