03-26-2006, 01:00 PM
(This post was last modified: 07-25-2017, 04:36 AM by DerVVulfman.)
SG Common Event on Tile
Version: 1
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.
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
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
Instructions
See comments.
Compatibility
Should work with everything.