ID:1926150
 
Code:
File #1:
/mob
var/msg = "ERROR"


File #2:
/mob/mignon/proc/mobsay()
world << "[src.name] says,'[msg]'"

/mob/mignon/proc/live()
spawn(1)
msg = "test"
call(mobsay())()
return
return


Problem description:

What I want to happen is the proc live() will be called every tick (it is for testing purposes). The live() proc calls the mobsay() proc, as well as define what the mob will say. However, when testing the game, they never say anything, in fact, it is like they never called the proc somehow.

Why is that?

Are you ever actually calling the proc?
Yes, in here:

/mob/mignon/proc/live()
spawn(1)
msg = "test"
call(mobsay())()
return
return
Are you ever calling live()?

Wait... I barely read your code.

/mob/mignon/proc/live()
spawn(1)
msg = "test"
call(mobsay())() //minor problem here
return
return


You don't need call()

/mob/mignon/proc/mobsay(msg)
world << "[name] says,'[msg]'"

/mob/mignon/proc/live()
spawn(1) //why are you spawning here?
mobsay("test") //get rid of the stupid variable. Use an argument.
return //why are you returning inside a spawn?
return //why are you returning nothing?
I figured out the issue: I wasn't calling live(). That is why spawn() was there, I thought that made them looped.

Also, yeah, thanks for optimizing my code. I'm new to byond.
Ah, that makes a lot more sense. Taking the weekend to read the guide, I think would give you the biggest head start possible.

It's not a big deal if you don't understand it as you are reading it. Just make an honest effort to read it, and when you don't understand something, try playing around with the idea to see if you can figure out why/how it works.