ID:146819
 
Well this is the first time I ever actually used Flick's library, and I'm not sure if I am doing it wrong.

AuraHelper
icon = 'Human.dmi'
icon_state = "Male-Light brown"
DblClick()
usr.AuraSelection()

verb
AuraOn()
underlays += 'Aura.dmi'
proc
AuraSelection()
if(src.regpowerlevel >= 1)
var/new_rgb = F_Color_Selector.Get_Color(src)
var/icon/I = new('Aura.dmi')
I.Blend(new_rgb)
icon = I

Oh yeah, All of that is under the mob parent. Also, my problem is that the Color_Selector comes up, but the OK Button doesn't seem to want to work >.> Thanks.

Edit:

Also, if the Aura is 2 icons, how would I got about setting that up. Thanks alot
I haven't messed with this in quite a while, and I'm not really sure what is happening. The demo seems to work fine for me. The only thing I can think of is the OK buttons Click() proc isn't registering for some reason. Did you override atom.Click(), obj.Click(), or client.Click() anywhere? Or, are you using any screen objects or high layer overlays with mouse_opacity set to 2?

Try adding this, and let me know what it does when you click on the OK button:
client
Click(Object, Location)
if(Object) src << "You clicked an [Object.type]"
..()

atom
Click()
usr << "I've been Clicked by [usr]! - [src.type]"
..()
In response to Flick
Urm...Verbs and Mobs\Mobs.dm:52:error:Object.type:undefined var

Also, I commented that line out, and the Client/Click() and the src << didn't work.. I also changed it to [Object]. I deleted .type thing and it didn't come up.
In response to N1ghtW1ng
My mistake. I assumed that Object defaulted to an atom type. You could try Object:type, though if you tried Object by itself and that didn't work I'm guessing that won't help.

Do you use client/Click() anywhere else in your code?

Try:
client
Click(Object, Location)
src << "Client clicking..."
if(Object)
src << Object
else
src << "Nothing"
..()


In response to Flick
Yeah, I just realized it:

client
Click(M)
if(usr.equipedsc)
usr.Scan(M)


How would I go about fixing it?

Edit:

Well, someone joined my beta-ing and tried it out with out knowing the NPC was bugged, and well I got this runtime:

runtime error: Cannot read null.client
proc name: Get Color Sliders (/f_color_selector/proc/Get_Color_Sliders)
  source file: F_Color_Code.dm,119
  usr: null
  src: /f_color_selector (/f_color_selector)
  call stack:
/f_color_selector (/f_color_selector): Get Color Sliders(null)
/f_color_selector_handler (/f_color_selector_handler): Get Color(null)
AuraSelection()
AuraHelper (/mob/AuraHelper): DblClick(the grass (6,11,1) (/turf/Ground/grass))
In response to N1ghtW1ng
N1ghtW1ng wrote:
Yeah, I just realized it:
client
Click(M)
if(usr.equipedsc)
usr.Scan(M)
..()

How would I go about fixing it?

You need to tell the procedure to continue doing whatever else it needs to do after that by adding a ..() to the end.



Well, someone joined my beta-ing and tried it out with out knowing the NPC was bugged, and well I got this runtime:

runtime error: Cannot read null.client
proc name: Get Color Sliders (/f_color_selector/proc/Get_Color_Sliders)source file: F_Color_Code.dm,119usr: nullsrc: /f_color_selector (/f_color_selector)call stack:/f_color_selector (/f_color_selector): Get Color Sliders(null)/f_color_selector_handler (/f_color_selector_handler): Get Color(null)AuraSelection()AuraHelper (/mob/AuraHelper): DblClick(the grass (6,11,1) (/turf/Ground/grass))


That is pretty odd, since in the code you posted, you call F_Color_Selector.Get_Color(src), but that error is showing Get_Color() called with 'null'. I'm not sure how the src is null, but I guess it's something I should check for. I suppose at some point I need to go back in and clean up the code a bit more.
In response to Flick
By the way, I noticed a slight problem with the menu. If you have a reasonably big map, the menu flicks(heh) as you move around.
In response to Flick
Ah ok, now that works fine. I have one other problem now. My icon goes blank, as in the player just disapears when I click ok. Also, the I get the runtime:

runtime error: undefined proc or verb /obj/Aura/Top/Blend().

proc name: AuraSelection (/mob/proc/AuraSelection)
  source file: Mobs.dm,50
  usr: \[Master GM] N1ghtW1ng (/mob/characters/Saiyan)
  src: \[Master GM] N1ghtW1ng (/mob/characters/Saiyan)
  call stack:
\[Master GM] N1ghtW1ng (/mob/characters/Saiyan): AuraSelection()
AuraHelper (/mob/AuraHelper): DblClick(the grass (6,11,1) (/turf/Ground/grass))


Thanks a lot.
In response to N1ghtW1ng
Looks like you're calling Blend on an object in AuraSelection (). Blend is an icon proc, call it from the icon itself. =)
In response to YMIHere
Hmm, can you show me how I would do that. I am calling it like...

var/icon/I = /obj/Aura/Top
I.Blend(new_rgb)
In response to N1ghtW1ng
N1ghtW1ng wrote:
Hmm, can you show me how I would do that. I am calling it like...

> 
> var/icon/I = /obj/Aura/Top
> I.Blend(new_rgb)
>
>


Use whatever icon file you are using for the object.
var/icon/I = 'AuraTop.dmi'
I.Blend(new_rgb)
In response to Flick
    proc
AuraSelection()
if(src.regpowerlevel >= 1)
var/new_rgb = F_Color_Selector.Get_Color(src)
var/icon/I = 'AuraTop.dmi'
var/icon/D = 'AuraBot.dmi'
I.Blend(new_rgb) //This is the line
D.Blend(new_rgb)
icon = I
icon = D



That is the new proc and I am getting the runtime error:

runtime error: Cannot execute null.Blend().
proc name: AuraSelection (/mob/proc/AuraSelection)
  source file: Mobs.dm,50
  usr: \[Master GM] N1ghtW1ng (/mob/characters/Saiyan)
  src: \[Master GM] N1ghtW1ng (/mob/characters/Saiyan)
  call stack:
\[Master GM] N1ghtW1ng (/mob/characters/Saiyan): AuraSelection()
AuraHelper (/mob/AuraHelper): DblClick(the grass (6,11,1) (/turf/Ground/grass))


Thanks again
In response to N1ghtW1ng
*sigh*

My mistake again. I really need to get back into programming :P

Try this:
                var/icon/I = new('AuraTop.dmi')
var/icon/D = new('AuraBot.dmi')


However, you can't set the mobs icon to two seperate icons like you are doing in the bottom two lines. You will wind up with the icon just being set to 'D'. You are going to need to use overlays, most likely pixel offset overlays.




In response to Flick
Well urm, it isn't for the mobs icon. It is for an overlay and underlay, I might of missunderstood what you meant though. I will try it out though, but maybe you can give me an hint =P


Well now I understand =P, it changed my icon to aurabot.dmi. The same thing happened when wizzy told me to use icon() in chatters.

Edit:

Well now I have this:

mob
var
auraTop
auraBottom
aura=0

AuraHelper
icon = 'Human.dmi'
icon_state = "Male-Light brown"
DblClick()
usr.AuraSelection()


verb
Aura()
if(src.auraTop && src.auraBottom)
src.aura=!src.aura
if(aura)
src.underlays+=src.auraBottom
src.overlays+=src.auraTop
else
src.underlays -= src.auraBottom
src.overlays -= src.auraTop
proc
AuraSelection()
if(src.regpowerlevel >= 1)
var/new_rgb = F_Color_Selector.Get_Color(src)
var/icon/I = icon('AuraTop.dmi')
var/icon/D = icon('AuraBot.dmi')
I.Blend(new_rgb)
D.Blend(new_rgb)
src.auraTop = I
src.auraBottom = D



The aura only appears on the bottom, no upper aura appears.
In response to N1ghtW1ng
Did you set the pixel_y?
In response to Hell Ramen
Whoops forgot to post that =P

obj
Aura
Top
icon = 'AuraTop.dmi'
pixel_y = 32
Bottom
icon = 'AuraBot.dmi'
In response to N1ghtW1ng
:p You're not adding the object anywhere.
Change the icon's pixel_y, I believe that'd work.
In response to Hell Ramen
Nope did nothing, I might of misunderstood you though.
In response to N1ghtW1ng
You're using pixel offsets?!? I had no idea! I thought that Top and Bottom referred to underlay and overlay =P.

In that case, you're going to want to do something like this:

obj
Aura
Top
icon = 'AuraTop.dmi'
pixel_y = 32
Bottom
icon = 'AuraBot.dmi'

mob
var
obj/Aura
Top/auraTop
Bottom/auraBottom
aura=0//If the aura is on or not

AuraHelper
icon = 'Human.dmi'
icon_state = "Male-Light brown"
DblClick()
usr.AuraSelection()

verb
Aura()
if(src.auraTop && src.auraBottom)
src.aura=!src.aura
if(aura)
src.underlays+=src.auraBottom
src.overlays+=src.auraTop
else
src.underlays -= src.auraBottom
src.overlays -= src.auraTop
proc
AuraSelection()
if(src.regpowerlevel >= 1)
var/new_rgb = F_Color_Selector.Get_Color(src)
if(!src.auraTop)
src.auraTop=new()
if(!src.auraBottom)
src.auraBottom=new()


//Remember: atom.icon is not a /icon,
//which is why we're doing it in a seemingly round-about way.
var/icon/top = icon(src.auraTop.icon)
var/icon/bottom = icon(src.auraBottom.icon)
top.Blend(new_rgb)
bottom.Blend(new_rgb)
src.auraTop.icon=top
src.auraBottom.icon=bottom