Mirage Source
Display Sprites on Character Create - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Display Sprites on Character Create (/showthread.php?tid=22)

Pages: 1 2 3


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

Well, anyone mind telling me what Class(i).Sprite is now?(I presume it was changed, I'm using DFA's 3.50)


Re: Display Sprites on Character Create - Matt - 13-09-2008

Mattyw Wrote:Well, anyone mind telling me what Class(i).Sprite is now?(I presume it was changed, I'm using DFA's 3.50)

Read the source?


Re: Display Sprites on Character Create - Rian - 13-09-2008

Probably in the ClassRec somewhere. Not entirely sure where it's at in DFAs version though.


Re: Display Sprites on Character Create - Matt - 13-09-2008

He change the system. Quite a bit.


Re: Display Sprites on Character Create - Robin - 13-09-2008

What?


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

Well for some reason I get a "Subscript Out of Range" error when I have "Class(i).Sprite = Val(Parse(n + 8))" not commented out & try to create a new character.

Then when it's commented out & stuff, Sprite won't show on creation of course & both Class Names say 4 for some reason on the Drop Down.

Here's all the code I have for this:

Code:
Sub SendNewCharClasses(ByVal Index As Long)
Dim Packet As String
Dim I As Long

    Packet = "newcharclasses" & SEP_CHAR & Max_Classes
    For I = 1 To Max_Classes
        Packet = Packet & GetClassName(I) & SEP_CHAR & GetClassMaxVital(I, Vitals.HP) & SEP_CHAR & GetClassMaxVital(I, Vitals.MP) & SEP_CHAR & GetClassMaxVital(I, Vitals.SP) & SEP_CHAR & Class(I).Stat(Stats.Strength) & SEP_CHAR & Class(I).Stat(Stats.Defense) & SEP_CHAR & Class(I).Stat(Stats.SPEED) & SEP_CHAR & Class(I).Stat(Stats.Magic) & SEP_CHAR & Class(I).Sprite
    Next I
    Packet = Packet & END_CHAR
    
    Call SendDataTo(Index, Packet)
End Sub
----------------------------------------------------------------------------------
Private Sub Timer_Timer()
    On Error Resume Next
    If optMale.Value = True Then
        'Call BitBlt(picpic.hdc, 0, 0, PIC_X, PIC_Y, picSprites.hdc, 0, Int(Class(cmbClass.ListIndex).Sprite) * PIC_Y, SRCCOPY)
    Else
        'Call BitBlt(picpic.hdc, 0, 0, PIC_X, PIC_Y, picSprites.hdc, 0, Int(Class(cmbClass.ListIndex).Sprite) * PIC_Y, SRCCOPY)
    End If
End Sub
----------------------------------------------------------------------------------
picSprites.Picture = LoadPicture(App.Path & "/gfx/sprites.bmp")
----------------------------------------------------------------------------------
            n = n + 1

            For i = 1 To Max_Classes
                Class(i).Name = Parse(n)
    
                Class(i).Vital(Vitals.HP) = Val(Parse(n + 1))
                Class(i).Vital(Vitals.MP) = Val(Parse(n + 2))
                Class(i).Vital(Vitals.SP) = Val(Parse(n + 3))
    
                Class(i).Stat(Stats.Strength) = Val(Parse(n + 4))
                Class(i).Stat(Stats.Defense) = Val(Parse(n + 5))
                Class(i).Stat(Stats.SPEED) = Val(Parse(n + 6))
                Class(i).Stat(Stats.Magic) = Val(Parse(n + 7))
                'Class(i).Sprite = Val(Parse(n + 8))
                
                n = n + 8
            Next i

I have to block out BitBlt also as you can see, don't know the conversion or so.

All help would be appreciated.


Re: Display Sprites on Character Create - GIAKEN - 13-09-2008

n = n + 8

Needs to be

n = n + 9

ALSO EDIT:

cmbClass.ListIndex

You need to do + 1 when you use that since it starts at 0.


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

I do that when the Sprite part is unblocked.

EDIT: When I unblock the BitBlt part, I can't compile.


Re: Display Sprites on Character Create - GIAKEN - 13-09-2008

I made an edit in case you didn't catch it.


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

Edited my post.


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

DFA Wrote:tell em its the same =(

Well it isn't. =-p

It won't compile.


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

I'll try it then. :S

Code:
Private Sub Timer_Timer()
    On Error Resume Next
    If optMale.Value = True Then
        Call BitBlt(picpic.hdc, 0, 0, PIC_X, PIC_Y, picSprites.hdc, 0, Int(Class(cmbClass.ListIndex + 1).Sprite) * PIC_Y, SRCCOPY)
    Else
        Call BitBlt(picpic.hdc, 0, 0, PIC_X, PIC_Y, picSprites.hdc, 0, Int(Class(cmbClass.ListIndex + 1).Sprite) * PIC_Y, SRCCOPY)
    End If
End Sub
----------------------------------------------------------------------------------
            n = n + 1

            For i = 1 To Max_Classes
                Class(i).Name = Parse(n)
    
                Class(i).Vital(Vitals.HP) = Val(Parse(n + 1))
                Class(i).Vital(Vitals.MP) = Val(Parse(n + 2))
                Class(i).Vital(Vitals.SP) = Val(Parse(n + 3))
    
                Class(i).Stat(Stats.Strength) = Val(Parse(n + 4))
                Class(i).Stat(Stats.Defense) = Val(Parse(n + 5))
                Class(i).Stat(Stats.SPEED) = Val(Parse(n + 6))
                Class(i).Stat(Stats.Magic) = Val(Parse(n + 7))
                Class(i).Sprite = Val(Parse(n + 8))
                
                n = n + 9
            Next i



Re: Display Sprites on Character Create - Mattyw - 13-09-2008

DFA Wrote:you're full of shit =(

I'll remember that. =-p

Quote:Microsoft Visual Basic

Compile error:
Method or data member not found

That's what I get.
EDIT: So ya know. ".hdc" is highlighted with that error.


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

Still no help? :S


Re: Display Sprites on Character Create - Robin - 13-09-2008

GIEV US THAT ACUTLA LINE


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

Robin Wrote:GIEV US THAT ACUTLA LINE

Uh?... :S

BitBlt was removed from MS4. When I add it into modGameLogic.bas, still doesn't work.

Code:
Public Declare Function BitBlt Lib"gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long



Re: Display Sprites on Character Create - Doomy - 13-09-2008

well we dont know how to use that part with it
so we tried to add bitblt still dont work
this is very confusing
worked better on ms 3.03

BltToDC dont work for me because i cant arrange it
Ive read the source like robin told me to do and i tried to put it like this
but i know its wrong cause i dont know how to do it
i tired it like this

Call Engine_BltToDC(DD_SpriteSurf, sRECT, dRECT, frmNpcEditor.picSprite)s


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

[quote="Lea"]Lea please


Re: Display Sprites on Character Create - Doomy - 13-09-2008

thank you
me and matt spent hours trying to make this to work

also can you make it do BltToDC


Re: Display Sprites on Character Create - Mattyw - 13-09-2008

doomteam1 Wrote:thank you
me and matt spent hours trying to make this to work

also can you make it do BltToDC

He is doing that. Since MS4 has that, it doesn't have the other(which is worse).

I spent almost 12 hours trying to get it to work. XD

doom spent maybe 8 hours. =-p(MAYBE)

Again, thanks. I would've learnt more if I wasn't doing 1 thing for 12 hours.


Re: Display Sprites on Character Create - Doomy - 14-09-2008

yay OMG thank you it worked

and thanks for making me do work on server part


Re: Display Sprites on Character Create - Mattyw - 14-09-2008

Epicness. =-p ;D Thanks.


Re: Display Sprites on Character Create - Dane - 21-10-2008

Is there another tutorial for this on MS4?


Re: Display Sprites on Character Create - Mattyw - 21-10-2008

Night Wrote:Is there another tutorial for this on MS4?

Have you heard of the MS4 Tutorial forum... Obviously.


Re: Display Sprites on Character Create - Dane - 25-10-2008

there isnt a bltbit -.-