[0.4] Hostile NPCs.

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
453
Reaction score
23
Location
México
Hello otlanders, i saw a interesting function; selfMoveTo.
so i was wondering if its possible to make roaming NPCs in dungeons like normal players hunting creatures.

so if you get close to him he will threat you with some warnings like "leave" or "dont get closer"

if you dont leave or get close enough to him, he will attack you (i think there is already a function to this)

NPC must be killable (i cant not find a way. some post says it need source edit)

well i think this can be done on Lua TFS 0.4
 

Xikini

I whore myself out for likes
Joined
Nov 17, 2010
Messages
3,928
Reaction score
2,048
If you don't want to source edit, I'd do this one of two ways.

Don't make the creature an NPC, instead make it a monster.
or
When the NPC needs to start attacking, remove the npc, and spawn a monster in it's place.
Add a few triggers to check when the monster should stop attacking, then remove the monster and spawn the npc.

First way is easier.
Second way is better if you don't want the player to see the battle sign until the creature need to attack the player, but it's harder to accomplish.
 
OP
elnelson

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
453
Reaction score
23
Location
México
If you don't want to source edit, I'd do this one of two ways.

Don't make the creature an NPC, instead make it a monster.
or
When the NPC needs to start attacking, remove the npc, and spawn a monster in it's place.
Add a few triggers to check when the monster should stop attacking, then remove the monster and spawn the npc.

First way is easier.
Second way is better if you don't want the player to see the battle sign until the creature need to attack the player, but it's harder to accomplish.
i guess i will need source edit to acomplish that, i want to create a more complex enemy u.u
 
Top