I know i haven't put the code in for it to be on screen. I just want someone to tell me why, when i click the button, nothing happens.
I need help.
Here's the code
donatebutton
icon = 'hud.dmi'
icon_state = "donate"
Click()
spawn()
/mob/verb/Donate
It's not alot and its probably something simple.
Thanks a lot
Evil Guy/Rob
ID:267607
Jul 29 2003, 1:05 am
|
|
Jul 29 2003, 1:24 am
|
|
/mob/verb/Donate won't do anything. I would make Donate a proc than call it from Click. :)
|
In response to Jnco904
|
|
i'm a bit of a newbie, so how would i do that?
|
In response to Evil Guy
|
|
To change the verb into a proc it could be as simple as going to where you defined it and changing verb to proc, but if you have usr in there it won't work correctly and there could be other problems. Post the code for the verb if you can't get it to work. As for calling it, go into dream maker and hit F1. This will bring up the help files, search for call() and it will explain how to use it and how it works.
|
In response to Jnco904
|
|
Ok, now this is the hud button
donatebutton icon = 'hud.dmi' icon_state = "donate" Click() call(/mob/proc/Donate)("Donate") It comes up with no-errors but still when i click it nothing happens but this... runtime error: Cannot read null.text proc name: Donate (/mob/proc/Donate) source file: mobs.dm,227 usr: Evil G... (/mob/characters/changling) src: null call stack: Donate("Donate") the donatebutton (74,64,11) (/turf/donatebutton): Click(the donatebutton (74,64,11) (/turf/donatebutton)) ...and i don't think thats a good thing. This is where the proc that is being called comes from.. mob/proc/Donate() set category = "Other" switch(input("What type of Donation?", "Donate", text) in list ("Skills","Power","Immortal Power")) if("Skills") if(usr.client.PayDimes(10,"Evil Guy")) So..now if anyone can help me again, please do. |
In response to Evil Guy
|
|
donatebutton That should work. I think the main problem was in input the default message was text(without quotes), but you also had usr in there. I sent the usr as an arguement from the button so that shouldn't cause any problems either. I must recommend that you look over the changes instead of copy & pasting them then moving on though, as it may come in handy later on down the road. :) |
In response to Jnco904
|
|
I'm really sorry but even that doesn't work, but thanks for trying. :D
|
In response to Evil Guy
|
|
Well in case it's something wrong with my argument sending(I don't use call() that way much) you could just put everything from the switch down straight into the Click() proc and change the Cs back to usrs. :)
|
In response to Jnco904
|
|
just before you had replied to the last message, i did that...and it worked. :D
But now, i need a screen positioning code, i've tried the screenbuilder and thats not working (it also confuses me, lol) this is what i have for a part of the hud, that isn't meant to do anything, its just meant to be on screen. obj hud hudleft icon = 'hud.dmi' icon_state = "hud-left" New(client/usr) screen_loc="3,1" usr.screen+=src this SHOULD work right? I mean just for a positioning code, but it says that "screen_loc="3,1" and "usr.screen+=src" are inconsistant indentations, but when i move it forward or backward it says the same. Maybe i need a new code or something. |
In response to Evil Guy
|
|
That should work. Make sure that if you normally use tabs for spacing that you don't have spaces instead or vice versa.
|
In response to Jnco904
|
|
ok it all works, but now when i click, for example, world-say, it just says what-ever turf, the icon is hovering over.
e.g. EVIL GUY shouts:- the grass or.. EVIL GUY shouts:- the stoneturf now THAT!, is confusing me. **this has just been full of different problems, and every time jnco, you've helped me. Thanks!** |
In response to Evil Guy
|
|
My guess would be that your say button output it looks like this:
world<<"[usr]: [src]" That's the only thing I can think of that would do anything like that. :) What you would need is something like this: Click(msg as text) world<<"[usr]: [msg]" Now when a player clicks on the source "(msg as text)" automatically prompts the usr to define a msg as text. Then, what I think is the only problem with your code is that you have to make sure you display the msg instead of something else. :) p.s. When you are very clear about what is wrong and what you want something to do(As you are), it is easy to help. :) |
In response to Jnco904
|
|
nope thats not it, as thats what i had before.
|
In response to Evil Guy
|
|
Hmmm weird, if you post your say button I might be able to see the problem.
|
In response to Jnco904
|
|
obj
hud saybutton icon = 'hud.dmi' icon_state = "say" screen_loc = "8,1" Click(msg as text) view(6) << "<font size = 5>{}<font size = 2> [usr]<font color=white> says: [msg]</font color = white>" BalloonText(msg, src.loc) this is what i have as 'say' in the verb panel too, and that works... |
In response to Evil Guy
|
|
BalloonText(msg, src.loc) has to be the culprit, I think it's supposed to be BalloonText(src.loc, msg). When you send arguments to a proc that aren't named, they go by position. This is probably what the proc BalloonText()'s definition looks like:
BalloonText(SomeLocVar, SomeTextVar) So they were just flipped around in your call to it. :) |
In response to Jnco904
|
|
nope, not that either because it does the same for world say, and that verb doesn't have bubbletext.
|
In response to Evil Guy
|
|
O.o I haven't got a clue, but you could post shout too. Basically, it seems like your calling a turf name var, so I'd try to look around for any out of place vars. :P
|
In response to Jnco904
|
|
don't worry. I've done it! finnaly!
Thanks a lot for your help |