Aller au contenu

Photo

You cannot rest while enemies are nearby


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

#26
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

So, Lance... I'm a bit confused. 

 

Can the party rest because the monsters are actually non-hostile, or because tracking is off? 

 

Let me be more specific: Are there hostile monsters nearby, but the party can actually rest because tracking is off? If this is true, that's a great find. 



#27
Tchos

Tchos
  • Members
  • 5 042 messages

In brief, the answer is no.  Lance's additions here are to take into account that characters who can track should see the hostile creatures on the minimap, and he's saying that this will not happen if the creatures have all been set to neutral.  Therefore, he has added code that will make the creatures hostile again if the character toggles on the tracking ability, and make them neutral if the tracking ability is toggled off.



#28
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

So, Lance... I'm a bit confused. 
 
Can the party rest because the monsters are actually non-hostile, or because tracking is off? 
 
Let me be more specific: Are there hostile monsters nearby, but the party can actually rest because tracking is off? If this is true, that's a great find.


Hi ColorsFade,

"Can the party rest because the monsters are actually non-hostile, or because tracking is off?"

When the tracking is off (and the monsters have not yet seen the party), then they are non-hostile.

"Are there hostile monsters nearby, but the party can actually rest because tracking is off? "

The monsters nearby are hostile (at build time), but get set to "MONSTER", which is a temporary faction that does NOT prevent resting. They turn HOSTILE when tracking is ON. Therefore, the answer to this is (in some ways), yes. :)

The bottom line is, the party CAN rest, because whenever they go to do so the nearby monsters (NOT YET SEEN) currently have a non-hostile faction. NOTE: As soon as the party sees the monsters, they go HOSTILE (if that is what they are meant to do). At that point, the party *have* to deal with the monsters before they can rest again.

As Tchos points out, this system would have been a problem *if* I had been unable to switch the system to take account of somebody who uses tracking. Because, when somebody uses tracking, they have a chance of detecting HOSTILES. Therefore, whenever the player toggles the TRACKING button on, I needed to make sure nearby creatures went HOSTILE (if they were meant to do so), so that they could be detected. As soon as they finished their TRACKING, the monsters reverted to the NON_HOSTILE state to allow RESTING again.

As I stress, however, *IF* the monsters see the party before they party rest, then the monsters will remain HOSTILE and prevent the party from resting until they have been eliminated.

I do believe, however, this should suit your needs exactly! (Unless you can see any problems I may have missed?)
 
Cheers,
Lance.
 

In brief, the answer is no.  Lance's additions here are to take into account that characters who can track should see the hostile creatures on the minimap, and he's saying that this will not happen if the creatures have all been set to neutral.  Therefore, he has added code that will make the creatures hostile again if the character toggles on the tracking ability, and make them neutral if the tracking ability is toggled off.


Correct! :)


  • BartjeD aime ceci

#29
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Okay, so the real deal here is the same as always: the only way to rest with monsters close by is if the monsters are non-hostile to the PC, which means they either have to start non-hostile, or we have to perform a faction change (or script hiding them). Right now I believe I'm script hiding them when the PC enters a safe room... 

 

I do like the idea of turning them hostile when perception fires. I had not thought of that. 

 

Question: Do monsters in closed rooms perceive the party before the door to that room opens? Because if they do not... that solves a huge problem. Normally I spawn creatures inside rooms as non-hostile, and then I have a script on the door that flips the creature to hostile when the door is opened. But if I can handle this with a perception script on the creature, that's way better... No more having to put additional scripts on doors. 

 

Lots of food for thought here. 

 

One thing I can see being an issue, with the way my dungeons are setup at least, is that if a monster perceives the party and switches to hostile, he may run and attack the nearest creature of the MONSTER faction instead, right? But I believe the correct way to handle that is to make the MONSTER faction friendly to the enemy faction... So they'd be on the same team, just one would be hostile to the PC and the other faction would not. So problem solved. 

 

The only downside to this whole thing is that the creatures have to be spawned as non-hostile. I do that sometimes, for cut-scenes and stuff, but I'm not sure how I feel about non-hostile creatures running around the dungeon. If the user is in 3rd person mode and sees the creature in the distance as non-hostile, the player might be taken aback by the creature turning hostile. They might think, "Oh, it's a non-hostile, I can go talk to it or something". How the player interprets this is my only issue with this solution. 

 

I may just have to code and try it, see how it feels when the creatures switch to hostile on perception. If it plays well... no problem. 



#30
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Okay, so the real deal here is the same as always: the only way to rest with monsters close by is if the monsters are non-hostile to the PC, which means they either have to start non-hostile, or we have to perform a faction change (or script hiding them). Right now I believe I'm script hiding them when the PC enters a safe room...


I start mine as HOSTILE and then change them to MONSTER (my own faction) when spawned, keeping track of which have changed.
 

I do like the idea of turning them hostile when perception fires. I had not thought of that.


It has its own difficulties that I am currently resolving ... mainly to do with PCs being invisible. It's fine of the PC is not invisible, but I like to cater for all circumstances.
 

Question: Do monsters in closed rooms perceive the party before the door to that room opens? Because if they do not... that solves a huge problem. Normally I spawn creatures inside rooms as non-hostile, and then I have a script on the door that flips the creature to hostile when the door is opened. But if I can handle this with a perception script on the creature, that's way better... No more having to put additional scripts on doors.


It depends on the monsters settings and ability to perceive either by sight or sound. Going by door opening (in your current situation) is the safest way to go. E.g. What would happen if an invisible PC opened the door and the monster does not perceive them?
 

Lots of food for thought here.


And there's more ...
 

One thing I can see being an issue, with the way my dungeons are setup at least, is that if a monster perceives the party and switches to hostile, he may run and attack the nearest creature of the MONSTER faction instead, right? But I believe the correct way to handle that is to make the MONSTER faction friendly to the enemy faction... So they'd be on the same team, just one would be hostile to the PC and the other faction would not. So problem solved.


As you say, you answered your own point here. :)
 

The only downside to this whole thing is that the creatures have to be spawned as non-hostile. I do that sometimes, for cut-scenes and stuff, but I'm not sure how I feel about non-hostile creatures running around the dungeon. If the user is in 3rd person mode and sees the creature in the distance as non-hostile, the player might be taken aback by the creature turning hostile. They might think, "Oh, it's a non-hostile, I can go talk to it or something". How the player interprets this is my only issue with this solution.


I am working in reverse to this logic, in that while everything does spawn HOSTILE, I change anything the party cannot see into MONSTER that does not prevent resting. I don't think I have any situations where a player could see a monster in another part of the dungeon and have that problem. Maybe redesigning your layout might help ... i.e. Don't allow players to see monsters before they should ... In my situation, by the time the party see a monster it has gone permanently HOSTILE.
 

I may just have to code and try it, see how it feels when the creatures switch to hostile on perception. If it plays well... no problem.


I don't think it matters too much whether you go ScriptHidden or Faction Changing method. The one thing I think you do need to consider though, is the same thing I had about TRACKING ... i.e. When the player makes their PC do TRACKING, they should be able to detect (if they have the ability) the HOSTILE creatures. Therefore, whichever method you use, you need to make sure the creatures can be detected. In my case, I switch the HOSTILE back if the player turns off TRACKING and the monsters have not yet been actually seen.

Cheers,
Lance.

#31
Dann-J

Dann-J
  • Members
  • 3 161 messages

It's good that you've allowed tracking to continue to function - but what about the Detect Undead spell? :P



#32
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

It's good that you've allowed tracking to continue to function - but what about the Detect Undead spell? :P


Hi Dann-J,

I must admit that I "assumed" that it works by detecting "undead" race rather than anything to do with factions .. However, you make a good point, especially if others are trying to circumvent the "resting" rule using ScriptHidden, as that would need extra code than the simple faction change method.

Cheers,
Lance.