In response to Thedeadwarrior123
Ah. Relocating dead enemies is simple: create a turf (like /turf/enemy_respawn or something) and slap it down where you want monsters to reappear upon death. When a monster dies, just do loc = locate(/turf/enemy_spawn).

The same concept applies for players really, though for players you'd probably want to create a variable to store where the location of the last save point was, like:

mob/player
var turf/last_save_point

OnDeath(mob/killer)
// etc...
loc = last_save_point
In response to LordAndrew
what should i put in etc?
In response to Thedeadwarrior123
Whatever it is you want to happen to players when they die, which I suspect is along the lines of...

mob/player
var turf/last_save_point
var lives = 5

OnDeath(mob/killer)
world << "[killer] has killed [src]!"

--lives

if (lives <= 0)
GameOver()

else
loc = last_save_point
In response to LordAndrew
that seems fine, the only problem is the lives. I really wouldnt know how to code it.
In response to Thedeadwarrior123
What do you mean? How did you want to set lives up?
In response to LordAndrew
I just had a thought... maybe lives can be a proc that counts the number of times the deathcheck proc is used. Then when it exceeds lets say 20 then it goes to the game over proc and viola!!!!!
In response to LordAndrew
chck my last reply
In response to Thedeadwarrior123
the only problem is i dont know how to program that.
In response to Thedeadwarrior123
Best response
A procedure to do this wouldn't especially be helpful, since you still need to store somewhere in a variable how many times you've died. Of course, modifying my previous snippet to count deaths, rather than lives, is rather easy.

#define MAX_DEATHS = 20

mob/player
var turf/last_save_point
var deaths = 0

OnDeath(mob/killer)
world << "[killer] has killed [src]!"

++deaths

if (deaths >= MAX_DEATHS)
GameOver()

else
loc = last_save_point
In response to LordAndrew
EUREKA!!! It works. Now i just have to make spawn points for players and mob/enemies?
In response to Thedeadwarrior123
Yep.
Actually, for static screens such as game over, an object on the map might work a bit more efficiently than client.screen objects.
In response to LordAndrew
wait wait for some odd reason it says: 12: error: missing left hand argument to =. What does that mean???
In response to Thedeadwarrior123
Whoops! I messed up the #define. It should just be:

#define MAX_DEATHS 20


Without the = sign.
In response to Solomn Architect
how exavtly would i do that?
that just gives me a warning saying: operation has no effect here.
In response to LordAndrew
it seemed to work with = now it says killer is undefined var and ondeath and gameover are unidentified procs
In response to Thedeadwarrior123
For the most part my snippets are just examples, so copy and pasting them probably isn't for the best. You'd have to define OnDeath() and GameOver() yourself. As for the error with killer being undefined, I'm not entirely sure why that'd be cropping up (are you forgetting to specify it in the procedure's arguments?).

#define MAX_DEATHS 20

// Since both players and enemies can die, they'll both need this.
mob/proc/OnDeath(mob/killer)

mob/player
var turf/last_save_point
var deaths = 0

// I suspect enemies cannot game over like players do, so you'd want to just give this to the player class.
proc/GameOver()
src << "YOU LOST THE GAME."

OnDeath(mob/killer)
world << "[killer] has killed [src]!"

// As per Galactic Soldier's suggestion.
if (++deaths >= MAX_DEATHS)
GameOver()

else
loc = last_save_point
In response to LordAndrew
Geez, Andrew! Hand out false information to everyone, why don't you! Lol.

Back on topic, make sure the variables and procs you're trying to access are available in the particular scope you're working in.
In response to LordAndrew
This seems to work, Thanks.
Page: 1 2 3