Layering showPicture,animations,and player sprites

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
622
Reaction score
403
First Language
English
Primarily Uses
RMVXA
I would like to create a scene with with a picture above an event which is playing an animation which so far works.. but the player seems to be in the same layer as the event. Id like to have the player be above the picture but the animation event below both.. so

bottom:
--event playing animation.

--showPicture displaying a wall

--player sprite on the other side of the wall
top:


my first thought is to hide the player and put a picture of the player with showPicture with which i could assign a z value.. and then reassign pictures for a walking animation or whatever animations i needed.. but this seems redundant and a lot of work to reanimate something that was already animated

the other problem with this is I may need to place animations above the showPicture later rather than below it so I'd like a solution to both before hand.


would it be possible to run a script call to assign a z value? if so how would i do so? this.z = +1?

sorry If this isn't posted in the right place this forums organization has always confused me.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,516
Reaction score
14,244
First Language
English
Primarily Uses
RMVXA
Close, this is where you post scripts you made and wish to release.

I've moved this thread to Learning Ruby. Please be sure to post your threads in the correct forum next time. Thank you.

 

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
622
Reaction score
403
First Language
English
Primarily Uses
RMVXA
thanks for moving the thread to the right place, though it seems nobody is capable of answering the question.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
278
Reaction score
103
First Language
English
Primarily Uses
RMXP
Not so much incapable, but moreso there really isn't a clear-cut solution scripting-wise. Using the default way things are drawn, you're asking for something that's impossible. The event and player graphics are drawn on a different viewport than the pictures are (@viewport1 and @viewport2 respectively, as seen in Spriteset_Map). @viewport1 has a lower z-value than @viewport2, so all sprites on @viewport1 will ALWAYS be under @viewport2.

On that note, animations (by default) are placed at a z-value 300 higher than the character sprite as seen in Sprite_Base:
Code:
sprite.z = self.z + 300 + i
These too are bound to @viewport1
Code:
  def make_animation_sprites
    @ani_sprites = []
    if @use_sprite && !@@ani_spr_checker.include?(@animation)
      16.times do
        sprite = ::Sprite.new(viewport) #<==== this here
You'll need some script that completely rewrites the way Spriteset_Map (and animations in Sprite_Base) draws everything. I'm not versed in the VXA culture, so I can't point you to anything.
 

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
622
Reaction score
403
First Language
English
Primarily Uses
RMVXA
thanks for the insight KK20, I don't believe my end goal is impossible but maybe how I'm describing it makes it seem more difficult.

which viewport are animations shown in? is it possible to assign a z value to an animation?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,002
First Language
Tagalog
Primarily Uses
RMVXA
If you set the event to "Below Characters" priority, this should put the event itself below the player's layer.

You could indeed modify the .z of the default sprite objects, but Im not sure right now if doing it directly will work correctly for them due to the different viewports. Anyway, you can try to set their .z value to a high value and see if they show above everything else. To do it you'd need to do

spriteobject.z = value

So you need first to know the "name" of the sprite object that you want to modify.

I actually have a script that allows you to transfer events and player into a higher Z so that they wont even be affected by screen tints, so its definitely doable but I cant check it right now or anytime soon.

PS: which RM are you using? This thread is on RGSSx but your commands (showPicture, this.z) are reminiscent of MV's JavaScript.
 
Last edited:

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
622
Reaction score
403
First Language
English
Primarily Uses
RMVXA
If you set the event to "Below Characters" priority, this should put the event itself below the player's layer.

You could indeed modify the .z of the default sprite objects, but Im not sure right now if doing it directly will work correctly for them due to the different viewports. Anyway, you can try to set their .z value to a high value and see if they show above everything else. To do it you'd need to do

spriteobject.z = value

So you need first to know the "name" of the sprite object that you want to modify.

I actually have a script that allows you to transfer events and player into a higher Z so that they wont even be affected by screen tints, so its definitely doable but I cant check it right now or anytime soon.

PS: which RM are you using? This thread is on RGSSx but your commands (showPicture, this.z) are reminiscent of MV's JavaScript.
Ace, but i started by researching myself i might of unknowingly read some javascript without realizing.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I made some sideview closets for MV!
You can find them in my MV resource thread.
People1.png & SF_People1.png added!!!!

Adventurer:
"Why your body looks like a bird?"

Stranger:
"Because I'm harpy"

Adventurer:
"Clap along if you feel like a room without a roof"

*Both dancing to Pharrell Williams song*
Stream will be live shortly with a make-up session of the Interactive Text Adventure! Feel free to drop by!

Forum statistics

Threads
105,507
Messages
1,014,275
Members
137,177
Latest member
tranphong
Top