ID:1651423
 
(See the best response by Kaiochao.)
Code:
obj
Stationary
Fire
Flames
icon='Fire.dmi'
icon_state="Fire"


Problem description:

I don't have a code, really, but I imagine the solution is really simple. It's probably just some proc I'm overlooking, but how can I make an object(Fire) if walked on, affect those that are walking on it(in terms of damage)

Basically, when walked on, it will damage the "Vitality" var of the mob who walked on it.

For subtypes of /atom/movable, you can override Crossed(atom/movable/Mover) to affect Mover when it crosses src.
uhhhhhhh. In english, please? xD
Actually. I got it working using the built in Crossed proc, but one issue remains. It only does the effect when walked over. I need it to the effect while the user is standing in it also.
In response to Apophis0
If you want a continuous effect, you'll need to repeat some code using a while() loop. Make sure you don't start more than one loop, that the loop has a delay (using sleep), and that it ends appropriately. Continue to show your code, if you don't mind, just in case.
In response to Kaiochao
Are there any tutorials or anything for creating loops using while? The info built into DM isn't very helpful.
In response to Apophis0
Best response
// quick and dirty
obj/Stationary/Fire/Flames
Crossed(mob/M)
while(M.loc == loc)
M.TakeDamage(5)
sleep 5

Whenever a player (let's call him M) steps on the flames, he takes 5 damage. While M stays on the flames, he will take 10 damage per second.

Note that if M is on multiple flame objects, then M will take damage for each flame separately. This can happen if you're using non-tile-movement or if you stacked flames on the same tile.
should read the dm guide lol people here aren't going to make a game for you