How to kill an NPC in LUA

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
Parcae2
Uruivellas
Posts: 709
Joined: Sat Jan 14, 2012 12:02 am

How to kill an NPC in LUA

#1 Post by Parcae2 »

So I have the infamous clone bug in the Sher'Tul Fortress, and this means I can't access my stash. I teleported out with the change level command, but I'd like to be able to come back. Can anyone tell me how to use LUA or debug mode to kill my clone?

Edit: I'd like to thank Donkatsu for this suggestion.

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: How to kill an NPC in LUA

#2 Post by edge2054 »

cnt+shift+alt + left click will kill an actor I believe.

To do it with the console you need to find the actor's x, y coordinates (they're displayed on the tooltip in debug mode) and then you do...

Code: Select all

target = game.level.map(x, y, Map.ACTOR)
substitute the x, y for the actual numbers (15, 4 for example) and then type

Code: Select all

target:die(target)

Code: Select all

target = nil
I think anyway, just working off the top of my head.

Parcae2
Uruivellas
Posts: 709
Joined: Sat Jan 14, 2012 12:02 am

Re: How to kill an NPC in LUA

#3 Post by Parcae2 »

Thanks! Sadly, before seeing your response I had worked out an in-game way to kill the clone, which broke the game in new and exciting ways (see also: the bugs forum).

I'm primarily just amused at this point.

Post Reply