RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Terrain Types (2k3)

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 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 Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Terrain Types
Version: 1.0
Author: modern algebra
Date: August 18, 2009

Version History


  • <Version 1.0> 08.18.2009 - Original Release

Description


This script restores the Terrain Types of RM2k3. Not only does this include a restoration of terrain tags (from XP), but it gives special settings that apply to tiles with those IDs. See Features for details.

Features

  • Restores many of the features of 2k3 Terrain Types
  • Scrolling Background (and Foreground) images for battle, depending on the terrain type you are standing on.
  • Encounter Multiplier for certain terrain types, so that encounters can be more or less frequent depending on the terrain
  • Footstep Sound Effects that apply not only to players, but to events as well (if you specify that they should). Further, the footsteps of events increase in volume as they approach the player and decrease in volume as they move away from the player
  • Terrain types that can hurt (or heal) the player when they step on
  • Walking Speed can be influenced by the type of terrain
  • You can set some terrains to disable dashing
  • You can set some terrains to prevent airship landing and others to allow it. Perfect for Airports!
  • And much more! Read Editable Region B at line 131 for more details

Screenshots



Instructions

Please see the header and the three editable regions for instructions. You MUST read them carefully, as configuration is quite tedious and may be difficult if you don't know what you're doing.

Script


Script is quite large. It is attached as a text document, but I suggest you retrieve it from the demo instead, so you can see how it works a little. Configuration is very difficult.

Credit


  • modern algebra

Thanks

  • Zeriab, for his table printout script
  • grafikal, for some early feedback

Support


Post in this topic for Support on this script. Please do not PM me.

Known Compatibility Issues

No currently known compatibility problems.

Demo


See Attached: Terrain Types Demo

Author's Notes

I wrote this script a long time ago and only recently remembered it. I'm hoping I didn't forget to add anything :P


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: February 11, 2010, 09:46:04 PM by Modern Algebra »

**
Rep:
Level 84
Koalas are awesome
Well there goes the use for my footsteps script down the drain... ;) I kid, I kid...

Very nice script! This is very very useful!! This is like a battle backs script, footsteps script and some features of you advanced areas script(I believe, maybe not though :D) meshed together, along with all the other features!! :)

Just out of curiosity, what are tables used for(I noticed that the Tile constants are tables instead of arrays or hashes)? Are they similar to Arrays? Not to go too off topic or anything, just kind of curious ;D

In another(unrelated) question; why do you only post your scripts here? It's amazing how many times people request scripts that are here :D Just wondering, for all I know you may just not want to... Okay I don't know where I'm going with this, but I'm just kind of curious ^_^

~Miget man12
Spoiler for BIG:
A mini-biography-ish thing of meI am learning to script with Ruby/RGSS2, I think I'm getting pretty good at it :)
Oh yeah, and I know Latin, that count's for something, doesn't it?
This is amazing, can you raed it?
Quote
Olny 55% of plepoe can raed this.
I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! Spelling is important!! :D
fi yuo cna raed tihs, palce it in yuor siantugre.
The Best Ruby Guide I've Found: Why's (poignant) guide to ruby

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 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 Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
haha, don't count on anything going down the drain :P. The configuration on this script is so heavy I'll be surprised if anyone uses it. The original reason I didn't post it was because I wanted to make a tool to make configuration easy, but I never got around to it. Besides, your footsteps script is really nice and easy to use - anyone who doesn't want all of these features are way better off just going for the single feature scripts that are out there, rather than going through the pain of configuring this just for one of the features.

As for tables - tables are sort of multi-dimensional arrays. Ruby's Array class doesn't run efficiently when handling large amounts of data; partly this is because they are so dynamic. You can have a 5 element array. and then put in for a 785th element and it wouldn't throw an error. Tables are fixed-size however, and they only take integers as values. Tables can be resized, but they have to be resized through a specific command. And like I said, they are multidimensional, so instead of array = [[[5, 6], [6, 6]], [[4, 5], [7, 5]]], which you could access like: array[0][1][0], you could make a Table like:

table = Table.new (2, 2, 2), and it would be accessed like this: table[0, 1, 0]


In the case of this script, the tables likely have little to no benefit. I used it only because they were fixed size and I did not need any dynamic function to it. Also, because the elements default to 0.

(I am not sure about this, but I also think tables only save non-zero elements and default return 0, rather than an array which would have to save every 0. That would make tables better for arrays that mostly consist of 0s. I might be mixing it up with something else entirely though)

As for only posting here. I sometimes post elsewhere, but I find the demands of support on larger forums takes a lot more time. (see how many times I post Try putting it under x script in this topic: http://www.rpgmakervx.net/index.php?showtopic=14687. That being said, they helped me find a lot of errors, so there are benefits to posting on larger forums)

Also, I like the community here a lot and I think it is easier for me and better for everyone if I keep all my scripts in one place and provide swift support rather than going here there and everywhere. But yeah, itès not that I have anything against other forums, just this is my favourite one and it is easier to provide support for my scripts if they are all in one place.
« Last Edit: August 19, 2009, 01:33:25 AM by modern algebra »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Hey MA, if you're around I figure it's simpler to ask you than to search around in the script. Is it possible to change it so that the player can walk on shallow and deep water only and not on land at all. Basically, instead of using the Ship vehicle or any standard vehicles I was hoping to just change actor graphic and using this change the tiles' passability on a whim.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 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 Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hey MA, if you're around I figure it's simpler to ask you than to search around in the script. Is it possible to change it so that the player can walk on shallow and deep water only and not on land at all. Basically, instead of using the Ship vehicle or any standard vehicles I was hoping to just change actor graphic and using this change the tiles' passability on a whim.

Umm, I can't really remember. I don't think so though. If you find a script that allows for changing hero pasability to ship or boat though, then I imagine the two would be compatible.

*
Rep: +0/-0Level 82
MA, Great script.  I agree it is heavy on the customization, but I like having as few 'logics' going as I can, so the diversity here is well worth it.  Just one thing; is there a way to call this script through an event, or to change a specific tile_id's attributes from a script or switch?  I am using Bulletxt's tile swapper, mostly for autotiles.  Right now I have a couple of autotiles that load as "swamp", with the damage =5 attribute.  This tile in a swapped tileset is a normal wasteland autotile (I think it is either tile_id 24 or 32).  I would like to add a script_call either to bulletxt's script, or to run when the switch controlling bulletxt's script is turned on.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 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 Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
You can try this code in a call script as you enter a new map:

Code: [Select]
ModernAlgebra::TT_TILE_X[y] = z

where X is the tileset, A, B, C, D, or E
y is the ID of the tile, 0-256
z is the terrain ID

I'm not positive that will work, and you'd definitely need to switch it back for the maps that don't use the swap.

*
Rep: +0/-0Level 82
MA, Thanks.  That works when using a teleport into a map with a new tileset perfectly, as long as it is put in the event prior to the actual teleport. 

For anyone using this with bulletxt's tile swap; calling $game_map.tileset to have a new tileset load on the current map will rerun the 'Terrain Types' with the values set up in the script.  I was able to have tile A24 be a 'damage causing swamp' in one map and normal 'no damage desert' in another, as long as TT_TILE_x[y] = z is before the tile swap commands and the teleport event.

Great Script!

***
Rep:
Level 89
This is so cool! I see many uses for that, missed that option from old RMs. Anyway, Owyn (aka modern_algebra), can I make thing, that while stepped on terrain ID = 3 for example, then the game switch number 3 is on? If yes, can you help me? ^^
Regards,
Mike

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 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 Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
No, not so much, but what you can do is set the terrain tag of the tile the player is on to a variable, and then check if the variable is 3. So, to do that, you would just use the code in a call script:

terrain_tag (variable_id, character_id)
  variable_id : the ID of the variable you are setting it to
  character_id : -1 => Player, 0 => This Event, >1 => event with that ID.

So,

terrain_tag (5, -1)

would set to variable 5 the terrain tag the player is standing on.

You could also put in X and Y coordinates to get the terrain tag of a particular position.

***
Rep:
Level 89
Thank you.  :)
Regards,
Mike

***
Rep:
Level 89
Sorry for double posting, but... I have a problem.
I tried, tried and tried, but the SelfTT tags won't work for me :( I've still got the lower terrain tag ID.
Could you please help me and check the script, modern?
Regards,
Mike

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 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 Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, it's \SelfOnlyTT, so make sure that's what you're using and not \SelfTT

***
Rep:
Level 89
Well, it's \SelfOnlyTT, so make sure that's what you're using and not \SelfTT
Yeah, sorry for being not too precise, but I'm using the correct code for sure. Even in your demo this tag won't work for me, I mean your 'stones in tall grass' sample.
Regards,
Mike

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 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 Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, it works for me in the demo; did you add some other script?

Also, keep in mind that SelfOnlyTT is meant to make it so that the terrain tag features only apply to that event, it isn't supposed to change the terrain tag of the tile under it. If you wanted the event to change the terrain tag of the tile under it when you get it (by x, y via variable for instance), then you would use the \TerrainTag code, not \SelfOnlyTT

But if you are having problems in the demo and the stones in tall grass aren't totally semi-transparent, then maybe you've added another script? IDK, upload it and share it I guess, because I'm not having that problem in the demo.