ID:268403
 
I have a few questions on procs, and calling them.

obj
random
proc/nothing()
world << "Nothing."


mob
proc
Initiate()
for(var/obj/o in world)
o.nothing()


That obviously doesn't work. So my question is how to call a proc like from above... Hope that isn't too confusing.
Devourer Of Souls wrote:
I have a few questions on procs, and calling them.

obj
random
proc/nothing()
world << "Nothing."


mob
proc
Initiate()
for(var/obj/o in world)
o.nothing()


That obviously doesn't work. So my question is how to call a proc like from above... Hope that isn't too confusing.

Maybe try for(var/obj/random/O) instead. You need to tell BYOND the correct typepath or it doesn't know about the proc.
Firstly, use dm tags when showing code.

If you want to know how to call a proccess in general then here's my way:

mob
proc
Nothing()
world << "Nothing"

mob
verb
DoProc()
usr.Nothing()
Devourer Of Souls wrote:
I have a few questions on procs, and calling them.

Most of your questions can probably be answered by reading this section of the Blue Book.
obj/cards
Warlord_Robert
Card=1
Cname="Warlord Robert"
bStrength=5
bDefense=15
bSpeed=1
bLevel=5
bRange=1
bVitality=8
bIntelligence=9
bWill=6
bHP=3
bAttacks=2
Type="Character"
Species="Human"
Element="Mercala"
Ability="At the start of your turn, you may choose which deck you draw from."
proc/Before_Draw()
var/a=input("Which deck do you wish to draw from?")in list("Characters","Spells","Runes","Items")


That may be incorrect, but that's the way I want to set it up so that effects may be called in such a way. With this for example.

mob
proc
Draw()
for(var/obj/cards/o in world)
if(o.inplay==1)
o.Before_Draw()


This however returns an error..Undefined proc. Any help?