Large Sprite ☆ Display Fix

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
Large Sprite ☆ Display Fix
Created by Neon Black

What is it?

So Ace has this slight issue with tilesets when using larger sprites which causes all star tiles to appear above the character, even if it makes more sense that the character appear above a star tile (ie. a tree).  What this script does is allow you to "tag" a particular terrain type to appear behind the player when the player is lower than the tile itself.  As long as the player's  Y value is higher than the tile with the terrain tag, the player will appear above the tile rather than below it.

How can I use it?

Place this script below "materials" and above "main" in the script editor.  The script works automatically for the player.  For the script to work with events, in the page with the large sprite, add a comment box and add the tag <large sprite> to the comment box.

What does it work with?

This script works with most anything.  Certain precautions were also taken to make this script work properly with multiple frame walk scripts and other similar scripts.  This script has no overwrites and 4 aliases, so it has better compatibility when placed below most other scripts.  This script does not work with certain Victor scripts that affect movement.

How can I get the code?

Version 1.3 (base script, 1.12.2014) is available from my pastebin account here.

I would like to use this code.


This work is licensed under a Creative Commons Attribution 4.0 International License.

Author's Disclaimer:

So I really don't use large sprites, but I was approached about creating this script.  So of course I did it.  There were several odd things about it before I finally perfected it, but I believe in this version it should work quite well for most needs.  Additionally since this script does not overwrite default actions, it means that star tiles can still be used how they normally work when needed.  As always it's best to see which similar script works well with what you want to do in your project, but this script I'm sure will serve most people's needs.
 
Last edited by a moderator:

djDarkX

Retro & Remastered Music Guru
Veteran
Joined
Jan 17, 2013
Messages
2,699
Reaction score
1,892
First Language
Music
Primarily Uses
RMMV
Oh man.  Since hearing about this from Archeia, I had wondered if I'd ever get my hands on this.  Dude, I love you.  Grabbing this and testing now.

EDIT:

Tested on my retro demo and it's PERFECT!  Where do I throw my money?
 
Last edited by a moderator:

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
You should see all the other fun things I have just sitting around waiting for release.
 

djDarkX

Retro & Remastered Music Guru
Veteran
Joined
Jan 17, 2013
Messages
2,699
Reaction score
1,892
First Language
Music
Primarily Uses
RMMV
Stop teasing me like dat meng.  Still, IF you decide to release them, you know the people who greatly appreciate your stuff will be grateful and even if you don't, no worries.  We still love you brah.
 

Dark Lord

Villager
Member
Joined
Jan 11, 2014
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Jeez,thanks for releasing this man....Real Cool and works on my system mighty fine.....Thanks!!!!...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,787
Reaction score
12,217
First Language
English
Primarily Uses
RMMV
This can be used commercially? Awesome! I'll be checking it out over the weekend.

You should see all the other fun things I have just sitting around waiting for release.
So release them already and stop taunting us! So mean :(
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,322
Reaction score
2,458
First Language
French
Primarily Uses
RMVXA
This can be used commercially? Awesome! I'll be checking it out over the weekend.
 I guess not. Line 7 of the script says Non-commercial only...
 

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
This may be used commercially. I'll update the header when I'm back by my laptop. The older version was non-commercial, I just forgot to change that.

EDIT: And fixed if you guys want the updated header.
 
Last edited by a moderator:

djDarkX

Retro & Remastered Music Guru
Veteran
Joined
Jan 17, 2013
Messages
2,699
Reaction score
1,892
First Language
Music
Primarily Uses
RMMV
This got finally got pinned?  Should have been pinned the moment he decided to make the thread. :guffaw:
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
I must say its working perfectly, even with certain Victor scripts that affect movement.  BD

Edit: I am using your script in conjunction with Fenix stair movements (see spoilers below). What happens is that i have to set a region for the stairs to work, and if i try to tag the terrain that has a region on it, the script wont work. Is it easy to make your script recognize terrain with set regions?

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# Stairs Movement v 1.0
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
#
# FenixFyreX
#
# Final Fantasy VI had stairs that the player actually walked up. Their direction
# became two way on these stairs, left or right. This script replicates that
# feature.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#

StairsRegionID = 10 # The region ID to use for designating staircases
StairsOffset = 1 # The height of one tileset staircase plank (about 4px)
CharAnimSpeed = 0.5 # The speed at which a sprite cycles through frames

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# End of Config. Do not edit below.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#

class Game_Map
def stairs?(x,y)
region_id(x,y) == StairsRegionID
end
end

class Game_CharacterBase

# give other coders access to checking stairs status
attr_reader :on_stairs
alias on_stairs? on_stairs

# check whether character is on stairs
def check_stairs
@on_stairs = stairs?(0)
end

# Checks if there are any sets of stairs in the given direction
def stairs?(d)
return case d
when 0
$game_map.stairs?(@x,@y)
when 2
$game_map.stairs?(@x-1,@y+1) || $game_map.stairs?(@x+1,@y+1)
when 4
$game_map.stairs?(@x-1,@y-1) || $game_map.stairs?(@x-1,@y+1)
when 6
$game_map.stairs?(@x+1,@y-1) || $game_map.stairs?(@x+1,@y+1)
when 8
$game_map.stairs?(@x-1,@y-1) || $game_map.stairs?(@x+1,@y-1)
else
false
end
end

# Checks passability in the given direction for stairs
def stairs_passable?(x, y, d)
x2 = $game_map.round_x_with_direction(x, d)
y2 = $game_map.round_y_with_direction(y, d)
return false unless $game_map.valid?(x2, y2)
return true if @through || debug_through?
return false unless map_passable?(x, y, d)
return false if collide_with_characters?(x2, y2)
return true
end

# Moves the character in the given direction diagonally up or down stairs
def move_diag_stairs(d, horz, vert, turn_ok)
x,y = @x+horz,@y+vert
horz = [4,6][[-1,1].index(horz)]
vert = [8,2][[-1,1].index(vert)]
@move_succeed = stairs_passable?(x,y,d)
d = [4,6][[[4,8],[6,8],[4,2],[6,2]].index([horz,vert])%2]
set_direction(d) if turn_ok
if @move_succeed
@x = $game_map.round_x_with_direction(@x, horz)
@y = $game_map.round_y_with_direction(@y, vert)
@real_x = $game_map.x_with_direction(@x, reverse_dir(horz))
@real_y = $game_map.y_with_direction(@y, reverse_dir(vert))
increase_steps
end
end

# Returns the stair vector for the given direction
def stair_vector(d)
x,y = 0,0
case d
when 4,6
x = [-1,1][[4,6].index(d)]
y = $game_map.stairs?(@x+x,@y-1) ? -1 : 1
when 2,8
y = [-1,1][[8,2].index(d)]
x = $game_map.stairs?(@x-1,@y+y) ? -1 : 1
end
[x,y]
end

# Checks whether or not the character is not getting on or off stairs
def midstairs?
@on_stairs && stairs?(reverse_dir(@direction))
end

# Alters original move method to put stairs into effect
alias move_straight_no_stairs move_straight
def move_straight(d, turn_ok = true)
if on_stairs? && stairs?(d)
move_diag_stairs(d, *stair_vector(d), turn_ok)
else
d = @direction if @on_stairs && [2,8].include?(d)
move_straight_no_stairs(d, turn_ok)
end
check_stairs
end

# Shift the y coordinate of the character's sprite to compensate for stairs
alias shift_y_for_stairs shift_y
def shift_y(*a,&bl)
shift_y_for_stairs(*a,&bl) + (midstairs? ? StairsOffset : 0)
end

# Update the sprite more to create pace-per-step effect on stairs
alias update_anime_count_for_stairs update_anime_count
def update_anime_count(*a,&bl)
ac = @anime_count
update_anime_count_for_stairs(*a,&bl)
@anime_count += CharAnimSpeed if midstairs?
end
end

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# End of Script
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
 
Last edited by a moderator:

BeardBro

I think this line's mostly filler.
Veteran
Joined
Mar 20, 2013
Messages
211
Reaction score
84
First Language
English
Primarily Uses
RMMV
EDIT: Disregard my previous post; I confused region tags with terrain tags. I've been working on my project for two days straight (when I'm not at my real job), so my mind is a little weary.

Anyways, fantastic script. It works perfectly when used with Pioneer Valley's resource packs.
 
Last edited by a moderator:

Leonardo Myst

Veteran
Veteran
Joined
Mar 13, 2014
Messages
39
Reaction score
6
First Language
English
Primarily Uses
Forgive me for asking this... but... as I'm pretty much sticking with the High Fantasy packs but still using some resources from the RTP, I'm of course having the usual problem with overlays...

I tried the zLevel script that came with the packs but for some reason it behaved entirely different than I expected. Instead of putting the sprites above the treetops or lamppost tops, it made them go transparent when they were up and to the right of the objects.

So, I just found this thread and tried Neon Black's script... and... nothing seems to be happening. Still getting the same overlays I had before. What's the secret?

Again, please forgive  me as this is my first time using any scripts. I did put the scripts under "Materials" down near the bottom. And I tried the two scripts both separate and together.

Also... It took me so long to mess with scripts because the first script I heard that I should get was Victor's... but when I went to his site to download it, I ended up with malware because a download button popped up that apparently wasn't for his script but I couldn't cancel it.

If someone can confirm that they can download the master script, then I'll go back and try again.
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
14,730
Reaction score
14,577
First Language
Filipino
Primarily Uses
VNM
You need to set a terrain tag on the tilesets. Instructions has it '3')b
 
Last edited by a moderator:

Leonardo Myst

Veteran
Veteran
Joined
Mar 13, 2014
Messages
39
Reaction score
6
First Language
English
Primarily Uses
Ah... you should see me assemble furniture...

I don't normally read the instructions until after I run into a problem...

Which.... I have done, admittedly...

Edit:

Ahhhhh...

Today I learned about terrain tags. :)

Thanks!

Got it working!
 
Last edited by a moderator:

Rinober

Veteran
Veteran
Joined
Mar 28, 2014
Messages
48
Reaction score
28
First Language
German
Primarily Uses
RMMV
Hi :)

I'm using your script together with Pioneer Valley's graphics and it works quite well. Only one thing: Followers are still cut off in front of * fields. Works well with the main hero, but what about the second, third and fourth hero who follow my main character? Is there a solution to this problem?
 
Last edited by a moderator:
Joined
Mar 17, 2012
Messages
904
Reaction score
214
First Language
English
Primarily Uses
i seem to be having a problem when i am using multiples of the same tile. for example rows of seats in a stadium setting.
 

when there's only one row, no problem. works excellently.

when there's multiple rows, though, it doesn't work. the tile the player is standing on is the same as the one directly above him—is that causing the problem?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Yay! One of my Youtube videos got to 100 views (in 2 days)! This Youtube thing is great, it's like the profile posts except I get to annoy entertain more people at once! Now I just have to practice my "Leave a like and hit that Subscribe button" shilling technique. :LZSexcite:
Just found out there is an about me page. I updated it and happy the way its looking!
Ladies and Gentlemen, I can't act like things will be ok anymore. It needs to be said: We have a Pandemic...
Release version of Pillow Hero is out on windows now! --> https://bit.ly/2USHKLv
Stream will be live shortly! Feeling like doing some Minecraft instead of DK64 since it has been a bit! Feel free to drop by!

Forum statistics

Threads
95,555
Messages
930,061
Members
125,841
Latest member
Firewolves
Top