New Event Triggers
Version: 1.00
Introduction
This script allows you trigger an event with scripted expressions.
Script
Instructions
To add a trigger create a comment with the following syntax:
FAQ
Add the following comment to the page with the light effects comment:
You don't have to "end" it.
Compatibility
Requires SDK2.2 parts I & II
Credits and Thanks
Credit for Near Fantastica for the original idea and busbuzz for requesting a SDK2 version.
Version: 1.00
Introduction
This script allows you trigger an event with scripted expressions.
Script
script
Spoiler
#==============================================================================
# ** Event Trigger
#------------------------------------------------------------------------------
# Tibuda
# Version 1.00
# 04.18.2007
#------------------------------------------------------------------------------
# Instructions: Add a comment to your event starting with "Trigger" with
# the conditional expression
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script and Check requirements
#------------------------------------------------------------------------------
SDK.log('Event Trigger', 'tibuda', 1.00, '04.18.2007')
SDK.check_requirements(2, [1,2])
#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Event Trigger')
#==============================================================================
class RPG::Event::Page
#--------------------------------------------------------------------------
def conditions_met?(map_id, event_id)
return false unless @condition.conditions_met?(map_id, event_id)
for item in @list
next unless item.code == 108 || item.code == 408
array = item.parameters[0].split(' ')
if array.size > 1 && array[0].upcase == 'TRIGGER'
array.delete_at(0)
return false unless eval(array.join(' '))
end
end
return true
end
#--------------------------------------------------------------------------
end
#==============================================================================
class Game_Event
#--------------------------------------------------------------------------
SDK.log_overwrite(:Game_Event, :refresh_trigger_conditions)
def refresh_trigger_conditions
# Check in order of large event pages
for page in @event.pages.reverse
# Skips If Page Conditions Not Met
next unless page.conditions_met?(@map_id, @id)
if SDK.enabled?('Time System')
next unless time_conditions_met?(page)
end
# Set local variable: new_page
new_page = page
# Remove loop
break
end
# Return new page
return new_page
end
#--------------------------------------------------------------------------
end
#==============================================================================
end
#--------------------------------------------------------------------------
# End SDK Enabled Test
#--------------------------------------------------------------------------
# ** Event Trigger
#------------------------------------------------------------------------------
# Tibuda
# Version 1.00
# 04.18.2007
#------------------------------------------------------------------------------
# Instructions: Add a comment to your event starting with "Trigger" with
# the conditional expression
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script and Check requirements
#------------------------------------------------------------------------------
SDK.log('Event Trigger', 'tibuda', 1.00, '04.18.2007')
SDK.check_requirements(2, [1,2])
#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Event Trigger')
#==============================================================================
class RPG::Event::Page
#--------------------------------------------------------------------------
def conditions_met?(map_id, event_id)
return false unless @condition.conditions_met?(map_id, event_id)
for item in @list
next unless item.code == 108 || item.code == 408
array = item.parameters[0].split(' ')
if array.size > 1 && array[0].upcase == 'TRIGGER'
array.delete_at(0)
return false unless eval(array.join(' '))
end
end
return true
end
#--------------------------------------------------------------------------
end
#==============================================================================
class Game_Event
#--------------------------------------------------------------------------
SDK.log_overwrite(:Game_Event, :refresh_trigger_conditions)
def refresh_trigger_conditions
# Check in order of large event pages
for page in @event.pages.reverse
# Skips If Page Conditions Not Met
next unless page.conditions_met?(@map_id, @id)
if SDK.enabled?('Time System')
next unless time_conditions_met?(page)
end
# Set local variable: new_page
new_page = page
# Remove loop
break
end
# Return new page
return new_page
end
#--------------------------------------------------------------------------
end
#==============================================================================
end
#--------------------------------------------------------------------------
# End SDK Enabled Test
#--------------------------------------------------------------------------
Expand to see the code.
Instructions
To add a trigger create a comment with the following syntax:
FAQ
Quote:
How does this triggers work? i want a light to be on once $ats.hours is >= 22 and $ats.hours i <= 21, with the comment light effects. how would i turn the light on?
Add the following comment to the page with the light effects comment:
Trigger $ats.hours >= 22 and $ats.hours <= 21
Expand to see the code.
Quote:
Thx for helping me out and btw how do u end trigger?
You don't have to "end" it.
Compatibility
Requires SDK2.2 parts I & II
Credits and Thanks
Credit for Near Fantastica for the original idea and busbuzz for requesting a SDK2 version.