ID:175177
 
Im trying to make a verb for my game so that the player can use there own custom icon, instead of the normal ones for the game, like in Icon Chatterz if you have ever played it..............

here is my code that dont work:

verb
Change Icon
proc
scr.icon
change.newicon
del
Something like this would work...

mob
verb
Change_Icon(var/I as file|null)
if(!I)
return 0
else
usr.icon=I

NOTE: THIS ISN'T PROPER INDENTATION!
In response to Goku72
thanks it works but can you tell me how it works plz?
In response to Nave


Change_Icon(var/I as file|null)//The as is saying to set it's variable to a certain type, and file is a type. And |null makes it so one can "Cancel".
Nave wrote:
Im trying to make a verb for my game so that the player can use there own custom icon, instead of the normal ones for the game, like in Icon Chatterz if you have ever played it..............

here is my code that dont work:

Following is a line-by-line explanation of why it doesn't work.

verb

This entire thing needs to be part of a mob or something, so it should all be indented under "mob" (no quotes) or should start out as "mob/verb".

Change Icon

That's not a valid way to set up a verb. For one thing, you put a space in the name, which you can't do. (To make verbs look like there's a space, use "set name"; look it up in the reference. Otherwise you can use an underscore _ which will be translated to a space for you.)

Also, you have to follow this with parentheses, and maybe some parameters to go with the verb. A basic verb looks like this:
mob
verb
Test()
usr << "Testing!"
Back to your code...

proc

If the previous lines had been set up correctly, this one would still be a problem. You can't start defining a brand new proc right in the middle of a verb.

scr.icon

I think you meant that to be src, not scr. Also, you need to do something with src.icon. DM will give you a "missing expression" error, as I recall, if you try to compile this. An actual expression would be something like "src.icon = something" (again, no quotes).

change.newicon

I doubt you have a var named "change", so this won't do any good. If you do, then you still have the missing expression problem. If you wanted to call a proc, though, you could use change.newicon(), assuming change was some kind of object and newicon() was a proc belonging to it.

del

You can't use del without 1) parentheses, and 2) something to delete. If you want to delete something, use del(something).

Lummox JR
In response to Lummox JR
wow, you made me look like a dumbass = ) thanks for the help, lol
In response to Lummox JR
One thing LummoxJR. Its with the last part of your message. In Some cases, can't you use del without parentheses?

Example


mob
verb
Destroy_All()
for(var/atom/A in world)
del A



That would work right? Not trying to be a wise guy.


<^Airjoe^>
In response to Airjoe
The parentheses are optional, with <code>del</code>.