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.

Terrain Tag not updating [Resolved!]

I'm having a slight problem, I wrote a script that does walking sound effects depending on terrain, but the SE never changed like it should when I walk on grass/wood/water, etc.

So then I made a simple Debug HUD that would show player X/Y/Terrain, etc... and it showed the terrain tag never changed.

So then I wrote it into a script

$game_variables[Player::Terrain] = $game_player.terrain_tag

in the Scene_Map update method, still didn't update the variable

So evidentally, my terrain tags aren't working. I even tried it on a new map, made sure nothing invisible with a diff terrain was overlapping... any solutions on why I'm having this problem?
 

Kraft

Sponsor

I dont know how to do it with a script, but all you need to update the variable is a parallel process event on the map that is set to update variable XXX with the players terrain tag, and then wait like 2 frames.
 
It's not the variable I'm having a problem with, these screenshots will show you that everything successfully updates except the terrain... so there's something wrong with my terrain tags.

Please excuse the poor looking map, I just auto-filled all the grass with water autotile, I wasn't aiming for esthetics, here goes.

The terrain is set...
http://i224.photobucket.com/albums/dd28 ... unoob3.png[/img]
Land is, by default, 0
http://i224.photobucket.com/albums/dd28 ... unoob1.png[/img]
Water is supposed to be 7
http://i224.photobucket.com/albums/dd28 ... unoob2.png[/img]

Everything but the terrain updates, I'm not sure WTF is wrong with it XD

Although not pictured in these examples, I tried setting the ENTIRE tileset with 7, and I've got both a common event and a script tracking terrain and all the other things... so its obviously a problem with the terrain. Does anybody know why the terrain isn't registering?
 
$game_variables[Player::Terrain] = $game_player.terrain_tag

What does "Player::Terrain" do?  What does it return?  (which game_variable are you setting to the current terrain?)

Try using a static number.  (  $game_variables[1] = $game_player.terrain_tag  )

Otherwise, post a small demo with the HUD & map for one of us to debug.

Be Well
 
Player::Terrain is just a module that hold's the variable ID that player's terrain is stored in.

Code:
module Player
  Terrain = 6
end

I'll go ahead and upload a lite demo with everything set... I'm starting to think its my RPGXP because terrain doesn't work in any of my projects anymore, and one of 'em used terrain alot and I haven't touched it.

Give me a min to clean up all the extra weight from the project and I'll mediafire it.
 
Early bump (before I'm not even on this page anymore) :-X

If somebody could d/l the demo and let me know if they've got the same problem, or if its working, because I've already re-installed and terrain should be working but it still isn't...

Just tell me if it works on your computer, and if it does then that means only my terrain doesn't work and I should get a life...
 
Does the terrain update? If the HUD is in view, it should say 7, if not just F9 and see if variable 6 is 0 or if it's 7.

I'm not really worried about the step sounds because I know it works, I just don't think my terrain tags work (at least from my RPGXP) so thats what I was looking for. Is your terrain changing in my demo?

If terrain is working from my demo on your computer, I'll probably just have to re-download RMXP from the Enterbrain site, because re-install didn't help.
 
Comment line 242 in [KN]::Player/Map Scripts

  attr_accessor :terrain_tag

over-writes the "terrain_tag" method to return (or set) the "terrain_tag" parameter of Game_Player, which doesn't exist. The "terrain_tag" method should be returning $game_map.terrain_tag.
Since there is a method to handle the call, you don't need to 'attr_accessor' the parameter.

Be Well
 

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