Npc Sleeping state question

Discussion in 'General Modification' started by anatoliy, Apr 18, 2020.

Remove all ads!
  1. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    While trying to setup a room with sleeping goblins I've encountered issue - currently there is no way to set a NPC into Sleep mode.

    One could say - wait, how about "sleep" condition, or even same name npc flag?

    Well, it simply does not work. Looks like Troika forgot to implement it.

    Existing sleep condition is specifically designed to work with Sleep spell, has round counter as first parameter, and does not fall prone when toggled.

    I decided to create new condition - Napping, which falls prone subject, grants unconscious and prone effects, plus Listen each round if PC did some noisy activity in vicinity.

    One open question I wanted to ask you guys - ruling of opposite Move Silently check.

    If PC is in Sneaking mode, then it's simple - do the skill roll, plus distance /10ft modifier.

    But what if PC is not specifically Moving Silently? Should it take 10 instead of dice 20 roll, or even take 0?
     
  2. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Guys on FB D&D 3.5 group helped me figure this out - DC should be "take 0".
     
  3. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    marc1967 likes this.
  4. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    In Pathfinder 1e, being asleep confers a -10 penalty to perception checks for sleeping characters. 3.5 doesn't specifically state any penalty to listen for being asleep.
     
    anatoliy likes this.
  5. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    706
    Likes Received:
    112
    In regards to the first posting, about the sleep condition.

    Can you apply a spell condition with a duration directly from a script, without actually casting a spell or drinking a potion or using a magic item in the inventory?

    For example, could you have a magical archway which made each PC that walked under it have the effect of the Confusion spell for 10 minutes?

    Or maybe during a dialog with an NPC, the PC becomes blessed for 24 hours.

    I've seen this done with instantaneous effects like healing and damage, but nothing that lingers on for a specific duration.
     
  6. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    Short answer - yes, it could be done.

    Long answer has aspects:
    1. When a script which should check circumstances of PC passing through an archway should be triggered?
    2. How to cast a spell in a script?

    Arcanum engine had "tile scripts", but toee had removed them. So I would create invisible npc, which on heartbeat event would check distance / coordinates to decide if npc indeed passed through an archway.

    Such method is not ideal, as the code cannot determine previous pc coordinates, except storing them somewhere.

    Another way would be to have custom condition, which should be applied on pc permanently. Such condition would hook on heartbeat or other more complicated event, and would check for coordinates passed through.

    Ideally toee engine should have sort of "proximity mines" where a designer could specify circumstances and script, which should trigger. But this is open question to @Sitra Achara.

    Second part is - how to cast a spell?
    Subqestion is should you even use spell? Perhaps applying effect would suffice?

    Casting a spell is big process in toee. It requires lots of prerequisite checks, animations and only then effect implemented via spell condition.

    There are two ways to cast a spell: pc.use_item with potion, or pc.cast_spell domain special. Both methods added by me recently.

    For example one zombie in an Encounter uses Desecrate potion on combat start. The Book said that room had permanent effect so I did such workaround.

    You would also want a spell if PC supposed to have possibility to remove unwanted spell effect.

    Another approach would be to create new condition, which would add similar to spell effect.
     
  7. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    706
    Likes Received:
    112
    Thanks for the response. It's the second part I was mostly concerned with.

    It seems there is not a way to do this within the confines of the original game, without using Temple Plus hooks.
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Actually, there's a condition called Sleeping which is different than sp-Sleep. Have you tried it?
     
  9. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    No.

    But does it have sleep checks?
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Ah sorry, I got the two of you mixed up - this was in reply to marc's question. The point is that there's a handful of conditions with countdowns that are not related to spells, one of those is Sleeping.
     
    anatoliy likes this.
  11. anatoliy

    anatoliy Established Member

    Joined:
    Feb 18, 2017
    Messages:
    635
    Likes Received:
    201
    @Sitra Achara, say you want to create difficult terrain. How would you do it?
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Divinity: Original Sin or bust :mad:

    But seriously, it depends on what the exact design goals are, like should it be dynamic (e.g. modified by spells) or static (baked into map tile data I guess).
     
  13. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    706
    Likes Received:
    112
    Sleeping seems to be functionally identical to Paralyzed, with one exception. The duration for Sleeping is set in the 2rd argument, where Paralyzed sets in the first argument for. So...

    obj.condition_add_with_args ('Sleeping', 0, 600)
    obj.condition_add_with_args ('Paralyzed', 600, 0)

    Maybe that means the first argument for Sleeping does something. :confused:

    Anyway, so they both make it so the object can't attack or cast spells. They can, though, still move, talk, use items, craft, examine, etc.
     
  14. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Hmm ok. So I guess if you want to tough it out without Temple+, there could be a way... what if on map load, you had a dummy npc cast a spell on a spell object, and then as soon as you wanted to apply the effect, you popped it in his inventory?

    To be precise you'd have to edit some utility spell to do your bidding and condition_add to the spell object on the spell effect event.

    Note that you'd have to be careful not to end up with a bunch of unterminated spells, which can clog up the game (e.g. KotB had this with the search tool).
     
  15. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    Thanks Marc :) Always wanted the Guards in KotB to actually go to sleep at night so you can properly sneak by them.
     
Our Host!