Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spell property
#1
I didn't know if I should combine the topic I posted about earlier, but at any rate here goes.
I'm updating my spells list, so when you click on a spell, you get the corresponding icon you saved with it. I can do the calling of the icon, but its the saving of the icon data that gets me.

So: Here's the code so far.

a new picture box called picIconSP

in modTypes (Client & server)

Quote:SpellIcon As Long
after
Quote:SpellDone As Long
.

Now I updated the TCP of both Client and Server to this (Edit is at the end):
Quote:Sub SendSaveSpell(ByVal SpellNum As Long)
Call SendData("savespell" & SEP_CHAR & SpellNum & SEP_CHAR & Trim$(Spell(SpellNum).Name) & SEP_CHAR & Spell(SpellNum).ClassReq & SEP_CHAR & Spell(SpellNum).LevelReq & SEP_CHAR & Spell(SpellNum).Type & SEP_CHAR & Spell(SpellNum).Data1 & SEP_CHAR & Spell(SpellNum).Data2 & SEP_CHAR & Spell(SpellNum).Data3 & SEP_CHAR & Spell(SpellNum).MPCost & SEP_CHAR & Trim$(Spell(SpellNum).Sound) & SEP_CHAR & Spell(SpellNum).Range & SEP_CHAR & Spell(SpellNum).SpellAnim & SEP_CHAR & Spell(SpellNum).SpellTime & SEP_CHAR & Spell(SpellNum).SpellDone & SEP_CHAR & Spell(SpellNum).AE & SEP_CHAR & Spell(SpellNum).Big & SEP_CHAR & Spell(SpellNum).SpellIcon & SEP_CHAR & Spell(SpellNum).Element & END_CHAR)
End Sub
after
Quote:SpellDone As Long
.

I added this into frmSpellEditor:



This goes in Client's Handledata:
Quote:Spell(n).SpellIcon = Val(parse(18))
This is in the server's Handledata:
Quote:Spell(Spellnum).SpellIcon = Val(SpellData(18))
This is in modGameEditor:
Quote:frmSpellEditor.Hscroll1.value = Spell.SpellIcon
In frmMirage:
Quote:picIconSP.picture = Spell(SpellNum)SpellIcon

However... Nothing. I defined everything (I think) but It's not showing me the icon...)
Reply
#2
What the hell is this? xD

Code:
picIconSP.picture = Spell(SpellNum)SpellIcon

To load a picture, use the LoadPicture() function.

Some something like this:

Code:
picIconSP.picture = LoadPicture(app.path & GFX_PATH & "\SpellIcon" & Spell(SpellNum).SpellIcon & ".jpg")
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
Except I wanted it to load the picture from the data that I saved. I might have forgot to include that. Let me look and I'll edit.

Quote:his is in modGameEditor:

frmSpellEditor.Hscroll1.value = Spell.SpellIcon

see? So I need to load picture for this?
Reply
#4
What picture? Look at your code, all you're storing in .PicIcon is a number.

You need to then link that number to an image file on the person's harddrive.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#5
My mistake Robin, I see how it works. Is the rest of the code syntaxed correctly?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)