Elevtion passability |
|
|
|
|
Jun 28 2009, 10:50 AM
|

What did you expect...

Group: Revolutionary
Posts: 461
Type: Developer
RM Skill: Intermediate

|
This script solves the problem of how to stop the player stepping from one tile to the next when you've mapped them to look like there a few tiles away hieght wise. Instuctions in the script and if you need help with something just ask. Now these arn't very clear but..  Oh no, he cant miracously jump between things at differnt hieghts, what will he do..  Use the stairs Demo : http://www.mediafire.com/?sharekey=ac3e536...e018c8114394287CODE ###################### Breadlords Elavation Passability ######################## ## This script solves the problem of how to stop the player stepping from one ## ## tile to the next when you've mapped them to look like there a few tiles ## ## away hieght wise. To set up the different areas of 'elevation', while ## ## making the map in the editor, make an area named level:?, where ? is the ## ## elevation level you want it to have, and have the area cover the parts you ## ## want to be 'elevated'. You can have as many areas as you want with what - ## ## ever level of 'elavation' you want. Note : You can only have POSITIVE ## ## levels of elavation. Note : All parts of the map not in an area with level ## ## :whatever are counted as having a level of 0. To make a player be able to ## ## cross from 1 elavation level to an other use $game_player.level = whatever ## ## were whatever is whatever elavation level you want the player to go on, ## ## this must be put in an event directly before the place were the eleavation ## ## is what you've just set the player to go on, so say if |1| is an area with ## ## level 1 elavation and |2| is an area with level 2 elavation and |E| is an ## ## event with the command $game_player.level = 2 you would put the event like ## ## this : |1||E||2|. To set an events elavation level use $game_map.events[id]## ## .level = whatever, were id is the events id and whatever is the elavation ## ## you want it to have. ## ################################################################################
##### DO NOT EDIT # DO NOT EDIT # DO NOT EDIT # DO NOT EDIT # DO NOT EDIT #####
class Game_Character alias init initialize attr_accessor :level def initialize init @level = 0 end def in_area?(area) return false if @area == nil return false if $game_map.map_id != area.map_id return false if @x < area.rect.x return false if @y < area.rect.y return false if @x >= area.rect.x + area.rect.width return false if @y >= area.rect.y + area.rect.height @area = area return true end def in_areaxy?(area,x,y) return false if area == nil return false if $game_map.map_id != area.map_id return false if x < area.rect.x return false if y < area.rect.y return false if x >= area.rect.x + area.rect.width return false if y >= area.rect.y + area.rect.height return true end def map_passable?(x, y) a = nil b = nil for area in $data_areas.values if in_area?(area) c = area.name c.split(/[\r\n]+/).each do |line| if line.split(/[:]/)[0] == 'level' data = line.split(/[:]/)[1] a = data.to_i end end end if in_areaxy?(area,x,y) c = area.name c.split(/[\r\n]+/).each do |line| if line.split(/[:]/)[0] == 'level' data = line.split(/[:]/)[1] b = data.to_i end end end end if a != nil and b != nil if @level != b and a != b return false end @level = b elsif a == nil and b != nil if @level == 0 return false end @level = 0 elsif b == nil and a != nil if @level != 0 return false end @level = 0 else @level = 0 end return $game_map.passable?(x, y) end end
class Game_Player attr_accessor :level def in_area?(area) return false if area == nil return false if $game_map.map_id != area.map_id return false if @x < area.rect.x return false if @y < area.rect.y return false if @x >= area.rect.x + area.rect.width return false if @y >= area.rect.y + area.rect.height @area = area return true end def map_passable?(x, y) case @vehicle_type when 0 # Boat return $game_map.boat_passable?(x, y) when 1 # Ship return $game_map.ship_passable?(x, y) when 2 # Airship return true else # Walking a = nil b = nil for area in $data_areas.values if in_area?(area) c = area.name c.split(/[\r\n]+/).each do |line| if line.split(/[:]/)[0] == 'level' data = line.split(/[:]/)[1] a = data.to_i end end end if in_areaxy?(area,x,y) c = area.name c.split(/[\r\n]+/).each do |line| if line.split(/[:]/)[0] == 'level' data = line.split(/[:]/)[1] b = data.to_i end end end end if a != nil and b != nil if @level != b and a != b return false end @level = b elsif a == nil and b != nil if @level == 0 return false end @level = 0 elsif b == nil and a != nil if @level != 0 return false end @level = 0 else @level = 0 end return $game_map.passable?(x, y) end end end
__________________________
 Check out my project http://www.rpgrevolution.com/forums/index....showtopic=29698[Show/Hide] I thought my sig was to big so... Clicky clicky  I taste a bit like Almonds. Mmm, the taste of almonds - anathema to many with nut allergies, and a bad sign for many more, as my taste is not unlike that of cyanide. Am I good or am I poison? A risky thing to guess about. What Flavour Are You? What Mystical creature are you? Pegasus  You are a shy, night time person and you are very gentle and soft hearted. You are like the opposite from your cousin the unicorn. Which Final Fantasy Character Are You?Final Fantasy 7Cna yuo raed tihs? Olny 55% of plepoe can. 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! fi yuo cna raed tihs, palce it in yuor siantugre.
 Your answers suggest you are a Strategist The four aspects that make up this personality type are:  Summary of Strategists * Quiet, easy-going and intellectually curious * Use logical, objective thinking to find original solutions to problems * Think of themselves as bright, logical and individualistic * May be impractical, forgetting practical issues, such as paying bills or doing the shopping More about Strategists Strategists are quiet people who like to get to the heart of tough problems on their own and come up with innovative solutions. They analyse situations with a sceptical eye and develop ways of measuring everything, including themselves. Strategists are the group most likely to say they are unhappy in their job, according to a UK survey. Strategists are generally easy-going. They are intellectually curious and enjoy abstract ideas. Sometimes they like thinking of a solution to a problem more than taking practical steps to solve it. In situations where they can't use their talents, are unappreciated, or not taken seriously, Strategists may become negatively critical or sarcastic. Under extreme stress, Strategists could be prone to inappropriate, tearful or angry outbursts. Strategists may be insensitive to the emotional needs of others or how their behaviour impacts the people around them.
|
|
|
|
|
|
|
Posts in this topic
breadlord Elevtion passability Jun 28 2009, 10:50 AM Twilight Probably useful for some people but you can hold s... Jun 28 2009, 11:25 AM Octople Threat QUOTE (Twilight @ Jun 28 2009, 11:25 AM) ... Jun 28 2009, 12:46 PM Twilight Nothing left out, you just have to plan ahead, par... Jun 28 2009, 02:05 PM deffenex This is my dream script, I had even requested it, ... Jun 28 2009, 03:41 PM breadlord Octuple - For the jump system, don't use CTRL ... Jun 28 2009, 10:41 PM Octople Threat Using control isn't the problem... At least I ... Jun 29 2009, 08:30 AM breadlord RE: Elevtion passability Jun 29 2009, 08:37 AM Octople Threat NI-ICE! That is epic! You are really comin... Jun 29 2009, 10:49 AM breadlord Thanks Jun 29 2009, 11:10 AM tofuman This is great script.. So I tried it and...
It di... Jun 30 2009, 03:24 AM breadlord Demo uploaded. Jun 30 2009, 05:05 AM tofuman Wow! Thank you! I don't know what was ... Jun 30 2009, 05:37 AM breadlord Nice to hear Jun 30 2009, 05:46 AM tofuman Um.. sorry to post again... but.
When I used demo... Jun 30 2009, 06:33 AM breadlord If it says that, then that means there was a probl... Jun 30 2009, 06:42 AM tofuman I can't post it right now cause I'm curren... Jun 30 2009, 04:27 PM breadlord Ok. I'm a bit baffled though by why it wont wo... Jul 1 2009, 12:38 AM tofuman Here is link
http://www.mediafire.com/download.ph... Jul 1 2009, 04:10 AM breadlord I'm sorry to say this but the only reason I ca... Jul 1 2009, 04:38 AM tofuman geez... I also thought that was the problem... (Ac... Jul 1 2009, 04:44 AM breadlord Well I'm not deffinete about it, but I don... Jul 1 2009, 04:47 AM Twilight QUOTE (breadlord @ Jul 1 2009, 08:38 AM) ... Jul 2 2009, 08:38 PM breadlord Then I have absoulotely no idea what is causing th... Jul 2 2009, 11:35 PM 332211 I have a suggestion. Instead of events, if areas w... Jul 4 2009, 06:52 AM breadlord Thanks, and I'll try to do the .5 thing, thoug... Jul 4 2009, 10:09 AM FireRMVX hey can some1 help me. somethin in wrong with rmvx... Jul 7 2009, 06:43 PM breadlord Ok,wrong place, and it sounds like your just gonna... Jul 8 2009, 08:03 AM Khev Wow, that worked perfectly fine for me!
There... Jul 9 2009, 05:18 PM DestinMancer For some reason, I copied the two events leading f... Jul 17 2009, 11:56 AM SikAnTwisted Hell yeah!
Awesome script... Thanks a ton:D Jul 26 2009, 08:40 AM Automaton i just used alot of eventing to do this, but this ... Jul 31 2009, 08:46 AM Dyanova Hello. I'm not sure if anyone ever uses this t... Jan 2 2012, 09:36 PM Fonstw How did you make the line between the different pl... Jan 6 2012, 01:44 AM Dyanova QUOTE (Fonstw @ Jan 6 2012, 05:44 PM) How... Jan 7 2012, 11:17 PM  Fonstw QUOTE (Dyanova @ Jan 8 2012, 01:17 AM) QU... Jan 9 2012, 10:28 AM shaddowval to separate them, you need to keep an open space b... Jan 7 2012, 11:51 PM
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|