Hello everyone!
I am trying to develop a Wall sliding event that works mainly based on Ice sliding.
The concept is the following: If you are facing Down the wall (and if the rock wall permits it) you will slide down the wall till you touch the "grass". Here an image to show it. I will also Attach them at the bottom of the post.
The Event code used is:
The code underlying that I wrote in PField_Field is:
The problem is that the code is based on PBTerrain.isRock?, that I created simply by:
That condition is limiting. I would improve the script by changing it and setting a different IF statement that I can't find a way to define:
The problem for the First Condition is that while the player is sliding, since I wrote the Event of Sliding in this way , the player has THROUGH ON to slide on Rocks that are normally Non-Passable. Therefore, I can't find a easy way to reconize something Passable or not when the player is Through On.
The problem with the second condition is similar and I also don't know how to recall the properties of the Tileset's Tile that the Stop Event has.
Would someone be that kind and gentle to give me a hand?
Thank you in advance for your attention :)
I am trying to develop a Wall sliding event that works mainly based on Ice sliding.
The concept is the following: If you are facing Down the wall (and if the rock wall permits it) you will slide down the wall till you touch the "grass". Here an image to show it. I will also Attach them at the bottom of the post.
The Event code used is:
The code underlying that I wrote in PField_Field is:
Spoiler:
Code:
def Kernel.pbSlideOnRock(event=nil)
if $game_player.direction==2
event = $game_player if !event
return if !event
$PokemonGlobal.sliding = true
direction = event.direction
oldwalkanime = event.walk_anime
event.straighten
event.walk_anime = false
loop do
pbSEPlay("eb_ground2")
$scene.spriteset.addUserAnimation(DUSTBROWN_ANIMATION_ID,event.x,event.y,true,1)
break if !PBTerrain.isRock?(pbGetTerrainTag(event))
event.move_forward
while event.moving?
Graphics.update
Input.update
pbUpdateSceneMap
end
end
event.center(event.x,event.y)
event.straighten
event.walk_anime = oldwalkanime
$PokemonGlobal.sliding = false
end
end
The problem is that the code is based on PBTerrain.isRock?, that I created simply by:
Spoiler:
Code:
def PBTerrain.isRock?(tag)
return tag==PBTerrain::Rock
end
That condition is limiting. I would improve the script by changing it and setting a different IF statement that I can't find a way to define:
Code:
IF the tile the player is standing on while sliding is Passable
OR
IF the player is standing in a tile where there is an event, that has as Image a Tileset Tile that is itself Passable and with Priority==0
THEN the player stops sliding
The problem for the First Condition is that while the player is sliding, since I wrote the Event of Sliding in this way , the player has THROUGH ON to slide on Rocks that are normally Non-Passable. Therefore, I can't find a easy way to reconize something Passable or not when the player is Through On.
The problem with the second condition is similar and I also don't know how to recall the properties of the Tileset's Tile that the Stop Event has.
Would someone be that kind and gentle to give me a hand?
Thank you in advance for your attention :)
Attachments
Last edited: