Fog of War

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 98
2010 Best Veteran2014 Best Use of Avatar and Signature Space2014 King of RMRK2014 Favorite Staff Member2014 Best Counsel2014 Best Writer2014 Most Mature Member2014 Best IRC Chatterbox2013 Favorite Staff MemberSecret Santa 2013 ParticipantFor the great victory in the Breakfast War.Secret Santa 2012 Participant2011 Best Counsel2011 Best Writer2010 Best IRC Chatterbox2010 Funniest Member
I meant like, that you can't see what's ahead at all. No tile set, no events, nothing, and when you explore it and leave it, it's left with that gray area with no events visible.
you awoke in a burning paperhouse
from the infinite fields of dreamless sleep

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
You can do that. Just fill the Fog of War tile with black and set the sight to 1. Or am I missing something?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Yeah, that's in the script I think - the screenshot might be a little confusing since I had cleared all the walkable tiles, but the white stuff is everything within visibility, the grey stuff is where you have explored but is no longer visible (hides events too) and the black stuff along the borders would cover the whole map and only go away once you've brought it into visibility.

**
Rep: +0/-0Level 84
Current Project: RoSL
Hey modern algebra, I just started using this script and I love it.

I did run into what appears to be a slight bug, however, when transferring maps. Using the scripted auto-tile, and the temporary vision type (where you have a sight radius and nothing is "permanently" revealed), if you hit a transfer player event and then return to that same map at any given time, the spot where you left is still revealed.

So, example, exit a map on the right side via a Transfer Player event and then come back to that map. The right side where you hit the event will still be revealed as if the player were standing there.

Did I explain that well enough? If not, I can add a screenshot for you. Keep up the awesome work!

"How can I be expected to save the world, when I can't even save myself?" --Sysolos(Return of a Shadow Lord)

****
Rep:
Level 69
I'm using it as a torch type thing for a maze, is there any way I can set the bright area to 3x3 square(non-diamond) and then switch back and forth between that and basic 2-square-dist diamond at random?
                     X
XXX             XXX
XXX  <-->  XXXXX 
XXX             XXX
                     X
btw heart, I copied and pasted script and am only initiating with event and I don't have that prob :P
it only does it for me for like a split second then moves back to me
« Last Edit: August 21, 2011, 07:44:38 PM by Scalinger2 »

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
@Scalinger - yes, you can use the following code in a script call:

Code: [Select]
$game_player.create_vision_field (sight, circular?)

Ie. the following:

Code: [Select]
$game_player.create_vision_field (3, true)
would create the 3 radius circle while:
Code: [Select]
$game_player.create_vision_field (2, false)
would change it to 2 radius diamond.

I don't know what you mean by at random - you will need to event it so it's not totally random, but you could add some randomness through eventing.

@HoS - I see what you mean. I will whip up a fix.
« Last Edit: August 21, 2011, 08:28:25 PM by modern algebra »

****
Rep:
Level 69
sry, it's all good now lol

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
@HoS:

The fix:

Code: [Select]
#==============================================================================
#  Clear Temporary Layer Patch
#    Bug fix for Fog of War 1.0
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    There was a bug in the previous version where if you re-entered a map with
#   fog of war at a different location than you exited, the sight radius from
#   when the player exited would still be there. This patch fixes that bug.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this into its own slot below Fog of War but still above Main.
#==============================================================================

class Tilemap_FogofWar
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_hos_initz_fow_6yh2 initialize
  def initialize (*args)
    # Eliminate the top layer
    $game_system.paint_fog ($game_map.map_id, 0, 2816)
    $game_player.update_fow
    ma_hos_initz_fow_6yh2 (*args) # Run original method
  end
end
« Last Edit: August 21, 2011, 10:59:06 PM by modern algebra »

****
Rep:
Level 69
I spoke too soon.
This is what I tried..
var 16 and 17 are random, when they are equal it makes size1 diamond, when not equal, a circle
when your in the dark room it's suposed to active the circle and daimond pattern switch.

On the map I posted, the left side is like a lit room and the right side you use lantern but the problem is
when your in right side it stays to one shadow type then splotches it instead of doing a
random shadow pattern switch between circle and diamond.
http://dl.dropbox.com/u/33252047/Project2.zip

**
Rep: +0/-0Level 73
Sad Egg
About the lag.

The script runs 60 times in a second, right?

Isn't there a way to make it run less times in a second? Maybe 40~50 times per second... ?

Hello, i'm Japanese and my English is broken-

****
Rep:
Level 69
download this kgc library
the 'maplightening' decreases the number of events being processed on a map therefor decreasing lag
I have mine set to 65 events
http://www.mediafire.com/?jxouo3iebco

**
Rep: +0/-0Level 84
Current Project: RoSL
Thanks modern algebra!

Works like a charm now.

"How can I be expected to save the world, when I can't even save myself?" --Sysolos(Return of a Shadow Lord)

**
Rep:
Level 71
RMRK Junior
Been fiddling with the script.  Great work.  Being able to swap your own fog tileset in is a godsend.

Is there a quick way to adjust the player's sight range in-game?  Say I have a player touch a magical rock, and it increases the sight range to 5, from the default 3?

Edit: if not, there's a very easy workaround by having various events with fog sight above the character at all times.  So if the player's "fog sight" skill is 10, just turn the "10 fog sight" event on and have it follow above the player at all times.
« Last Edit: October 09, 2011, 01:30:20 AM by teknoarcanist »

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
THat would work, but there is a way to change it in game too:

Quote from: Instruction
Code: [Select]
#      2) Use the following code in a script command:
#        set_unit_vision (event_id, radius, circular?)
#          event_id  : ID of the event you want to change. If 0, sets the
#            vision of the current event; if -1, sets the player vision.
#          radius    : same as at line 71
#          circular? : same as at line 73

Sothe following in a script call should do it:

Code: [Select]
set_unit_vision (-1, 5)

**
Rep:
Level 71
RMRK Junior
Ah, see, this is why they should have taught reading when I was in school :P

Thanks lol

**
Rep:
Level 62
RMRK Junior
Hey MA, not sure if you are still working with this or not, but a couple of questions. Is there a way to keep both the permanent and temporary layers on, but still make all current graphic events visible without having to code it with

\fow_vision[3, true]

Basically, I want to use the temporary fog layer more for decorative, as in, I can still see my event moving, and when it's in my line of vision it's clear, but when it's in the temporary layer it's a bit obscure but still visible, and of course when it's in a place I haven't explored yet it's hidden.

I imagine it's a minor adjustment in how this script reveals events, but not sure how that would be changed.

My second question was if you had plans porting this over to VX-Ace, unless you already had and I'm missing it? Seeing as it's been a benefit with the last two makers, I think this would be great in Ace.

Thanks!

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, you can put a comment on the first line of an event page which has the following code:
Code: [Select]
\ignore_fow

If you really wanted to do it for every event, then you could also go to the following line in the script:

Code: [Select]
      @ignore_fow = !comment[/\\IGNORE_FOW/i].nil?

And change it to:

Code: [Select]
      @ignore_fow = true

**
Rep: +0/-0Level 81
GAMING IS FUN!!!!!!!!!! *throws ps3 pad at HD tv*
You, my friend, are a genius!
one does not just simply walk into Mordor

*
Rep: +0/-0Level 51
RMRK Junior
can someone help i keep getting this error

Script 'Fog of War' line 175: SyntaxError occurred.

unexpected ',', expecting ')'
         ma_fow_systm_2fk9 (filename, *args)

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
This script is for VX. You are trying to insert it in to RMVX Ace.

****
I saw a squirrel...
Rep:
Level 82
...it got in my way.
I'm probably just blind, but is there a way to register whether or not another event is within your sight range? If so, I'm not seeing it. I would very much like to use this as a stealth system. It's perfect for simulating dim lighting combined with distance to your target. I realized recently that a game based around assassination should probably include at least one stealth feature.

EDIT: Also, is it possible to simply change the opacity of other events that are out of your sight range, or do they have to turn completely invisible?
« Last Edit: January 16, 2013, 07:17:11 PM by Strak »

Gods ain't gonna help ya son...

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
If you have the x and y coordinates of the events, then you can check:

Code: [Select]
$game_system.square_visible?(x, y)

As for whether you can just reduce the opacity instead of making it fully transparent, the answer is no, that's not a feature built into this script. You can, however, have events ignore the fog of war altogether by placing the \ignore_fow code into the first comment of the event. That won't reduce the opacity, but it will make them visible at least under the temporary fog.

****
I saw a squirrel...
Rep:
Level 82
...it got in my way.
Oh well. Thanks anyway, this does help a lot.

Gods ain't gonna help ya son...