ID:179238
 
proc name: LasFire (/mob/proc/LasFire)
source file: boardmove.dm,259
usr: the orange-bot (/mob/player)
src: the orange-bot (/mob/player)
call stack:
the orange-bot (/mob/player): LasFire()
the orange-bot (/mob/player): board()

And the actual proc

obj/nlas/proc
fire()
usr << "test zorch" //DEBUG
for(usr in src.loc)
usr << "ZORCH!!!"
var/damage = 1
usr.hp -= damage
usr << "laser damage [damage]"

Being called this way:
mob/proc/LasFire()
usr << "test laser fire" //DEBUG
call(/obj/nlas,/obj/nlas/proc/fire)()

it compiles fine but I have no idea why it is claiming that the proc is null, am I using call in the wrong way or just missing something simple?

Thankyou for your help, I should be getting my blue book soon.

Illyena
Probably because it doesn't know what you're telling to fire. I've never used a call() proc, so I'm not sure how it works, but I do know that you're not giving it an object to work with. Why don't you just call it the normal way?

mob/verb/LasFire()
for(var/obj/nlas/L in src.contents)
usr << "You fired your laser!"
spawn() L.fire()
return
src << "You don't have a laser!"

Here's what I assume the fire() proc should look like...

obj/nlas/proc/fire()
// src.loc, assuming it's in your contents, would return everything in the usr's contents...
for(mob/M in usr.loc)
// the usr isn't generally in the usr's contents.
M << "ZORCH!"
var/damage = 1
M.hp -= damage
M << "You take [damage] damage!"
In response to Foomer
because it is not a mob/verb it is a obj/proc, an object at a location on the map fires at regular intervals damaging any player that happens by it, it cannot be an action called by the player, it has to happen completely independantly of the player and just happent to effect any player that is in its tile. Does that make more sense to what I was asking.

Illyena
In response to Illyena
How are you detecting when a player enters the turf?
In response to Foomer
In response to Illyena
Illyena wrote:
at the moment I am not, I want the fire()proc to execute whether there is a mob there or not, right now it looks like this. Building on your previous suggestions.

obj/nlas/proc
fire(mob/M)
if(M.loc == src.loc)
usr << "test zorch" //DEBUG
for(M in src.loc)
M << "ZORCH!!!"
var/damage = 1
M.hp -= damage
M << "You take [damage] damage!"
return ..()

His indentation isnt messed up, even though it looks like it is. Just thought i would clear that up before anyone says anything about it. The tab just didnt show i guess.

As for fixing it, i suggest using the dm tags.

FIREking
In response to FIREking
FIREking wrote:
As for fixing it, i suggest using the dm tags.

FIREking

I fixed the formatting of the previous post so that now It is understandable
Illya
In response to Illyena
Because it's not code, it's Dantom's DM html tage for code blocks, there's more info here, and here.
In response to Nadrew
I'll keep formatting in mind in the future, Repremand given and recieved, My Netiquette has recieved its proper punishment, I will grovel before you if nessecary, But can we please move on. I don't mean to sound snitty, I really appreciate the help, but I have seen a theme on the forums of never letting a mistake in posting die, and the actual question gets lost in a bunch of poking and biting. I really am struggling with this issue and could use feedback related to the issue and less to my posting habits.

Illya
In response to Illyena
Not directly, it just keeps your code from getting messed up when you post it, and makes it easier to read when people are trying to help you.
In response to Foomer
Foomer wrote:
How are you detecting when a player enters the turf?

at the moment I am not, I want the fire()proc to execute whether there is a mob there or not, right now it looks like this. Building on your previous suggestions.

obj/nlas/proc
fire(mob/M)
if(M.loc == src.loc)
usr << "test zorch" //DEBUG
for(M in src.loc)
M << "ZORCH!!!"
var/damage = 1
M.hp -= damage
M << "You take [damage] damage!"
return ..()
In response to Illyena
obj/nlas/proc
fire(mob/M)
if(M.loc == src.loc)
usr << "test zorch" //DEBUG
for(M in src.loc)
M << "ZORCH!!!"
var/damage = 1
M.hp -= damage
M << "You take [damage] damage!"
return ..()
Now, doesn't that look nice and organized? :o)

I think that code looks fine. What's the problem now?
In response to Foomer
Foomer wrote:
obj/nlas/proc
> fire(mob/M)
> if(M.loc == src.loc)
> usr << "test zorch" //DEBUG
> for(M in src.loc)
> M << "ZORCH!!!"
> var/damage = 1
> M.hp -= damage
> M << "You take [damage] damage!"
> return ..()
Now, doesn't that look nice and organized? :o)
I think that code looks fine. What's the problem now?

Ok I am still getting the same error, basically that the fire() proc is returning a null value and I can't figure out why?

runtime error: Cannot execute null.fire().
proc name: LasFire (/mob/proc/LasFire)
source file: boardmove.dm,259 ...

the proc needs to be independant of the usr, and preferable a proc of the object, I need to call the obj/xx/proc/fire() from another proc that gets executed at the time every "turn" during the 'resolve board elements' phase, that is the only reason that the suggestions you have made so far far havn't really been applicable although I have tried to use them to clean up and try different things in my code.
I am at a loss as to how to continue.

Illyena