Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

64x64 player sprite-change?


Pasketi
 Share

Recommended Posts

Okay, scenario is this:
I want to use bigger sprites in my game just by calling in example:
```
Call SetPlayerBigSprite(Index, 12)
```So it fetches that sprite from the BigSprites-sheet. It must be like you can still transform back to 32x64 sprite for original sprite.

Advanced:
```
Sub SomethingScriptedC**p
If CanTake(Index, 3, 1) = true then
Call PutVar(Index c**p, C**p, more c**p)
Call SetPlayerBigSprite(Index, 15)
Else
Call PutVar(Ind... oh what the heck....)
Call SetPlayerSprite(Index, 80)
End If
End Sub
```
This should be possible by scripting Sadscript, so i have to still edit source for this, am i right?

PutVar saves the original Sprite…. I have the script, its friggin long i don't want to post it here.

I was told to ask here, so i'm waiting for instructions, HOW can i do this.
I really need this.
Thanks
-P
Link to comment
Share on other sites

Eurgh, I really hate how Eclipse handles rendering. Unless you're willing to edit the rendering system to be more compatable with different sizes, you're going to have to store whether a player is set to "BigSprite" or not, then edit the BltPlayer subroutine to handle this.

Similar to how the NPC rendering is handled.
Link to comment
Share on other sites

You know what?

I didn't understand what you just said…A tutorial... please?

I understood that Eclipse can't do it, and i have to go to somewhere and edit something, but where can i find "Somewhere" and what is "Something" and how should i edit "Something". Is "Something" BitPlayer or rendering system.... Or both....Oww... My head hurts again.. :lipsrsealed:
Link to comment
Share on other sites

@Zultar:

> thats very hard to do dude. i doubt barley anyone knows how to do this

It's stupidly easy.

There's really nothing I can do for him, however, as he's asking for me to make the feature for him, rather then help him create it himself.
Link to comment
Share on other sites

Forums error'd last time i tried to post….
*Something about nosebleed*
So all i have to do is to go to PlayerRec and make a Sub SetPlayerBigSprite(Index, bigsprite) and then copy everything from Sub SetPlayerSprite(Index, ???) and then modify it for 64x64 sprites from bigsprites sheet.... and that can be found from what sub? or where?

Found PlayerRec:
```
Type PlayerRec
    ' General
    Name As String * NAME_LENGTH
    Guild As String
    Guildaccess As Byte
    Class As Long
    Sprite As Long
'Is next right and what next?
    BigSprite As Byte
'???----------------
    Level As Long
    Exp As Long
    Access As Byte
    PK As Byte
    input As Byte
    iso As Byte
    Party As PartyRec

    ' Vitals
    HP As Long
    MP As Long
    SP As Long

    ' Stats
    STR As Long
    DEF As Long
    speed As Long
    MAGI As Long
    POINTS As Long

    ' Worn equipment
    ArmorSlot As Long
    WeaponSlot As Long
    HelmetSlot As Long
    ShieldSlot As Long
    LegsSlot As Long
    RingSlot As Long
    NecklaceSlot As Long

    ' Inventory
    Inv(1 To MAX_INV) As PlayerInvRec
    Spell(1 To MAX_PLAYER_SPELLS) As Long
    Bank(1 To MAX_BANK) As BankRec

    ' Position
    Map As Long
    X As Byte
    y As Byte
    Dir As Byte

    ' Client use only
    MaxHp As Long
    MaxMP As Long
    MaxSP As Long
    xOffset As Integer
    yOffset As Integer
    MovingH As Integer
    MovingV As Integer
    Moving As Byte
    Attacking As Byte
    AttackTimer As Long
    MapGetTimer As Long
    CastedSpell As Byte

    SpellNum As Long
    SpellAnim() As SpellAnimRec

    EmoticonNum As Long
    EmoticonTime As Long
    EmoticonVar As Long

    LevelUp As Long
    LevelUpT As Long

    Arrow(1 To MAX_PLAYER_ARROWS) As PlayerArrowRec

    SkilLvl() As Long
    SkilExp() As Long

    Armor As Long
    Helmet As Long
    Shield As Long
    Weapon As Long
    legs As Long
    Ring As Long
    Necklace As Long
    color As Long
    pet As Long

    head As Long
    body As Long
    leg As Long

    HookShotX As Long
    HookShotY As Long
    HookShotSucces As Long
    HookShotAnim As Long
    HookShotTime As Long
    HookShotToX As Long
    HookShotToY As Long
    HookShotDir As Long

    paperdoll As Byte
End Type

```
Found something new again:
```
    ' ::::::::::::::::::::::::
    ' :: Player data packet ::
    ' ::::::::::::::::::::::::
    If casestring = "playerdata" Then
        Dim a As Long
        i = Val(parse(1))
        Call SetPlayerName(i, parse(2))
        Call SetPlayerSprite(i, Val(parse(3)))
        Call SetPlayerMap(i, Val(parse(4)))
        Call SetPlayerX(i, Val(parse(5)))
        Call SetPlayerY(i, Val(parse(6)))
        Call SetPlayerDir(i, Val(parse(7)))
        Call SetPlayerAccess(i, Val(parse(8)))
        Call SetPlayerPK(i, Val(parse(9)))
        Call SetPlayerGuild(i, parse(10))
        Call SetPlayerGuildAccess(i, Val(parse(11)))
        Call SetPlayerClass(i, Val(parse(12)))
        Call SetPlayerHead(i, Val(parse(13)))
        Call SetPlayerBody(i, Val(parse(14)))
        Call SetPlayerLeg(i, Val(parse(15)))
        Call SetPlayerPaperdoll(i, Val(parse(16)))
        Call SetPlayerLevel(i, Val(parse(17)))

        ' Make sure they aren't walking
        Player(i).Moving = 0
        Player(i).xOffset = 0
        Player(i).yOffset = 0

        ' Check if the player is the client player, and if so reset directions
        If i = MyIndex Then
            DirUp = False
            DirDown = False
            DirLeft = False
            DirRight = False
        End If

        Exit Sub

    End If

    ' if a player leaves the map
    If casestring = "leave" Then
        Call SetPlayerMap(CLng(parse(1)), 0)
        Exit Sub
    End If

    ' if a player left the game
    If casestring = "left" Then
        Call ClearPlayer(parse(1))
        Exit Sub
    End If

```
In Eclipse modDatabase:

```
Sub SetPlayerSprite(ByVal Index As Long, ByVal Sprite As Long)
    Player(Index).Sprite = Sprite
End Sub
```
Should i do:

```
Sub SetPlayerBigSprite(ByVal Index As Long, ByVal Sprite As Long)
    Player(Index).BigSprite = Sprite
End Sub
```
Another:

From frmNpcEditor
```
Private Sub BigNpc_Click()
    frmNpcEditor.ScaleMode = 3

    If BigNpc.Value = Checked Then
        picSprite.Width = 960
        picSprite.Height = 960
        picSprite.Top = 1900
        picSprite.Left = 3360
'This is interesting...
        picSprites.Picture = LoadPicture(App.Path & "\GFX\BigSprites.bmp")
    Else
        picSprite.Width = 480
        picSprite.Left = 3600
'Interesting stops...
        If Opt64.Value Then
            picSprite.Height = 960
            picSprite.Top = 1900
        Else
            picSprite.Height = 480
            picSprite.Top = 2160
        End If
'Or Maybe not...
        picSprites.Picture = LoadPicture(App.Path & "\GFX\Sprites.bmp")
    End If
End Sub

```
Even more….

```
Sub SendSetPlayerSprite(ByVal Name As String, ByVal SpriteNum As Byte)
    Call SendData("setplayersprite" & SEP_CHAR & Name & SEP_CHAR & SpriteNum & END_CHAR)
End Sub

```
I think i found the thing:

```
                    ' Blit out the sprite change attribute
                    If Right$(Trim$(Map(GetPlayerMap(MyIndex)).Name), 1) = "*" Then
                        For y = ScreenY To ScreenY2
                            For X = ScreenX To ScreenX2
                                Call BltSpriteChange(X, y)
                            Next X
                        Next y
                    End If

```
**So this needs to work the same way as SetPlayerSprite, but the sprite has to be 64x64.**
Link to comment
Share on other sites

Hmm, don't know, sometimes he stays on all the time, and sometimes he doesn't log for days. When he logs, I will tell him, but still, don't place all your expectations on him, he may take some time or don't want to fix either. So I recommend, to try to find out how to code it alone or wait til someone with enough knowledge and wants to help you. If no one helps you in a month or something, I will help you (not enough time right now).

Comments,
From: Zananok
Link to comment
Share on other sites

you have the basics down,
now look at the bltplayerbody and bltplayertop (client)

what needs to be altered

(well the file ofcourse)
last and of the call bltblit(blabla

(the rec - basicly a square taken from the bigsprites file, it is now 32*64 so it needs to be bigger)
rec.left = blabla
rec.right = blabla + (pic_y * 2)

ok so that's basicly it, but you need to alter the canplayermove and the cannpcmove subs (for blocking)
Link to comment
Share on other sites

@unnown:

> you have the basics down,
> now look at the bltplayerbody and bltplayertop (client)
>
> what needs to be altered
>
> (well the file ofcourse)
> last and of the call bltblit(blabla
>
> (the rec - basicly a square taken from the bigsprites file, it is now 32*64 so it needs to be bigger)
> rec.left = blabla
> rec.right = blabla + (pic_y * 2)
>
> ok so that's basicly it, but you need to alter the canplayermove and the cannpcmove subs (for blocking)

BitBlt? I'm not sure about you, but I'm not huge on loading a file twice to render it.

Have you tried BltToDC?
Link to comment
Share on other sites

rec.Left = (GetPlayerDir(Index) * 3 + Anim) * 64
rec.Right = rec.Left + 64
rec.Top = GetPlayerSprite(MyIndex) * 64 + PIC_Y
rec.Bottom = rec.Top + 64
Call DD_BackBuffer.BltFast(X, y, DD_ItemSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

bltfast i was talking at the top of my head with some drinks down :P

anyhow pasketi,
this is basicly what i mean
Link to comment
Share on other sites

1\. where to put this
2\. It doesn't change the player sprite permanently, does it?
3\. What i have to script to call this.

If we check my post, where i found some helpful codes, it says:

So this needs to work the same way as SetPlayerSprite, but the sprite has to be 64x64.

With this i mean in scripting there should be a command SetPlayerBigSprite(Index, spritenr)

Does this work that way?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...