Mirage Source
Spell property - 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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Spell property (/showthread.php?tid=2201)



Spell property - JadeCurt1ss - 28-09-2008

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...)


Re: Spell property - Robin - 29-09-2008

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")



Re: Spell property - JadeCurt1ss - 30-09-2008

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?


Re: Spell property - Robin - 01-10-2008

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.


Re: Spell property - JadeCurt1ss - 01-10-2008

My mistake Robin, I see how it works. Is the rest of the code syntaxed correctly?