Customizing Heirukichi's Day/Night Clock script to include troop variations

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Hey there! Been fiddling a bunch with Heirukichi's day/night clock (https://heirukichiworks.wordpress.com/coding/vx-ace-scripts/vxace-daynightcycle/). Fits my needs fantastically, spare one detail. It's important that I be able to customize what troops appear in random encounters depending on whether it is day or night depending on the script's clock. I'd rather not scratch off the script in favor of my own day/night cycle through eventing, but I'm struggling to find a way to integrate troop variation into the day/night cycle without messing with the script itself.

Of course, if it comes down to it I'll pay someone to edit the script for me. But I'd like to make sure this is an issue that requires that method, and isn't just a matter of me not knowing how to event it properly. My initial plan was to use a mix of variables, regions and all processing being handled via. event (as mentioned in this old post: https://forums.rpgmakerweb.com/inde...e-troop-encounters-based-on-time-of-day.2748/ ), but if anyone has any better solutions, I'm all ears.

Final note, I don't mess with forums much, never have. So I'm still getting a feel for how things here work. Please tell me if there's anything I should be doing or be doing differently.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
How are you using random troops now? How are they activated?
There are script calls you can do to get the current time from the script,
such as $game_clock.day? $game_clock.night? $game_clock.dawn? $game_clock.dusk?
$game_clock.hour24
 

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
How are you using random troops now? How are they activated?
There are script calls you can do to get the current time from the script,
such as $game_clock.day? $game_clock.night? $game_clock.dawn? $game_clock.dusk?
$game_clock.hour24
Right now I'm just doing the basic encounters through map properties as I work on figuring how to attach troops to the script's time.

It's good to know that those script calls exist. How would one go about making encounter troops based on the script's time using these script calls? Adding them in map properties probably wouldn't work, nor in troops directly. I've been trying to wrap my head around the concept of using event processing for encounters, to little success.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
You could do a modification to the make_encounter_troop_id in Game_Player and a note tag for the map.
The note tag would specify what troops to use for the specified time of day and then the encounter list can be adjusted to only include those troops.

Working scripts
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Random Day Battle            ║  Version: 1.02     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Set specific troops for           ╠════════════════════╣
# ║   battles during the day or night   ║    05 Jul 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Place below Heurikichi day/night script                ║
# ║   Specify in the map, the note tag stating               ║
# ║   which troops will be at what time                      ║
# ║      Map has 12 troops in the list                       ║
# ║   <RDB: Time, troop 1 id, troop 2 id, etc>               ║
# ║   <RDB: 6, 1, 2, 3>                                      ║
# ║   <RDB: 12, 4, 5, 6>                                     ║
# ║   <RDB: 18, 7, 8, 9>                                     ║
# ║   <RDB: 24, 10, 11, 12>                                  ║
# ║                                                          ║
# ║  Hour is checked from value - interval to current time.  ║
# ║  So if it is 1500, then the third one will take action   ║
# ║  0-6 = false, 7-12 = false, 13-18 = true, 19-24 = false  ║
# ║                                                          ║
# ║  You can split is up as much as you want.                ║
# ║  * note that is you have 2 troops and specifiy them      ║
# ║    as <RTB: 1, 1, 2, 3>                                  ║
# ║    then the battle will only occur between 0000 and 0100 ║
# ║    and it will not do any other battle                   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║   2022-Jul-04 - Initial publish                          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker VX Ace - except nudity    ║
# ║ Thanks to Yanfly for code structure                      ║
# ╚══════════════════════════════════════════════════════════╝

module R2_RDB_MAP
  RDB = /<RDB:[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  Time_Intervals = 6 # needs to be set intervals that work with your note tags
end

class RPG::Map
  attr_accessor :random_day_battle
  attr_accessor :random_day_battle_time
  def load_notetags_rdb
    r2td = {}
    r2data = []
    @random_day_battle_time = []
    @random_day_battle = []
    i = 0
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when R2_RDB_MAP::RDB
        $1.scan(/\d+/).each { |num|
        r2data.push(num.to_i) if num.to_i > 0 }
      end
      r2td[i] = r2data
      r2data = []
      i += 1
    }
    i = 0
    return if r2td.empty?
    r2td.each_value do |r2se|
      @random_day_battle_time[i] = r2se[0]
      adj = r2se
      adj.shift
      @random_day_battle[i] = adj
      i += 1
    end
  end
end

class Game_Map
  attr_accessor :random_day_battle
  attr_accessor :random_day_battle_time
  alias game_map_setup_rdb setup
  def setup(map_id)
    game_map_setup_rdb(map_id)
    @map.load_notetags_rdb
    @random_day_battle = @map.random_day_battle
    @random_day_battle_time = @map.random_day_battle_time
  end
end

class Game_Player < Game_Character
  def make_encounter_troop_id
    encounter_list = []
    weight_sum = 0
    rdb = false
    @timebattleid = -1
    etime = $game_clock.hour24
    btime = $game_clock.hour24 - R2_RDB_MAP::Time_Intervals
    btime = 0 if btime < 0
    if $game_map.random_day_battle == []
      $game_map.encounter_list.each do |encounter|
        next unless encounter_ok?(encounter)
        encounter_list.push(encounter)
        weight_sum += encounter.weight
      end
    else
      $game_map.random_day_battle_time.each_with_index do |cl, b|
        if (cl < etime)
          if (cl > btime)
          @timebattleid = b
          end
        end
        rdb = true if cl != nil
      end
      $game_map.encounter_list.each do |encounter|
        next unless encounter_ok?(encounter)
        if rdb == true
          next if !$game_map.random_day_battle[@timebattleid].include?(encounter.troop_id)
        end
        encounter_list.push(encounter)
        weight_sum += encounter.weight
      end
    end
    if weight_sum > 0
      value = rand(weight_sum)
      encounter_list.each do |encounter|
        value -= encounter.weight
        return encounter.troop_id if value < 0
      end
    end
    return 0
  end
end

Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Random Day Battle            ║  Version: 1.02a    ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Set specific troops for           ╠════════════════════╣
# ║   battles during the day or night   ║    05 Jul 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Place below Heurikichi day/night script                ║
# ║   Specify in the map, the note tag stating               ║
# ║   which troops will be at what time                      ║
# ║      Map has 12 troops in the list                       ║
# ║   <RDB: Time, troop 1 id, troop 2 id, etc>               ║
# ║   <RDB: 0, 1, 2, 3>                                      ║
# ║   <RDB: 6, 4, 5, 6>                                      ║
# ║   <RDB: 12, 7, 8, 9>                                     ║
# ║   <RDB: 18, 10, 11, 12>                                  ║
# ║                                                          ║
# ║  Hour is checked from 0 forward.                         ║
# ║  So if it is 1500, then the third one will take action   ║
# ║  0-6 = false, 7-12 = false, 13-18 = true, 19-24 = false  ║
# ║                                                          ║
# ║  You can split is up as much as you want.                ║
# ║  * note that is you have 2 troops and specifiy them      ║
# ║    as <RTB: 1, 1, 2, 3>                                  ║
# ║    then the battle will only occur between 0000 and 0100 ║
# ║    and it will not do any other battle                   ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║   2022-Jul-04 - Initial publish                          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker VX Ace - except nudity    ║
# ║ Thanks to Yanfly for code structure                      ║
# ╚══════════════════════════════════════════════════════════╝

module R2_RDB_MAP
  RDB = /<RDB:[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  Time_Intervals = 6 # needs to be set intervals that work with your note tags
end

class RPG::Map
  attr_accessor :random_day_battle
  attr_accessor :random_day_battle_time
  def load_notetags_rdb
    r2td = {}
    r2data = []
    @random_day_battle_time = []
    @random_day_battle = []
    i = 0
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when R2_RDB_MAP::RDB
        $1.scan(/\d+/).each { |num|
        r2data.push(num.to_i) }
      end
      r2td[i] = r2data
      r2data = []
      i += 1
    }
    i = 0
    return if r2td.empty?
    r2td.each_value do |r2se|
      @random_day_battle_time[i] = r2se[0]
      adj = r2se
      adj.shift
      @random_day_battle[i] = adj
      i += 1
    end
  end
end

class Game_Map
  attr_accessor :random_day_battle
  attr_accessor :random_day_battle_time
  alias game_map_setup_rdb setup
  def setup(map_id)
    game_map_setup_rdb(map_id)
    @map.load_notetags_rdb
    @random_day_battle = @map.random_day_battle
    @random_day_battle_time = @map.random_day_battle_time
    p(@random_day_battle)
    p(@random_day_battle_time)
  end
end

class Game_Player < Game_Character
  def make_encounter_troop_id
    encounter_list = []
    weight_sum = 0
    rdb = false
    @timebattleid = -1
    etime = $game_clock.hour24 + R2_RDB_MAP::Time_Intervals
    btime = $game_clock.hour24
    etime = 24 if etime > 24
    if $game_map.random_day_battle == []
      $game_map.encounter_list.each do |encounter|
        next unless encounter_ok?(encounter)
        encounter_list.push(encounter)
        weight_sum += encounter.weight
      end
    else
      p($game_map.random_day_battle_time)
      $game_map.random_day_battle_time.each_with_index do |cl, b|
        p(cl)
        p(etime)
        p(btime)
        if (cl < etime)
          if (cl >= btime)
          @timebattleid = b
          end
        end
        rdb = true if cl != nil
      end
      $game_map.encounter_list.each do |encounter|
        next unless encounter_ok?(encounter)
        if rdb == true
          next if !$game_map.random_day_battle[@timebattleid].include?(encounter.troop_id)
        end
        encounter_list.push(encounter)
        weight_sum += encounter.weight
      end
    end
    if weight_sum > 0
      value = rand(weight_sum)
      encounter_list.each do |encounter|
        value -= encounter.weight
        return encounter.troop_id if value < 0
      end
    end
    return 0
  end
end
 
Last edited:

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
You could do a modification to the make_encounter_troop_id in Game_Player and a note tag for the map.
The note tag would specify what troops to use for the specified time of day and then the encounter list can be adjusted to only include those troops.

*not tested
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Random Day Battle            ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Set specific troops for           ╠════════════════════╣
# ║   battles during the day or night   ║    01 Nov 2020     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Place below Heurikichi day/night script                ║
# ║   Specify in the map, the note tag stating               ║
# ║   which troops will be at what time                      ║
# ║      Map has 12 troops in the list                       ║
# ║   <RDB: Time, troop 1 id, troop 2 id, etc>               ║
# ║   <RDB: 6, 1, 2, 3>                                      ║
# ║   <RDB: 12, 4, 5, 6>                                     ║
# ║   <RDB: 18, 7, 8, 9>                                     ║
# ║   <RDB: 24, 10, 11, 12>                                  ║
# ║                                                          ║
# ║  Hour is checked from 0 forward.                         ║
# ║  So if it is 1500, then the third one will take action   ║
# ║  0-6 = false, 7-12 = false, 13-18 = true, 19-24 = false  ║
# ║                                                          ║
# ║  You can split is up as much as you want.                ║
# ║  * note that is you have 2 troops and specifiy them      ║
# ║    as <RTB: 1, 1, 2, 3>                                  ║
# ║    then the battle will only occur between 0000 and 0100 ║
# ║    otherwise it will select randomly as per normal       ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║   2022-Jul-04 - Initial publish                          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker VX Ace - except nudity    ║
# ║ Thanks to Yanfly for code structure                      ║
# ╚══════════════════════════════════════════════════════════╝

module R2_RDB_MAP
  RDB = /<RDB:[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    Time_Intervals = 6 # needs to be set intervals that work with your note tags
end

class RPG::Map
  attr_accessor :random_day_battle
  attr_accessor :random_day_battle_time
  def load_notetags_rdb
        r2td = {}
        @random_day_battle_time = []
        @random_day_battle = []
        i = 0
    self.note.split(/[\r\n]+/).each { |line|
      when R2_RDB_MAP::RDB
        $1.scan(/\d+/).each { |num|
        r2data.push(num.to_i) if num.to_i > 0 }
      end
            r2td[i] = r2data
            i += 1
    }
        i = 0
        return if r2td.empty?
        r2td.each_value do |r2se|
            @random_day_battle_time[i] = r2se[0]
            adj = r2se
            adj.shift
            @random_day_battle[i] = adj
            i += 1
        end
       
  end
end

class Game_Map
  alias game_map_setup_rdb setup
  def setup(map_id)
    game_map_setup_rdb(map_id)
    @map.load_notetags_rdb
  end
end

class Game_Player < Game_Character
  def make_encounter_troop_id
    encounter_list = []
    weight_sum = 0
        rdb = false
        etime = $game_clock.hour24
        btime = $game_clock.hour24 - R2_RDB_MAP::Time_Intervals
        btime = 0 if btime < 0
        if $game_map.random_day_battle == []
            $game_map.encounter_list.each do |encounter|
                next unless encounter_ok?(encounter)
                encounter_list.push(encounter)
                weight_sum += encounter.weight
            end
        else
            $game_map.random_day_battle_time.each_with_index do |cl, b|
                if cl < etime && cl > btime
                    timebattle = b
                    rdb = true
                end
            end
            $game_map.encounter_list.each do |encounter|
                next unless encounter_ok?(encounter)
                if rdb == true
                    next if !$game_map.random_day_battle[timebattle].include?(encounter.troop_id)
                end
                encounter_list.push(encounter)
                weight_sum += encounter.weight
            end
        end
    if weight_sum > 0
      value = rand(weight_sum)
      encounter_list.each do |encounter|
        value -= encounter.weight
        return encounter.troop_id if value < 0
      end
    end
    return 0
  end
end
I appreciate the help! As of right now my game crashes on startup, the following error being:

But while I'm posting, I do have some questions. Does your script read the time as the hour frames or the 0-48 half-hour system some of Heirukichi's script calls follow?

So, for example, would the correct note to set an encounter to 10:30 be:

<RDB: 45, troop_id>? Or would it go by the hour frames? I can't give an example for hour frames since I have no idea how to go about a formula for calculating what hour frames would correlate to 10:30.
 

Attachments

  • Screenshot_111.png
    Screenshot_111.png
    3.2 KB · Views: 2

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
I put a line in to fix the crash. At least it should, as I said - untested.

If you require 30 minute segments then I would have to change the code. As of right now it is designed to use the 24 hour clock, which return a whole number between 0-24. (1,2,3,4,5,6,7, etc)
<RDB: 12, troop_id>
 

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
I put a line in to fix the crash. At least it should, as I said - untested.

If you require 30 minute segments then I would have to change the code. As of right now it is designed to use the 24 hour clock, which return a whole number between 0-24. (1,2,3,4,5,6,7, etc)
<RDB: 12, troop_id>
Oh, it using the 24 hour clock makes things a lot easier, it seems I was just overcomplicating things haha.

Running into another crash however. Not upon startup which is good, but it crashes after a bit of time in the first map (which doesn't have any encounters). Not sure if this one is on your end or mine.
 

Attachments

  • Screenshot_113.png
    Screenshot_113.png
    3.2 KB · Views: 2

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
This is why I said untested.

didn't think Game_map needed to read those.
try again.
There's no rush, and once again I greatly appreciate the assistance. At this point I should probably be paying you though. Another crash, seems to follow the same pattern as the previous.
 

Attachments

  • Screenshot_114.png
    Screenshot_114.png
    2.7 KB · Views: 1

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Too many, so I had to load it into the time demo and test it.
Updated above. try again
The good news is that it's stable, no crashes or anything thus far. Having difficulties getting it to work, however. I'll attach an image of my map properties, but I've been trying to have troop 1 spawn during the day (8) and troop 2 spawn during the night (22). I've tried both day and night and both enemies will spawn regardless.

I don't think I've messed up the time calculations, but I can send what settings I have for the script. Is it something to do with the time intervals module that I've thus far avoided?

This isn't related to your script, but I have noticed a concerning issue with the clock script itself. The "$game_clock.set_time" script call doesn't seem to work for me. It doesn't crash the game, but throwing the script call into an event has no effect. I realized this when I was trying to experiment with your script. I've already isolated your script and tried the script call without your script and it still didn't work, so I don't think it's an issue with your script. Odd.
 

Attachments

  • Screenshot_115.png
    Screenshot_115.png
    32.1 KB · Views: 2

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
both enemies will spawn regardless.
I found that problem after posted the change and fixed it yesterday.
Now 1.02 version. You may not have noticed.
That time script seems to have issues as for me it goes through a day in about 1 minute.
I increased the frames (18000 to 180000) in the script and it still went really fast (1 minute)
And that was from the demo for that script.

The script has debug mode on by default.

*update
Did a test, set the hour frames to 1800000000 and it did not make a difference.
Set the hour frames to 1 and line 359 hour frames to 6000, then it processed at a reasonable time for me. 20 minutes in game at about 30 seconds real life. approximately.
Ok so the $game_clock.set_time is in 30 minute intervals.
 
Last edited:

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
I found that problem after posted the change and fixed it yesterday.
Now 1.02 version. You may not have noticed.
That time script seems to have issues as for me it goes through a day in about 1 minute.
I increased the frames (18000 to 180000) in the script and it still went really fast (1 minute)
And that was from the demo for that script.

The script has debug mode on by default.

*update
Did a test, set the hour frames to 1800000000 and it did not make a difference.
Set the hour frames to 1 and line 359 hour frames to 6000, then it processed at a reasonable time for me. 20 minutes in game at about 30 seconds real life. approximately.
Ok so the $game_clock.set_time is in 30 minute intervals.
No luck as of yet, troops still spawning when they shouldn't. Right now I have the note tags as:
<RDB: 1, 1>
<RDB: 20, 2>
Troop 1 at 1AM and troop 2 at 8PM

In your script I have time intervals set to 12 (I only need one phase for day and one for night).
In the clock script I have the starting phase set to 2 (1AM) (since I still can't use $game_clock.set_time for some reason, I've been setting the starting phase to test).
Let me know what you think.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
In your script I have time intervals set to 12
So because the script does not account for reverse numbering, that means the first troop will only be fighting between 0000 and 0100. the second troop will fight between 0800 and 2000

troops still spawning when they shouldn't
Can't be sure of the issue. I only used Heirukichi's demo and put my script in. I made it print messages to the console. and I saw it reporting checks but no battle because it was not the correct time.

Do you want to share your project with me, or make a copy with the minimum needed to test?
 

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
So because the script does not account for reverse numbering, that means the first troop will only be fighting between 0000 and 0100. the second troop will fight between 0800 and 2000


Can't be sure of the issue. I only used Heirukichi's demo and put my script in. I made it print messages to the console. and I saw it reporting checks but no battle because it was not the correct time.

Do you want to share your project with me, or make a copy with the minimum needed to test?
Sure, I'll zip up a full copy since right now it's only 15MBs. Is there a preferred way of sending it to you? My initial thoughts involve zipping it up, throwing it in my Google Drive and sending you a link to it, but if you have a better way let me know.

Alright, it's taking me awhile but I'm starting to comprehend the numbering system. So in order to make troop 1 appear from 0000 to 1200, it would be:
<RDB: 0, 1>
And after 1200 the enemy would no longer spawn, allowing me to make another note for troop 2 to spawn from 1200 to 2400 via. <RDB: 12, 2>?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
Alright, it's taking me awhile but I'm starting to comprehend the numbering system. So in order to make troop 1 appear from 0000 to 1200, it would be:
Sorry for it to be confusing, here is how it currently works
Interval = 6
<RDB: 8, 1>
troop 1 is active during 0200-0800

<RDB: 12, 2>
troop 2 is active between 0600-1200

<RDB: 20, 3>
troop 3 is active between 1400-2000

If you have the interval set to 12, then
whatever number you put there is subtracted by 12

So in the case of troop 1 the troop will be active between 0000 and 0800
The number does not revolve around to 2200.
If the beginning time is below 0 then it is set to 0.
If it is not done that way then there are a lot more calculations that need to be done.

So if you want troop 1 to be active between 2000 and 0600 you need to set three conditions
<RDB: 24, 1> 2000-2400
<RDB: 6, 1> 0200-0600
<RDB: 2, 1> 0000-0200
with the time interval set to 4

If you still feel you need to send me a demo then anything that lets me download it is fine, I don't care.
 

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Sorry for it to be confusing, here is how it currently works
Interval = 6
<RDB: 8, 1>
troop 1 is active during 0200-0800

<RDB: 12, 2>
troop 2 is active between 0600-1200

<RDB: 20, 3>
troop 3 is active between 1400-2000

If you have the interval set to 12, then
whatever number you put there is subtracted by 12

So in the case of troop 1 the troop will be active between 0000 and 0800
The number does not revolve around to 2200.
If the beginning time is below 0 then it is set to 0.
If it is not done that way then there are a lot more calculations that need to be done.

So if you want troop 1 to be active between 2000 and 0600 you need to set three conditions
<RDB: 24, 1> 2000-2400
<RDB: 6, 1> 0200-0600
<RDB: 2, 1> 0000-0200
with the time interval set to 4

If you still feel you need to send me a demo then anything that lets me download it is fine, I don't care.
I should be the sorry one for not catching on easily. Regardless, my understanding is getting a little better, but not perfect.

What I'm trying to do is half the Daytime troops continue from 0600-1800 (6AM to 6PM), then the Nighttime troops continue from 1800-0600 (6PM to 6AM). That'll most likely be as complicated as things will be for my purposes with the project.

So I'm going to send you what I think is what would work and you can tell me what elements I'm wrong or mistaken on. This is on a time interval of 4.

<RDB: 6, 1> 0600-1000
<RDB: 10, 1> 1000-1400
<RDB: 14, 1> 1400-1800
<RDB: 18, 2> 1800-2200
<RDB: 22, 2> 2200-2400 (assuming the time will end at 2400 and not loop)
<RDB: 0, 2> 0000-0400
<RDB: 4, 2> 0400-0800

Now this wouldn't work exactly since the 4 interval would cause the Nighttime enemies to carry on until 0800 rather than 0600, but for the purpose of demonstration, would this work?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
<RDB: 6, 1> 0600-1000
<RDB: 10, 1> 1000-1400
<RDB: 14, 1> 1400-1800
<RDB: 18, 2> 1800-2200
<RDB: 22, 2> 2200-2400 (assuming the time will end at 2400 and not loop)
<RDB: 0, 2> 0000-0400
<RDB: 4, 2> 0400-0800
Your still doing them backwards.
The time subtracts not add.

But maybe I can see if I can reverse it. Might make things easier to understand and flow.

But in your example if you are doing 12 hours blocks then you could do 6 for the time interval and specify the note tags as follows.
<RDB: 6, 2>
<RDB: 12, 1>
<RDB: 18, 1>
<RDB: 24, 2>
then troop 1 fights from 0600 - 1800 and troop 2 from 1800-0600
But if you offset it like you did by having them split at 1400, then the time interval would get complicated.

Let me do a revision and see if I can reverse the time checks.

Also tell me exactly what time periods you want each troop to be in and I'll write down the note tags and interval for you.

* looking back at my instructions, I explained it in reverse.
 
Last edited:

Descendancy

Villager
Member
Joined
Nov 17, 2021
Messages
18
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Apologies, I'm really bad at subtraction.. or rather finding a way to calculate subtraction. There's no pressure to revise, I'll get the hang of it with enough time and effort.

If you want however, I only actually need one set of note tags. Like in my previous post, I only need note tags for 0600-1800 (6AM to 6PM) and 1800-0600 (6PM to 6AM). Enough to throw in enemies during the day and during the night, it will never be more complex than that. Once I know the correct time numbers and interval that can achieve that, I can just copy/paste them into each map, then edit in the appropriate troops and that will work for the entire game.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,287
Reaction score
1,168
First Language
English
Primarily Uses
RMVXA
Once I know the correct time numbers and interval that can achieve that,
Looking back at my instructions I explained it in a reverse sort of way, but kind of the same.
I have made the change and two scripts are there now.
 

Latest Threads

Latest Posts

Latest Profile Posts

ScreenShot_8_19_2022_8_51_4.png
Both Mike and Ray here are in a "HYPE!" state after Mike uses "Wild Party", which also heals everyone. they'll do more damage and counter more often, but defense is lower along with hit rate.
WHEEL3.gif
Ooker spookers and fun attack mechanics! What a Friday!
Not today... Not today...
I guess I should send my CV to Hasbro. I've made Monopoly cheaters edition more fun and challenging. I've developed custom cheats and chest/chance cards for it. And I've cleared many nightmares through my cards and rules.
I'm only missing 2 more bgms for my game but maaaaan, searching for these tracks is killing me. Can't find anything good to replace MZ's Theme 2 and Scene 5 I have as placeholders. Everything is too epic or too evil or too alarming. That 'scene 5' track in particular would fit nicely with my scene. Well, at least I finally figured what my last click-fest of a gameplay element will be like, so something positive :D

Forum statistics

Threads
124,707
Messages
1,165,417
Members
163,520
Latest member
Foxx042
Top