Aller au contenu

Photo

Making NPCs go hostile


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
TesseractSpace

TesseractSpace
  • Members
  • 52 messages
I'm trying to work out the mechanics of what I want to be able to do, and sadly have yet to figure out the toolset.

I note that the stealing skill is able to target anyone regardless of their hostile/non-hostile status.  Is it possible to give that kind of targeting to a spell or item?

From there if that is possible, is there a way to use such an item to change an NPC to a hostile status so they can be targetted with attacks?  (a further refinement would be a version that only affects those who don't actually have dialog available.  Y'know, the ones who just pop up a phrase or two when clicked on, and another version that strips any protection flags from the npc so one could kill anyone.)

Yes, I do realize that killing quest givers and plot NPCs would break the game, but there are a couple I'd like to cut down.

 

#2
Bibdy

Bibdy
  • Members
  • 1 455 messages
This wiki page should be able to help you. You set the dialogue element to perform an Action using the script "gen00pt_generic_actions", set the flag to "GEN_OWNER_TURNS_HOSTILE", so the moment you hit that point in the dialogue, that character who 'owns' the conversation (the guy you're speaking with, usually) will go hostile to you.

You'll also need to find a way to disable certain flags like 'Plot', 'immortal' and such, to make sure they're actually killable.

#3
TesseractSpace

TesseractSpace
  • Members
  • 52 messages
But wouldn't that only work on NPCs one can have a dialogue with?

#4
TesseractSpace

TesseractSpace
  • Members
  • 52 messages

TesseractSpace wrote...

But wouldn't that only work on NPCs one can have a dialogue with?  I'm trying to find a way to work this on the ones that just spout off a random line too.



#5
Bibdy

Bibdy
  • Members
  • 1 455 messages
So you essentially want a targettable 'Murder button' like the way Stealing works? Sounds possible. You could go through the code of Stealing and see how it performs the targetting and gets the reference to the target, then when you have the target you change its variables to be killable, hostile to you, mortal etc.



You could maybe play an animation to lop their head off if you dig into how sync-kill animations work and use that code, too.

#6
TesseractSpace

TesseractSpace
  • Members
  • 52 messages
I'm starting to see. Now I just need to learn how to do this. I'm seeing the parts in the wiki that cover ability targeting, so now I just need to learn scripting and set up the effect I want, namely something that will conditionally make something killable.



Alrighty, so...

Ability that can target friendly creatures. (no need to bother with already hostile ones.)



Ability runs script:

Determine if they are plot protected. Either fail to act on plot protected npc or remove plot protected factor, depending on whether I want the ability to kill scenery NPCs or all NPCs.

Make them Hostile at which point the character can kill the NPC in whatever manner suits their fancy.



Ok, sounds like a plan, now to look at the relevant files...


#7
TesseractSpace

TesseractSpace
  • Members
  • 52 messages
Ok, so far I've made something that'll target friendly NPCs. Looks like walking bomb because that's the base I'm using to build it. Now I just need to figure out a script for it to run.