ID:1287446
 
(See the best response by Pirion.)
Code:
        green_ooze
base_state = "green-ooze"
icon_state = "green-ooze-standing"
shadow_state = "ooze-shadow"

power = 4
speed = 5
defense = 5

health = 40
max_health = 40

base_speed = 1

abilities = list(new /Ability/EnemyAttack(), new /Ability/EnemyPoisonAttack())

New()
..()
money = rand(3, 12)
experience = 10

// we override the died proc to give enemies a chance to drop items
died()

noise('splat.wav', frequency = 0.6)
spawn(50)
respawn()


if(prob(30))
new /item/weak_health_potion(src)
if(prob(25))
new /item/weak_mana_potion(src)

if(prob(25))
new /item/sword(src)

..()


Problem description:
Hey, I am new here to BYOND and ran into a small problem with re-spawning enemies. They die, and they do indeed re-spawn but not where they died nor where they were placed on the map file. The enemies seem to re-spawn where the players re-spawn at. I am using Action-RPG-FrameWork. Any help would be greatly appreciated.


Best regards -
George
You should override respawned() for enemies to move them to their initial location.

They're respawning where the players do because that's what it says they should do.
Could you explain a bit further? Or give an example of what you mean by override respawned()?



Best regards -
George
In response to HavenDev
HavenDev wrote:
Could you explain a bit further? Or give an example of what you mean by override respawned()?



Best regards -
George
George by override he means re code the respawning system show us the respawn coding.
sure thing. Although I am not quite sure this is it? It might be.. I am still learning this so pardon, if it isn't.


The code below is for when the player dies/gets re-spawned
    died()
..()


if(client)
src << "You died! You'll respawn in five seconds."

spawn(50)
respawn()

// after the player respawns, move them back to the starting location
respawned()
..()
loc = locate(17, 35, 1)



Best regards -
George

Best response
To override something, you add it to a child and change the behavior.

i.e.

mob
proc/respawn() //every mob without by default will go to 17/35/1
loc = locate(17, 35, 1)

monster
respawn() //overwrite here, and this only happens if it is a monster type.
loc = locate(inital(x),inital(y),initial(z))