ID:829382
 
(See the best response by Robertbanks2.)
These questions are to improve my DM understanding. As I code in more I wish to learn more and have more that I need to learn.

1) When a proc is called using New() or under a verb, what is the thing that comes before the proc's name divided by the "."?

src.proc()

The src here. What does it do? Is it the one executing the code?

2) What is in the parenthesis of a proc when it is called?
proc(usr)

Is it what the proc affects?

3) If I'm calling a proc, how do I target with it? I can do it with a verb but now with a proc.

mob/proc/attackp(mob/m)//attack proc
m.hp-=10//how do i write decrease hp here so that it targets?
mob/verb/attack(mob/t)//target
src.attackp(t) //is that how I do it?


How do I make the proc target what the verb targets and decrease hp for example?

4) What are all the ways to declare a variable?
I know these ways:

mob/var/thevar
var/variable
mob/verb/anything()
var/mob/declvar// declaring variable under a verb
for(var/mob/x in list)


I may have forgotten one or two to add here.

tmp
can also be added.

I had one more question but I don't now how to express it. I will ask it here if I remember but answers would be really appreciated.
I'm bit more than a novice as a can code a lot but I haven't learned all the newbie concepts.
Before you get even further ahead of yourself than you already have (judging by the posts you've made), I suggest you start from the beginning for once.
After all the coding I did before, I'm quite embarrassed asking these already :(.
Best response
You shouldn't feel embarrassed. The fact that you're stepping up and admitting that you need, and want, to learn more shows that you're doing better than a majority of the new developers on BYOND.

I do suggest that you partake in the link Kaiochao provided and get started the right way, but if you find that you need some one on one help with certain topics, my MSN address is on my user page and I'm happy to help anyone who is serious about improving.
^ Agreed
TheDarkChakra wrote:
These questions are to improve my DM understanding. As I code in more I wish to learn more and have more that I need to learn.

1) When a proc is called using New() or under a verb, what is the thing that comes before the proc's name divided by the "."?

src.proc()

The src here. What does it do? Is it the one executing the code?

ya

2) What is in the parenthesis of a proc when it is called?
proc(usr)

Is it what the proc affects?

no its passing an argument 2 the proc so technically ya but in all the proper terms no

/mob/proc/amiaretard(name, age)
if(name == "xerif" && age < 9)
world << "yes"

amiaretard("xerif", 8)


as u can see im jus pluggin 2 values in2 the proc wer it says 'name' an 'age' by going amiaretard("xerif", 8) wen im calling it

3) If I'm calling a proc, how do I target with it? I can do it with a verb but now with a proc.

mob/proc/attackp(mob/m)//attack proc
> m.hp-=10//how do i write decrease hp here so that it targets?
> mob/verb/attack(mob/t)//target
> src.attackp(t) //is that how I do it?

yes like half ur questions r rite 2 an extent all u need is exp i dunno y u ask

4) What are all the ways to declare a variable?
I know these ways:

mob/var/thevar
> var/variable
> mob/verb/anything()
> var/mob/declvar// declaring variable under a verb
> for(var/mob/x in list)


I may have forgotten one or two to add here.

tmp
can also be added.

i aint kno y u wud want 2 kno more ways 2 declare

var
honk = 2


In response to TheDarkChakra (#2)
TheDarkChakra wrote:
I'm bit more than a novice as a can code a lot but I haven't learned all the newbie concepts.

You are a novice though, quite obviously. It's not a bad thing to be. Acknowledging so, and putting learning in resources aimed at novices will do you far more good than convincing yourself you are above those resources.

You ability and skill comes from both practice, and understanding. Having one without the other isn't really very much good to you, and stands a good chance of producing a poor result in terms of your ability to do things with programming, or the quality of your code.