Mirage Source http://miragesource.net/forums/ |
|
Visual Spells - Error http://miragesource.net/forums/viewtopic.php?f=184&t=5922 |
Page 1 of 70 |
Author: | AkselJ [ Sun Jul 05, 2009 1:09 pm ] |
Post subject: | Visual Spells - Error |
Hey there, Well basically, while making Visual Inventory (which now works) and Visual Spells (with icons) I encountered an error. The spells icon won't save so I always end up with the blank one... What I did was remove the frame from the spell editor. I called the icon's variable "Frame" as it is easier to remember since scrlFrame already existed. Spell casting works, learning spells works but not getting the proper icons. So, if anyone could list up all the places I need to add stuff to make a new variable in spells so I can see if I am misssing some, please do so. Thanks, AkselJ |
Author: | Matt [ Sun Jul 05, 2009 3:48 pm ] |
Post subject: | Re: Visual Spells - Error |
Follow your save and edit spell packets. |
Author: | AkselJ [ Sun Jul 05, 2009 7:33 pm ] |
Post subject: | Re: Visual Spells - Error |
I tried that, but I couldn't find anything there... |
Author: | Matt [ Sun Jul 05, 2009 9:18 pm ] |
Post subject: | Re: Visual Spells - Error |
Is this the byte array packets version or the original method? Either way, you have to send in the exact same order and when it comes to the byte array method, if you write a long, you have to read a long. |
Author: | AkselJ [ Sun Jul 05, 2009 11:13 pm ] |
Post subject: | Re: Visual Spells - Error |
I tried following the packets again, and noticed somplace i forgot to add the new variable. Now, though, the pictures won't load in the spells list, it only returns the spell as 0 loading the empty spell frame... Any ideas? |
Author: | Matt [ Mon Jul 06, 2009 1:05 am ] |
Post subject: | Re: Visual Spells - Error |
Possibly not setting the scrlframe value to whatever the value you saved to the item, properly. |
Author: | AkselJ [ Mon Jul 06, 2009 12:04 pm ] |
Post subject: | Re: Visual Spells - Error |
Matt wrote: Possibly not setting the scrlframe value to whatever the value you saved to the item, properly. Whenever I save an spell, I can open it fine and it displays the correct picture. Code: ' ::::::::::::::::::: ' :: Spells packet :: ' ::::::::::::::::::: Private Sub HandleSpells(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim i As Long Dim j As Long Dim n As Long Dim k As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteBytes Data() With frmSpells .Visible = True For i = 1 To MAX_PLAYER_SPELLS k = Buffer.ReadLong PlayerSpells(k) = Buffer.ReadLong Next ' Put spells known in player record For i = 1 To MAX_PLAYER_SPELLS If PlayerSpells(i) <> 0 Then .picSpell(Int(i - 1)).Picture = LoadPicture(App.Path & "\gfx\spells\icons\" & Trim$(Spell(i).Frame) & ".bmp") Else .picSpell(Int(i - 1)).Picture = Nothing End If Next End With End Sub Apparently, this line returns 0 as the frame... Code: .picSpell(Int(i - 1)).Picture = LoadPicture(App.Path & "\gfx\spells\icons\" & Trim$(Spell(i).Frame) & ".bmp") And, obviously, this line from the Sub SpellEditorInit loads the picture the same way, and it works fine there... Code: .scrlFrame = Spell(EditorIndex).Frame So I have no idea what's wrong.... Well I am a newb in working with MS though... |
Author: | Matt [ Mon Jul 06, 2009 3:42 pm ] |
Post subject: | Re: Visual Spells - Error |
Why are you subtracting 1 from i at the start of it, but not anywhere else? That makes no sense.. |
Author: | AkselJ [ Mon Jul 06, 2009 4:32 pm ] |
Post subject: | Re: Visual Spells - Error |
It makes perfect sense as the index for the picSpell starts with 0 and spell indexes starts with 1 Edit: Figured out I was wrong, I was supposed to use Trim$(Spell(PlayerSpells(i)).Frame) and not Trim$(Spell(i).Frame).. Thanks, you got me on the tought Still suffering from the error though.... :S |
Author: | AkselJ [ Sun Jul 19, 2009 7:52 pm ] |
Post subject: | Re: Visual Spells - Error |
Bump |
Author: | AkselJ [ Sun Aug 02, 2009 4:29 pm ] |
Post subject: | Re: Visual Spells - Error |
Bump =( |
Author: | AkselJ [ Wed Sep 09, 2009 1:42 pm ] |
Post subject: | Re: Visual Spells - Error |
Bump C'mon someone must know |
Author: | wanai [ Fri Jan 14, 2022 11:17 pm ] |
Post subject: | Re: Visual Spells - Error |
Econ |
Author: | wanai [ Fri Jan 14, 2022 11:18 pm ] |
Post subject: | Re: Visual Spells - Error |
142.3 |
Author: | wanai [ Fri Jan 14, 2022 11:20 pm ] |
Post subject: | Re: Visual Spells - Error |
Bett |
Author: | wanai [ Fri Jan 14, 2022 11:21 pm ] |
Post subject: | Re: Visual Spells - Error |
Bett |
Author: | wanai [ Fri Jan 14, 2022 11:22 pm ] |
Post subject: | Re: Visual Spells - Error |
Theo |
Author: | wanai [ Fri Jan 14, 2022 11:23 pm ] |
Post subject: | Re: Visual Spells - Error |
From |
Author: | wanai [ Fri Jan 14, 2022 11:24 pm ] |
Post subject: | Re: Visual Spells - Error |
Visi |
Author: | wanai [ Fri Jan 14, 2022 11:25 pm ] |
Post subject: | Re: Visual Spells - Error |
Dyke |
Author: | wanai [ Fri Jan 14, 2022 11:26 pm ] |
Post subject: | Re: Visual Spells - Error |
Rexa |
Author: | wanai [ Fri Jan 14, 2022 11:27 pm ] |
Post subject: | Re: Visual Spells - Error |
Trac |
Author: | wanai [ Fri Jan 14, 2022 11:29 pm ] |
Post subject: | Re: Visual Spells - Error |
Disn |
Author: | wanai [ Fri Jan 14, 2022 11:30 pm ] |
Post subject: | Re: Visual Spells - Error |
Sony |
Page 1 of 70 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |