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.

ATS help

Hi im using Near Fantastica's ATS and I was wondering how do you make events happen at a certain time for instance a shop owner going to his house at dusk and returning at dawn?

I already know how to increase the time but how do I set it to a specific time? And how do I make an event wait untill a specific time to do something?

Thanks in advance
 
You need Event Trigger Script, are you using SDK 2.2?

this script is tibuda's Event trigger, credit him just use comments in the events with the word
"Trigger" and the parameters $ats.hours_is >= (x)
u can use <= too

so if u wanna have something begin 8am u put a comment with
Trigger $ats.hours_is >= 8

you can play with the event pages so if u want something to happen from
8am to 9pm u should make 2 pages

page 1

Trigger $ats.hours_is >= 8
and in the next lines u put what u want to happen after 8, this page won't be read if ats.hours is less than 8 (as if there were no events there)

page 2

Trigger $ats.hours_is >= 21
and nothing else, so when its 21 hours there's nothing, its an empty event


Code:
#==============================================================================
# ** 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])

#--------------------------------------------------------------------------
# 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
#--------------------------------------------------------------------------__________________
 

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