Mirage Source http://miragesource.net/forums/ |
|
Display Sprites on Character Create http://miragesource.net/forums/viewtopic.php?f=210&t=32 |
Page 2 of 4 |
Author: | Anthony [ Sat Sep 06, 2008 3:17 pm ] |
Post subject: | Re: Display Sprites on Character Create |
You still used a picture box and a timer though. I want to do it without either . |
Author: | Matt [ Sat Sep 06, 2008 4:13 pm ] |
Post subject: | Re: Display Sprites on Character Create |
There's really no need for a loop on that part of the game as it's rarely used and only used for the person creating a character. |
Author: | Mattyw [ Sat Sep 13, 2008 3:01 pm ] |
Post subject: | Re: Display Sprites on Character Create |
Well, anyone mind telling me what Class(i).Sprite is now?(I presume it was changed, I'm using DFA's 3.50) |
Author: | Matt [ Sat Sep 13, 2008 3:15 pm ] |
Post subject: | Re: Display Sprites on Character Create |
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? |
Author: | Lea [ Sat Sep 13, 2008 5:07 pm ] |
Post subject: | Re: Display Sprites on Character Create |
In VB6 you can right click on something and click "Definition" and it will pop you right there most of the time. Class(i).sprite is defined in modTypes in the user defined type called ClassRec |
Author: | Rian [ Sat Sep 13, 2008 5:16 pm ] |
Post subject: | Re: Display Sprites on Character Create |
Probably in the ClassRec somewhere. Not entirely sure where it's at in DFAs version though. |
Author: | Matt [ Sat Sep 13, 2008 5:17 pm ] |
Post subject: | Re: Display Sprites on Character Create |
He change the system. Quite a bit. |
Author: | Robin [ Sat Sep 13, 2008 5:45 pm ] |
Post subject: | Re: Display Sprites on Character Create |
What? |
Author: | Mattyw [ Sat Sep 13, 2008 6:07 pm ] |
Post subject: | Re: Display Sprites on Character Create |
Well for some reason I get a "Subscript Out of Range" error when I have "Class(i).Sprite = Val(Parse(n + )" 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. |
Author: | GIAKEN [ Sat Sep 13, 2008 6:12 pm ] |
Post subject: | Re: Display Sprites on Character Create |
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. |
Author: | Mattyw [ Sat Sep 13, 2008 6:15 pm ] |
Post subject: | Re: Display Sprites on Character Create |
I do that when the Sprite part is unblocked. EDIT: When I unblock the BitBlt part, I can't compile. |
Author: | GIAKEN [ Sat Sep 13, 2008 6:15 pm ] |
Post subject: | Re: Display Sprites on Character Create |
I made an edit in case you didn't catch it. |
Author: | Mattyw [ Sat Sep 13, 2008 6:16 pm ] |
Post subject: | Re: Display Sprites on Character Create |
Edited my post. |
Author: | Mattyw [ Sat Sep 13, 2008 6:22 pm ] |
Post subject: | Re: Display Sprites on Character Create |
DFA wrote: tell em its the same =( Well it isn't. =-p It won't compile. |
Author: | Mattyw [ Sat Sep 13, 2008 6:27 pm ] |
Post subject: | Re: Display Sprites on Character Create |
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 |
Author: | Mattyw [ Sat Sep 13, 2008 6:29 pm ] |
Post subject: | Re: Display Sprites on Character Create |
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. |
Author: | Lea [ Sat Sep 13, 2008 6:32 pm ] |
Post subject: | Re: Display Sprites on Character Create |
what does it highlight? |
Author: | Mattyw [ Sat Sep 13, 2008 8:45 pm ] |
Post subject: | Re: Display Sprites on Character Create |
Still no help? :S |
Author: | Robin [ Sat Sep 13, 2008 9:38 pm ] |
Post subject: | Re: Display Sprites on Character Create |
GIEV US THAT ACUTLA LINE |
Author: | Mattyw [ Sat Sep 13, 2008 9:42 pm ] |
Post subject: | Re: Display Sprites on Character Create |
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
|
Author: | Doomy [ Sat Sep 13, 2008 9:52 pm ] |
Post subject: | Re: Display Sprites on Character Create |
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 |
Author: | Lea [ Sat Sep 13, 2008 10:40 pm ] |
Post subject: | Re: Display Sprites on Character Create |
Lea please <3 I'm going to rewrite this tutorial for MSE(latest) So check back in a while for an update. Just undo anything you've done regarding this for now. |
Author: | Mattyw [ Sat Sep 13, 2008 10:46 pm ] |
Post subject: | Re: Display Sprites on Character Create |
Lea wrote: Lea please <3 I'm going to rewrite this tutorial for MSE(latest) So check back in a while for an update. Just undo anything you've done regarding this for now. Thanks. I got up to "Call Engine_BltToDC(DD_SpriteSurf, sRECT, dRECT, frmNewChar.picSprites)". Completely failed! |
Author: | Doomy [ Sat Sep 13, 2008 10:46 pm ] |
Post subject: | Re: Display Sprites on Character Create |
thank you me and matt spent hours trying to make this to work also can you make it do BltToDC |
Author: | Mattyw [ Sat Sep 13, 2008 10:50 pm ] |
Post subject: | Re: Display Sprites on Character Create |
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. |
Page 2 of 4 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |