ID:174998
 
I have two questions which i hope you, the good people of the BYOND world will answer:
mob
var
guildicon = 'snake.dmi'
guildname = "Snake"
Stat()
statpanel("Guild")
stat("[guildname]", <--- my 1st question is how to display the variable 'guildicon' in the statpanel so it shows the icon it contains....

My 2nd question is...
Magic.. how can i make spells have icons?
I can already make a simple magic system with verbs but was wondering how to give them icons....

Thanks (i hope) in advance..
-Thorg
Thorg wrote:
I have two questions which i hope you, the good people of the BYOND world will answer:
mob
var
guildicon = 'snake.dmi'
guildname = "Snake"
Stat()
statpanel("Guild")
stat("[guildname]", <--- my 1st question is how to display the variable 'guildicon' in the statpanel so it shows the icon it contains....

My 2nd question is...
Magic.. how can i make spells have icons?
I can already make a simple magic system with verbs but was wondering how to give them icons....

To make an icon show in the statpanel, you need to make an atom for it. Typically this would be something that you'd make early on and then create a reference to it. If for example your guild is handled by a datum, you can create an obj to go with it that people can use to display the guild. (And you can give the obj verbs if you want.)
guild
var/name
var/icon
var/obj/Obj
var/list/members

New()
members = new
Obj = new
Obj.name = name
Obj.icon = icon
Obj.verbs += /guild/proc/Guildsay

... // put procs here
Then, when you want to display the guild, it would go something like this:
mob
var/guild/guild

Stat()
...
if(guild)
statpanel("Guild", guild.Obj)
You'd do something similar to give a spell an icon, although it may be easier to handle a spell directly as an /obj/spell or something instead of creating a datum to go with it.

Lummox JR
In response to Lummox JR
Just out of intrest can anyone show me a datnum tutorial or a way of grouping obj's so i can make spells in the form of obj's..

Thanks in advance
-Thorg

p.s. Thanks Lummox
In response to Thorg
Here, check out Lummox's nice datum tutorial on BYONDscape: http://www.byondscape.com/ascape.dmb/LummoxJR.2002-0927/