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

Get paperdoll in Rasbek source


SolidLink
 Share

Recommended Posts

I found an engine called Resbak source and was playing around with it but then I saw that it the engine doesn't have paperdolls instead have auras and I want to get the paperdolls back. Can anyone help me with this? I've been trying to find a way to allow paperdoll but I couldn't find a solution.

* * *

Really like the engine and would be cool if anyone can help me fix this. I'm not great at vb6\. Bump!
Link to comment
Share on other sites

@'alextoti99':

> what do u mean with auras?

In the engine they disabled the use of paperdoll with the equipments and turned the helmet as an aura and you can only use auras as the paperdoll but not other equipments.But I want to use the paperdoll for other equipments. I looked at the source and there were the paperdoll codes etc but I don't know how to make it so you can choose paperdolls for weapons, armors etc. So if anyone can please help me out with this then it would be really nice.
Link to comment
Share on other sites

![html photo html.jpg](http://i.imgur.com/QQvX8dN.jpg)

Disabled the use of paperdolls and uses Aura for the helmet. I think the paperdoll code is still in there but I can't find a way to make other equipments like armor,weapons etc to use paperdoll since it is disabled in the item
editor.
Link to comment
Share on other sites

Thanks Mohenjo Daro for fixing the issue! :)

Also if possible:
How to show equipment paperdoll without wearing an aura and RMXP instead of VX ACE

Thanks again :)

* * *

I have fixed the issue where you have to wear an aura for the item to show but the shield is now an aura which I don't mind now tbh.
The only thing I have to make is to make it compatible with RMXP sprite.
Link to comment
Share on other sites

Are you asking how to preview the paperdoll in the editor? You just have to increase the size of the picbox, then find where in the code the image is given and add some for the weapon, armor, helmet, and shield (just make sure to use the tex_paperdoll and set the scrlbar max to NumPaperdoll)
Link to comment
Share on other sites

@'Mohenjo:

> Are you asking how to preview the paperdoll in the editor? You just have to increase the size of the picbox, then find where in the code the image is given and add some for the weapon, armor, helmet, and shield (just make sure to use the tex_paperdoll and set the scrlbar max to NumPaperdoll)

Oh ok I'll do that and also i meant like the paperdoll being compatible with RMXP sprites.
Link to comment
Share on other sites

Go to the DrawPaperdoll sub and you should see a "/ 6", change it to "/ 8" (it is actually "/ 3 / 2" but that = "/ 6" to find the middle of the texture). This will give you 4 rows instead of 3, but only 3 of those rows will ever be used. This will only make the paperdolls compatible, but not used.

Once you finish that, find the Call DrawPaperdoll and see where it has Anim in that line and change it to (Anim + 1). This way that DrawPaperdoll sub draws the correct column of the paperdoll
Link to comment
Share on other sites

@'Mohenjo:

> Go to the DrawPaperdoll sub and you should see a "/ 6", change it to "/ 8" (it is actually "/ 3 / 2" but that = "/ 6" to find the middle of the texture). This will give you 4 rows instead of 3, but only 3 of those rows will ever be used. This will only make the paperdolls compatible, but not used.
>
> Once you finish that, find the Call DrawPaperdoll and see where it has Anim in that line and change it to (Anim + 1). This way that DrawPaperdoll sub draws the correct column of the paperdoll

Aaand done! That works now and also I get this weird bug: 

![](http://i.imgur.com/GYZFnAi.jpg)

It dosen't show any paperdolls past 7 and 7 is a wing for some reason? lol
Link to comment
Share on other sites

Find Public Sub EditorItem_DrawPaperdoll() and replace that sub with

>! ```
Public Sub EditorItem_DrawPaperdoll()
Dim Sprite As Long, srcRect As D3DRECT, destRect As D3DRECT
Dim sRECT As RECT
Dim dRect As RECT

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
>! 'frmEditor_Item.picPaperdoll.Cls
If frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_AURA Then
Sprite = frmEditor_Item.scrlPaperdoll.Value

If Sprite < 1 Or Sprite > NumAuras Then
frmEditor_Item.picPaperdoll.Cls
Exit Sub
End If

' rect for source
sRECT.Top = 0
sRECT.Bottom = Tex_Aura(Sprite).height
sRECT.Left = 0
sRECT.Right = Tex_Aura(Sprite).width
' same for destination as source
dRect = sRECT

Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(0, 0, 0, 0), 1#, 0
Direct3D_Device.BeginScene
RenderTextureByRects Tex_Aura(Sprite), sRECT, dRect, D3DColorARGB(255 - frmEditor_Item.scrlA, 255 - frmEditor_Item.ScrlR, 255 - frmEditor_Item.ScrlG, 255 - frmEditor_Item.ScrlB)

With destRect
.x1 = 0
.x2 = Tex_Aura(Sprite).width
.y1 = 0
.y2 = Tex_Aura(Sprite).height
End With
Else
Sprite = frmEditor_Item.scrlPaperdoll.Value

If Sprite < 1 Or Sprite > NumPaperdolls Then
frmEditor_Item.picPaperdoll.Cls
Exit Sub
End If

' rect for source
sRECT.Top = 0
sRECT.Bottom = Tex_Paperdoll(Sprite).height
sRECT.Left = 0
sRECT.Right = Tex_Paperdoll(Sprite).width
' same for destination as source
dRect = sRECT

Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(0, 0, 0, 0), 1#, 0
Direct3D_Device.BeginScene
RenderTextureByRects Tex_Paperdoll(Sprite), sRECT, dRect, D3DColorARGB(255 - frmEditor_Item.scrlA, 255 - frmEditor_Item.ScrlR, 255 - frmEditor_Item.ScrlG, 255 - frmEditor_Item.ScrlB)

With destRect
.x1 = 0
.x2 = Tex_Paperdoll(Sprite).width
.y1 = 0
.y2 = Tex_Paperdoll(Sprite).height
End With
End If

Direct3D_Device.EndScene
Direct3D_Device.Present destRect, destRect, frmEditor_Item.picPaperdoll.hWnd, ByVal (0)

' Error handler
Exit Sub
ErrorHandler:
HandleError "EditorItem_DrawPaperdoll", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
>! ```

For good measure, replace Private Sub scrlPaperdoll_Change() with

>! ```
Private Sub scrlPaperdoll_Change()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler

If cmbType.ListIndex = ITEM_TYPE_AURA Then
scrlPaperdoll.max = NumAuras
Else
scrlPaperdoll.max = NumPaperdolls
End If

If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
lblPaperdoll.Caption = "Aura: " & scrlPaperdoll.Value
Item(EditorIndex).Paperdoll = scrlPaperdoll.Value

' Error handler
Exit Sub
ErrorHandler:
HandleError "scrlPaperdoll_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
```
Link to comment
Share on other sites

Change the DrawPlayer Sub to
>! ```
Public Sub DrawPlayer(ByVal Index As Long)
Dim Anim As Byte, I As Long, X As Long, y As Long
Dim Sprite As Long, spritetop As Long
Dim Rec As RECT, Rec_Pos As RECT
Dim attackspeed As Long, slashon As Boolean

' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
>! Sprite = GetPlayerSprite(Index)
>! If Sprite < 1 Or Sprite > NumCharacters Then Exit Sub
>! ' speed from weapon
If GetPlayerEquipment(Index, Weapon) > 0 Then
attackspeed = Item(GetPlayerEquipment(Index, Weapon)).speed
Else
attackspeed = 1000
End If

If Not isAnimated(GetPlayerSprite(Index)) Then
' Reset frame
Anim = 0

' Check for attacking animation
If TempPlayer(Index).AttackTimer + (attackspeed / 2) > GetTickCount Then
If TempPlayer(Index).Attacking = 1 Then
slashon = True
Anim = 1
End If
Else
' If not attacking, walk normally
Select Case GetPlayerDir(Index)
Case DIR_UP
If (TempPlayer(Index).yOffset > 8) Then Anim = TempPlayer(Index).Step + 1
Case DIR_DOWN
If (TempPlayer(Index).yOffset < -8) Then Anim = TempPlayer(Index).Step + 1
Case DIR_LEFT
If (TempPlayer(Index).xOffset > 8) Then Anim = TempPlayer(Index).Step + 1
Case DIR_RIGHT
If (TempPlayer(Index).xOffset < -8) Then Anim = TempPlayer(Index).Step + 1
End Select
End If
Else
If TempPlayer(Index).AttackTimer + (attackspeed / 2) > GetTickCount Then
If TempPlayer(Index).Attacking = 1 Then
slashon = True
End If
End If

If TempPlayer(Index).AnimTimer + 100 <= GetTickCount Then
TempPlayer(Index).Anim = TempPlayer(Index).Anim + 1
If TempPlayer(Index).Anim >= 3 Then TempPlayer(Index).Anim = 0
TempPlayer(Index).AnimTimer = GetTickCount
End If
Anim = TempPlayer(Index).Anim
End If
>! ' Check to see if we want to stop making him attack
With TempPlayer(Index)
If .AttackTimer + attackspeed < GetTickCount Then
.Attacking = 0
.AttackTimer = 0
End If
End With
>! ' Set the left
Select Case GetPlayerDir(Index)
Case DIR_UP
spritetop = 3
Case DIR_RIGHT
spritetop = 2
Case DIR_DOWN
spritetop = 0
Case DIR_LEFT
spritetop = 1
End Select
>! With Rec
.Top = spritetop * (Tex_Character(Sprite).height / 4)
.Bottom = .Top + (Tex_Character(Sprite).height / 4)
.Left = Anim * (Tex_Character(Sprite).width / 4)
.Right = .Left + (Tex_Character(Sprite).width / 4)
End With
>! ' Calculate the X
X = GetPlayerX(Index) * PIC_X + TempPlayer(Index).xOffset - ((Tex_Character(Sprite).width / 3 - 32) / 2)
>! ' Is the player's height more than 32..?
If (Tex_Character(Sprite).height) > 32 Then
' Create a 32 pixel offset for larger sprites
y = GetPlayerY(Index) * PIC_Y + TempPlayer(Index).yOffset - ((Tex_Character(Sprite).height / 4) - 32)
Else
' Proceed as normal
y = GetPlayerY(Index) * PIC_Y + TempPlayer(Index).yOffset
End If

' render player shadow
Call DrawShadow(Sprite, X, y + 5)

' render the actual sprite
If GetTickCount > TempPlayer(Index).StartFlash Then
Call DrawSprite(Sprite, X, y, Rec)
TempPlayer(Index).StartFlash = 0
Else
Call DrawSprite(Sprite, X, y, Rec, , , , , True)
End If

If Item(GetPlayerEquipment(Index, Shield)).Type = ITEM_TYPE_AURA Then Call DrawPlayerAccessories(Index, Shield, X, y, Sprite, Rec, Anim, spritetop)
Call DrawPlayerAccessories(Index, Armor, X, y, Sprite, Rec, Anim, spritetop)
Call DrawPlayerAccessories(Index, Helmet, X, y, Sprite, Rec, Anim, spritetop)
If Item(GetPlayerEquipment(Index, Shield)).Type = ITEM_TYPE_Shield Then Call DrawPlayerAccessories(Index, Shield, X, y, Sprite, Rec, Anim, spritetop)
Call DrawPlayerAccessories(Index, Weapon, X, y, Sprite, Rec, Anim, spritetop)
>! If slashon Then Call DrawSlash(X, y, Index)

' Error handler
Exit Sub
ErrorHandler:
HandleError "DrawPlayer", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
```

You're basically just changing the 3 values to 4s (starting at 0 and going to 2 is a 3 value) So where you put the Anim + 1 earlier, you want to change to just Anim
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...