Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[small script] Common Event triggered by taking a step

Script Title:
Common Event Trigger
RMXP
Detailed Description:
Every time the character takes a step on particular maps, a common event is performed. I'll need the common event to be unique to each map.
Other Scripts I am using (in order):
none
 
Simple enough.

Code:
# Common Event Steps

# By SephirothSpawn

 

module CES

  Player_By_Map = {}

  # Map 1 - Common Event 2

  Player_By_Map[1] = 2

end

 

class Game_Player

  alias_method :seph_ces_is, :increaese_steps

  def increase_steps

    seph_ces_is

    if CES::Player_By_Map.has_key?($game_map.map_id)

      $game_temp.common_event_id = CES::Player_By_Map[$game_map.map_id]

    end

  end

end

Just paste above Main. For each map, just add a line below "Player_By_Map = {}". I added an example below that line.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top