Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making Sprites 32/64
#1
Originally posted by Misunderstood

This has been updated to work with the new MSE

Ok Find the for next loop which calls bltPlayer
Code:
' Blit out players
        For i = 1 To MAX_PLAYERS
              If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                  Call BltPlayer(i)
              End If
        Next i

Now copy it, we need to make another sub to blt the top of the player, this way it will be above other players bottoms.
We need to make a new loop instead of adding just another sub in the first one, because otherwise if there was a player ontop of your player, which was bltted after you in the loop, it will show ontop of your head, and thats not cool.

So make it look like this:

Code:
' Blit out players top
        For i = 1 To MAX_PLAYERS
              If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                  Call BltPlayerTop(i)
              End If
        Next i

(it goes right after the other loop if you hadnt figured that out)

Now we need to make the sub.

Copy the bltPlayer Sub
Paste the bltPlayer Sub right below there
Rename it bltPlayerTop

Find this if statement in the BltPlayerTop Sub, its something like:

Code:
If y < 0 then
    y = 0
    With Rec
        .top = .top + (Y * -1)
    End With
end if

Change it to this:

Code:
y = y - 32
    If y < 0 And y > -32 Then
        With Rec
              .top = .top - y
              y = 0
        End With    
    End If

This blts it 1 tile higher then normal.

Now go to the BltPlayer sub
Find:

Code:
.top = GetPlayerSprite(Index) * PIC_Y


Make it:
Code:
.Top = GetPlayerSprite(Index) * PIC_Y + PIC_Y


This takes one block down from the top of the sprite

Oh yea, in both of the subs, add a * 2 after the getplayersprite(index) in the rec.top line, this make it so each block of 2 is thought of as 1 sprite.

you dont really NEED it though.

Oh, and for the names...
Go to the BltPlayerName sub and find the texty = whatever and change it to:
Code:
TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset + 28 '(or-4 + pic_y)


Or if you want the name to show up above the player(the one there ^ makes it below) make it this:

Code:
TextY = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - 50 '(or-4 -  pic_y - pic_y/2)

Now you will probably have to change other things, like for the npcs if you want them like that too. Or whatever.
If I missed something in here let me know.
Reply
#2
Ok what about if I want some npcs 32*32 and some 96*96 npcs?
Reply
#3
This cover players only.
Reply
#4
The hope is that you can see how it is done for players and are able to modify it to work in other scenarios....such as with npcs.
Reply
#5
I mean is it possible have to different sizes for npcs?
Reply
#6
Of course it is. Practically anything is possible!
Reply
#7
Yes, its not very hard, I think its even in elysium.
Reply
#8
Completely possible, but would require adding a couple more variables to the NPCs and adding some options to the npc editor
Reply
#9
woah, sonire, it's not impossible... it just means a menu selection of 64 and so on sizes, and having diff sprite sheets for diff sizes....
Reply
#10
Sonire Wrote:Completely possible, but would require adding a couple more variables to the NPCs and adding some options to the npc editor

He didn't say impossible. Please, read through it, don't just skim the posts.
Reply
#11
Advocate Wrote:
Sonire Wrote:Completely possible, but would require adding a couple more variables to the NPCs and adding some options to the npc editor

He didn't say impossible. Please, read through it, don't just skim the posts.

hey, leave me alone... i'm tipsy!!! i misread it Tongue
Reply
#12
Tosuxo Wrote:woah, sonire, it's not impossible... it just means a menu selection of 64 and so on sizes, and having diff sprite sheets for diff sizes....

LoL. If you can do it, I think Sonire can xD
Reply
#13
Kite Wrote:
Tosuxo Wrote:woah, sonire, it's not impossible... it just means a menu selection of 64 and so on sizes, and having diff sprite sheets for diff sizes....

LoL. If you can do it, I think Sonire can xD

i'm tempted to try and finish my player housing tutorial whilst drunk.... *giggles* Tongue
Reply
#14
Adding the name above the player doesn't work. The name stays on the top tile even when the player is on a lower tile.

Nevermind, I just made a stupid mistake >.
Reply
#15
When i add this, only the top part of my sprites show and the bottom does not. Anyone know why this is like this?
Reply
#16
Are you using the right sized sprites? Are you using MSE? two possible errors there Smile
Reply
#17
If you're using sprite number 0, try changing it to 1.
Reply
#18
Ok i got that part working but now only the even number of sprites work. Like, 0 will show it all, but sprite 1 will show the bottom of sprite 0 and the top of sprite 2. Anyone know how to fix this?
Reply
#19
That's just the way the tut works. It's not like only 50% of your 32x64 NPCs work. They all work, you've just gotta odd numbers only.
Reply
#20
o ok thanks. Thats all i needed.
Reply
#21
Ok anyone know how to make the sprite check by 64 instead of 32 on the sprite sheet? Not like it does in the script, where it goes sprit 0, sprite 4, ect. but where u can actually go spite 0, srite 1, sprite 2, ect.

Dos anyone know how to make it do this or can tell me what to change to do it?
Reply
#22
is this server side or client side? (i came from elysium so i am not as technicly minded as all of you)
Reply
#23
client side, since the client deals with all of the user interface aspects(although some UI tweaks also need to modify things serverside).

This tut is all clientside though
Reply
#24
kakashi Wrote:is this server side or client side? (i came from elysium so i am not as technicly minded as all of you)
Client-side; if it has to do with purely graphics and nothing else it's usually client side Smile
Reply
#25
ok now i can implement it and try to find a paperdoll tutorial for it
*first some thing to eat then i will implement it i'm thinking pizza LOL*
EDIT: what i can't spell so sue me (need a time to sue me try half past never)
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)