Games Support Forums BioWare Info My Account Login Community Sign Up Store
Neverwinter Nights 2 Forums

NWN2: Builders - NWN2 Scripting

New Topic    Post Reply

Go to Page ( 1 , 2 Next )

    Add this To My Topics

   Go To Bottom

Author Question about NPC Heartbeats.
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Thursday, 07 December 2006 05:46AM
In NWN1 NPC heartbeats would still fire (albeit with less frequency) if no players were in the current area. In NWN2 I am noticing (I think) that NPCs do not fire heartbeats at all when a PC isn't in the area. What can I do to force an NPC to have a heartbeat always?
  Profile: Juason   Send Message To: Juason
Abby_
Game Owner
Profile: Abby_NWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 08 Apr 2003
Posted: Thursday, 07 December 2006 05:54AM
Don't quote me, but think there is an option in either the creature properties or area properties that is something to the effect of "suspend if no players in area"

EDIT:

Is on the creature properties, it's called "Disable AI while hidden". Try setting that to false and see if that works.
_________________
Bastions of War Team PvP Arena Server
Bastions of War 2 Part Two (Beta)

Edited By Abby_ on 12/07/06 05:56

  Profile: Abby_   Send Message To: Abby_
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Thursday, 07 December 2006 05:59AM
Oh I see. "Hidden", meaning not in the current area. Gotchya Man, some of this stuff would have been SO easy to include in the Worldbuilder guide this time around. But no.. we had to get lame interviews instead :sigh:

Thank you for the help.
  Profile: Juason   Send Message To: Juason
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Thursday, 07 December 2006 06:15AM
Actually, maybe I spoke too soon. Changing that to FALSE didn't seem to fix the lack of heartbeats upon area transitioning. Has anyone tested this in game yet?

I basically have an NPC leave the area using the TravelToObject function, and have SendMessageToPC(GetFirstPC(), "Beep..") embedded in the heartbeat function.

While in the same area I see Beeps, once they go out that door the beeps stop and the NPC stands on the other side doing nothing until I walk through.
  Profile: Juason   Send Message To: Juason
Abby_
Game Owner
Profile: Abby_NWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 08 Apr 2003
Posted: Thursday, 07 December 2006 06:26AM
hrm... sorry, I don't know then. That was my best guess.
_________________
Bastions of War Team PvP Arena Server
Bastions of War 2 Part Two (Beta)
  Profile: Abby_   Send Message To: Abby_
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Thursday, 07 December 2006 06:29AM
Oh no problem... I'm just concerned that the developers have some other, hidden, undocumented way of doing this... It has to be possible though.

I can't see why a developer would come post telling me to use a function to have an NPC area transition to another area, or to use a broken switch to allow WalkWayPoints to work across areas, if NPCs cannot actually function in other areas
  Profile: Juason   Send Message To: Juason
Abby_
Game Owner
Profile: Abby_NWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 08 Apr 2003
Posted: Thursday, 07 December 2006 12:45PM
I think the way points to walk to another area are suppose to be used for stuff like having a NPC "Exit stage left"....

like "Yea, thanks for unlocking my door, here is your quest XP... I must go in and sleep now [exits area]"
_________________
Bastions of War Team PvP Arena Server
Bastions of War 2 Part Two (Beta)
  Profile: Abby_   Send Message To: Abby_
ScarfaceDM
Game Owner
Profile: ScarfaceDMNWN
NWN: SoU
NWN: HotU
NWN 2


Joined: 07 Oct 2006
From: From England, Living in Sweden.
Posted: Thursday, 07 December 2006 12:58PM
Simple fix, instead of a normal heartbeat from the heartbeat event, use a pseudo heartbeat from the creature and initialize it OnSpawn for example:

Code:

View Post/Code in separate window



Problem solved.
_________________
Chaotic World Final
NWVault Hall Of Fame Rank #3

Edited By ScarfaceDM on 12/07/06 12:59

  Profile: ScarfaceDM   Send Message To: ScarfaceDM
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Thursday, 07 December 2006 03:18PM
That just might work. Thank you. But you'd think a way would exist to make NPCs fire heartbeats when no PCs are around.. you know just like NWN1?
  Profile: Juason   Send Message To: Juason
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Thursday, 07 December 2006 04:00PM
People had talked about script-firing issues in other threads, particularly with Door-close scripts not firing when PCs weren't present. Was that script based on an area heartbeat that also gets turned off when no PCs are around by chance?
  Profile: Juason   Send Message To: Juason
ScarfaceDM
Game Owner
Profile: ScarfaceDMNWN
NWN: SoU
NWN: HotU
NWN 2


Joined: 07 Oct 2006
From: From England, Living in Sweden.
Posted: Thursday, 07 December 2006 04:50PM
you mean the script I just posted? It's just a pseudo function that re-runs itself every x amount of time regardless of whos around, it should work with no probs at all, as for door close scripts not firing, I wouldn't use the heartbeat event to close a doro anyway, id have a delayed close in the OnOpen event of the door.
_________________
Chaotic World Final
NWVault Hall Of Fame Rank #3
  Profile: ScarfaceDM   Send Message To: ScarfaceDM
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Thursday, 07 December 2006 05:02PM
Oh I wasn't referring to your script Scarface - I think someone already posted it worked perfectly

I was just curious if Area Heartbeats also stop working as soon as a PC leaves the area. Moreso for my own edification than anything.
  Profile: Juason   Send Message To: Juason
fluffyamoeba
Game Owner
Profile: fluffyamoebaNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
Jade Empire
Jade Empire:SE
NWN 2


Joined: 01 Mar 2004
From: a test tube
Posted: Thursday, 07 December 2006 11:51PM
Are you using a custom HB function or have you put your PC messaging code at the end of nw_c2_default1 ?

If you are doing the second, then that's your problem. This returns out of the script if there are no PCs in the area:

NWScript:

View Post/Code in separate window



You would be better using either the new spawn script variable (look in nw_c2_default7) or a user defined event.
_________________
Why do anything when you can forget everything?

Edited By fluffyamoeba on 12/08/06 00:08

  Profile: fluffyamoeba   Send Message To: fluffyamoeba
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Friday, 08 December 2006 03:52AM
I was/am using the new SpawnScript variable already

I'm finding no heartbeat fires at all, regardless of what it should be doing, once an NPC leaves the current area.
  Profile: Juason   Send Message To: Juason
Juason
Game Owner
Profile: JuasonNWN
NWN 2


Joined: 24 Jun 2002
Posted: Friday, 08 December 2006 04:00AM
Quote: 

If you are doing the second, then that's your problem. This returns out of the script if there are no PCs in the area:

Ok I see that now, why does that return if no PCs are in the area? Does the AI level automatically go to Low when no PCs are around?
  Profile: Juason   Send Message To: Juason

Go to Page ( 1 , 2 Next )

New Topic    Post Reply

What do these icons mean?
Where can I learn how to use the forums?

Jump To:

Search Forums | Forums FAQ | Forum Archives

 

 

  Visit the Official Site | Technical Support
Neverwinter Nights 2 Official Support
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

6,252,934 Users
125 Online
5 Logged In

9,046,615 posts in forums

Newest Forum Topics:
1. These forums are now closed (NWN 1: Scripting)

2. These forums are now closed (NWN2: Guilds and Registry)

3. These forums are now closed (BioWare News Discussion)

4. Can you level items? (NWN 1: Scripting)

5. Thank you! (NWN 1: Scripting)


Current time is: (set time)
Mon, 06 September 2010 08:28AM