Fog of War
#3
EDIT 1:

Well, I said I was considering 'proper formatting'... It sure helped.  Consider THIS:


  #--------------------------------------------------------------------------
  # * Get map name
  #--------------------------------------------------------------------------
  def map_name
    return load_data('Data/MapInfos.rxdata')[@map_id].name
  end
  #--------------------------------------------------------------------------
  # * Frame Update: What tiles have been discovered or not currently covered
  #--------------------------------------------------------------------------
  def update_fow_grid
    px = $game_player.x
    py = $game_player.y
    x = px - @fow_range
    start_y = py
    y = start_y
    count = 1
    mod = 1


I think I kinda found WHERE to perform a simple bit of 'surgery' to the original script.  The below change works:


  #--------------------------------------------------------------------------
  # * Frame Update: What tiles have been discovered or not currently covered
  #    px : (Optional) x coordinate for target event revealing map
  #    py : (Optional) y coordinate for target event revealing map
  #--------------------------------------------------------------------------
  def update_fow_grid(px=$game_player.x, py=$game_player.y)
   
    # Define x/y update coordinates based on passed x/y values
    x       = px - @fow_range
    start_y = py
    y       = start_y
    count   = 1
    mod     = 1


AND... it actually works.

By doing so, I can insert x/y coordinates into the  command to reveal 'areas' outside of the player's coordinates, assuming I also pass a couple other commands too:

[Image: attachment.php?aid=2731]

This was the result, the events around me vanished while the events in the 'circled' dynamic area were visible.  Fixed by re-executing the commands with the focus on the player.

Current WIP demo:

.zip   Fog of War Demo - Copy.zip (Size: 936.37 KB / Downloads: 1)
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Messages In This Thread
Fog of War - by Tepe - 11-05-2024, 12:42 AM
RE: Fog of War - by DerVVulfman - 11-05-2024, 05:06 PM
RE: Fog of War - by DerVVulfman - 11-05-2024, 06:15 PM
RE: Fog of War - by Tepe - Yesterday, 04:11 AM
RE: Fog of War - by Tepe - Yesterday, 02:49 PM



Users browsing this thread: 4 Guest(s)