Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Common Event on Terrain Tag
#1
SG Common Event on Tile
Version: 1

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Edit: Bugfix for SG Settings Control
Grab the new one here and replace the old one with it. This is not this script, it's the settings control script it requires

Introduction

Very simple script, I was surprised searching that one like this wasn't posted anywhere.

Set terrain tags to call common events of your choosing.

Works great for things like tiles that damage people, sound effects or traps :)

Features
  • Allows you to lower map lag by not having a bunch of duplicate events
  • Can change settings at any time without editing the script
Screenshots

There be no screenshots fer ye here.

Script

This script requires SG Settings Control, which can be found here. Place it above all the other SG Scripts. Must be under the SDK if you're using it.

[codebox]
Code:
#=============================================================================
# ** SG Common Event on Tile
#=============================================================================
# sandgolem
# Version 1
# 26.03.06
#=============================================================================
$game_sg['tilecommons'] = [0,0,0,0,0,0,0,0]
# That's an array of 8, 1 for each terrain tag in order (0-7)
# Put your default common events in there in the proper order
#
# To set common events outside of this script, use these:
# sg_ast['tilecommons',0,#]
# sg_ast['tilecommons',1,#] ...
#
# The first number is the tile tag. The second number is the event #
# You can set tags in the tileset database, called terrain tag.
# Don't include the first 0's in the common event #
#
# To set it to no longer call a common event, use these:
# sg_ast['tilecommons',0,0]
# sg_ast['tilecommons',1,0] ...
#
#=============================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# but under the default scripts and the SDK if you're using it. SG Settings
# Control is required for this script, and must be above it.
#
# Have problems? You can leave me a message at:
# http://www.gamebaker.com/users/sandgolem
#
#=============================================================================

if !$game_sg['enabled']
  p 'SG Script Control required. Read instructions where you found this',
    'script for a link, or visit www.gamebaker.com/rmxp'
end

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------

begin
  SDK.log("SG Common Event on Tile", "Sandgolem", 1, "26.03.06")
  if SDK.state("SG Common Event on Tile") != true
    @sg_tilecommons_disabled = true
  end
  rescue
end

#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if !@sg_tilecommons_disabled
  
class Game_Party
  
  alias sandgolem_tilecommons_gameparty_incsteps increase_steps
  
  def increase_steps
    sg_temp = $game_map.terrain_tag($game_player.x, $game_player.y)
    sg_temp2 = $game_sg['tilecommons']
    if sg_temp2[sg_temp] > 0
      $game_temp.common_event_id = sg_temp2[sg_temp]
    end
    sandgolem_tilecommons_gameparty_incsteps
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
[/codebox]

Instructions

See comments.

Compatibility

Should work with everything.
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Event dependent Movement Caldaron 0 2,190 10-09-2006, 01:00 PM
Last Post: Caldaron
  Event Name and ID Search Script Hadriel 0 2,026 06-21-2006, 01:00 PM
Last Post: Hadriel
  Terrain Encounter Areas SephirothSpawn 0 1,880 05-19-2006, 01:00 PM
Last Post: SephirothSpawn
  Battle Event List & Pre-Battle Troop Setup SephirothSpawn 0 2,460 12-25-2005, 01:00 PM
Last Post: SephirothSpawn
  Event check before battle end Jimmie 0 1,835 09-03-2005, 01:00 PM
Last Post: Jimmie
  Testing for an Event Name Near_Fantastica 0 1,947 02-01-2005, 01:00 PM
Last Post: Near_Fantastica



Users browsing this thread: