ID:263477
 
To the mods:
My proxy won't let me on the developers side.

The code is...

mob
proc
SSay(t as text)
world<<"<b><font color=blue>[usr] wsays: [t]</b></font>"

obj
say
name="Say"
layer=5
icon='verbs.dmi'
icon_state="Say"
screen_loc="3,2"
Click()
SSay()
New(client/s)
..()
s.screen+=src


It don't work.

Errors:
Unnamed RPG.dm:50:error:SSay:undefined proc
Author: Dark Bahamut [Posts]
Date: 2/5/07 11:41 pm
Topic: Final programming language question.

Read the DM Reference on Click()
In response to Flame Sage
Flame Sage wrote:
Author: Dark Bahamut [Posts]
Date: 2/5/07 11:41 pm
Topic: Final programming language question.

Read the DM Reference on Click()

I did... nothing.
In response to Dark Bahamut
Your not fit to code you have to learn it or give you have to also stop asking us these simple questions you can easily figure out if you read up on it a little bit.
In response to A.T.H.K
A.T.H.K wrote:
Your not fit to code you have to learn it or give you have to also stop asking us these simple questions you can easily figure out if you read up on it a little bit.

The DM reference didn't help is what I meant.

A example was shown, but I wasn't able to see what the example had to do with my problem other then it being in DM.
Look at what you're doing. You're trying to call a /mob proc from an /obj proc, without specifying a mob on which to call the proc. Why would you expect that to work?
What Crispy said..You're calling a proc to a mob without telling it which mob. Instead, make a proc that will add the hud to the player's screen:
mob
proc
HudAdd()
var/obj/say/S = new //creates a new say object that from now on can be referred to as S
src.client.screen += S// adds the newly created S to the user's screen who the proc is ran on
In response to MechaJDI
MechaJDI wrote:
What Crispy said..You're calling a proc to a mob without telling it which mob. Instead, make a proc that will add the hud to the player's screen:

WTF? Crispy is right, but 'making a proc that will add the hud to the player's screen' doesn't compensate for calling a proc inproperly. And BTW, he already has such a proc...
In response to Dark Bahamut
try doing ur own code as u say to me
In response to Shomone
obj
say
Click()
usr.Say()
New(client/C)
if(!C)del src
C.screen+=src
proc
Say()
var/msg = input("")as null|text
if(!msg)return
if(length(msg) > 500)
msg = copytext(msg,1,501)
world<<"[src.name] : [html_encode(msg)]"
mob
Login()
..()
new /obj/say(src.client)

In response to Dark Bahamut
Dark Bahamut wrote:
A.T.H.K wrote:
Your not fit to code you have to learn it or give you have to also stop asking us these simple questions you can easily figure out if you read up on it a little bit.

The DM reference didn't help is what I meant.

A example was shown, but I wasn't able to see what the example had to do with my problem other then it being in DM.

Yes, the DM ref can come across as a bit vague, but that's not a real excuse to post simple coding problems like this all over the place.

My advice: Experiment with whatever problem you're having. Try it in a million and one different ways. Keep a web browser open to the REF at all times while you code and try to take everything the ref says as literal as possible.

Think of it like this... You are a priest attempting to convert wrongdoers into your religion. You're only weapon? The bible (DM Ref and/or DM guide)!!! Now, stop asking God for solutions to the littlest of problems and try to experiment to find your own! God luck!... er I mean good.
In response to Riva
You're a Help Vampire Go read the DM guide DM Guide and get on with it.
In response to Xx Dark Wizard xX
Xx Dark Wizard xX wrote:
> obj
> say
> Click()
> usr.Say()
> New(client/C)
> if(!C)del src
> C.screen+=src
> proc
> Say()
> var/msg = input("")as null|text
> if(!msg)return
> if(length(msg) > 500)
> msg = copytext(msg,1,501)
> world<<"[src.name] : [html_encode(msg)]"
> mob
> Login()
> ..()
> new /obj/say(src.client)
>


Uh, yeah, expect the part where you explain how it works. Providing a snippet to someone with no other explanation is like putting you inside an helicopter and telling you to fly. You are provided a working model; but not instructions on how to use it.
In response to Northern Rabbit
obj
say
layer = 7
screen_loc= "1,1" // location
Click()
usr.Say() // usr is the clicker
New(client/C) // this gets called when its created
if(!C)del src // prevents annoying runtimes
C.screen+=src // adds it to the screen
proc // global proc
Say()
var/msg = input("")as null|text // prompt the message
if(!msg)return // no blank ones
if(length(msg) > 500) // catches long messages
msg = copytext(msg,1,501) // caps it at 500 chars
world<<"[src.name] : [html_encode(msg)]" // chatroom like output
mob
Login()
..() // if you already have another login
new /obj/say(src.client) // add it to the clients screen


In response to Riva
Riva wrote:
My advice: Experiment with whatever problem you're having. Try it in a million and one different ways. Keep a web browser open to the REF at all times while you code and try to take everything the ref says as literal as possible.

That's some very bad advice. Experimenting is good, but not just trying stuff illogically. At first, realize the DM Reference is easily and convienently accessible by pressing F1 in Dream Maker. :P Also, the DMRef isn't nearly that hard to understand if you have basic DM knowledge (if you don't, off you go to the DM Guide!), but just trying random stuff is the worst way to solve things. Rather, look at the example at the DM Reference to see how they do it. If you still don't understand, look for info about that proc/operator, how people use it (from code/explanations on the forums, demos, libraries and whatnot).
Definetely don't randomly guess stuff, expect it to work, then post new topics whining it doesn't work on the forums like some people do.