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

NWN2: Builders - NWN2 Scripting

Nuova discussione    Invia risposta

Go to Page ( 1 , 2 Avanti )

    Aggiungi a Le mie discussioni

   Vai alla fine

Autore New Information for OnEnter
Rob McGinnis
Assistant Producer


Registrato il: 02 nov 2006
Inviato: lunedì, 05 gennaio 2009 11:40
So, a quick update on the OnEnter problem.

The way OnEnter works is that it fires off before the client is fully loaded into the game. This means that when you call the OnEnter function to fire off a conversation or other script, such as giving an item to a character, it may seem like the scripts/conversation is not working, when in fact it is. It is just happening BEFORE the client enters the game fully.

We will not be changing this behavior because there are benefits to this, but we are looking for ways to make it so modders do not need to change their mods.

Moving forward, we suggest you use OnClientEnter as it should handle these things properly.
_________________
Don't let your life be about the donuts!
  Profilo: Rob McGinnis   Invia messaggio a: Rob McGinnis
coreyh2
Game Owner
Profilo: coreyh2NWN
NWN: SoU
NWN: HotU
SW: KotOR PC
Jade Empire
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Registrato il: 04 gen 2006
Da: WA
Inviato: martedì, 06 gennaio 2009 04:45
I was used to the nwn1 OnEnter and when I read the description of OnClientEnter it sounded like it was to be used for PC and not creatures. But I thought OnEnter would still trigger for PCs? I don't understand why OnEnter would run before whatever triggered it entered. How is that useful? Shouldn't it be renamed PreOnEnter? I'd imagine I used OnExit of whatever area the PC was in already instead.

Can creatures walk between areas in NWN2 anyway? I thought that was broken?
_________________
Deadening 2
  Profilo: coreyh2   Invia messaggio a: coreyh2
Xira
Game Owner
Profilo: XiraNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
Mass Effect PC


Registrato il: 16 giu 2002
Inviato: martedì, 06 gennaio 2009 05:39
Translation "We $#*@ed up and made SOZ reliant on our new version of on-enter, unfortunately we broke everything else in TEH WHOLE WORLD but since SOZ is our cash cow, we aren't fixing our sloppy."
  Profilo: Xira   Invia messaggio a: Xira
Xira
Game Owner
Profilo: XiraNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
Mass Effect PC


Registrato il: 16 giu 2002
Inviato: martedì, 06 gennaio 2009 05:47
Quote: Posted 01/06/09 04:45 (GMT) by coreyh2

I was used to the nwn1 OnEnter and when I read the description of OnClientEnter it sounded like it was to be used for PC and not creatures. But I thought OnEnter would still trigger for PCs? I don't understand why OnEnter would run before whatever triggered it entered. How is that useful? Shouldn't it be renamed PreOnEnter? I'd imagine I used OnExit of whatever area the PC was in already instead.

Can creatures walk between areas in NWN2 anyway? I thought that was broken?
My guess is that something loads before the creature enters the game, such as the creature's size, and then is changed a split second later by the old On-Enter. My guess is that in order to make the world map work( I worked on a project with a VERY SIMILAR SYSTEM and this was a problem we encountered trying to do what they did )without giant creatures suddenly being scaled down and thus 'poping' in and out, they had to adjust their regular on-enter.

It would have been more useful of them to adjust on-client-enter to be the new pre-on-enter-for-all-things because nobody really ever uses it, unfortunately they probably had all the scripts written when they figured out the real cause, and this was the most easiest way to fix the problem.

This is a diplomatic version of my prior post:D
  Profilo: Xira   Invia messaggio a: Xira
JasonNH
Game Owner
Profilo: JasonNHNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Registrato il: 24 gen 2007
Da: New Hampshire
Inviato: martedì, 06 gennaio 2009 03:04
Thanks Rob, it's always nice to receive specific details about the game play mechanics. Good luck on your workarounds.
  Profilo: JasonNH   Invia messaggio a: JasonNH
Rob McGinnis
Assistant Producer


Registrato il: 02 nov 2006
Inviato: martedì, 06 gennaio 2009 05:34
Quote: Posted 01/06/09 05:39 (GMT) by Xira

Translation "We $#*@ed up and made SOZ reliant on our new version of on-enter, unfortunately we broke everything else in TEH WHOLE WORLD but since SOZ is our cash cow, we aren't fixing our sloppy."

Real Translation: OnEnter always worked that way and that is why many things seemed to not work from time to time. OnClientEnter was created because OnEnter was unreliable.
_________________
Don't let your life be about the donuts!
  Profilo: Rob McGinnis   Invia messaggio a: Rob McGinnis
coreyh2
Game Owner
Profilo: coreyh2NWN
NWN: SoU
NWN: HotU
SW: KotOR PC
Jade Empire
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Registrato il: 04 gen 2006
Da: WA
Inviato: martedì, 06 gennaio 2009 09:37
If it was possible to fix it with OnClientEnter why not fix OnEnter? If OnEnter is unreliable why wasn't it removed? What is it for?

Some documented correct usage would be helpful.
  Profilo: coreyh2   Invia messaggio a: coreyh2
nostrilhair
Game Owner
Profilo: nostrilhairNWN
NWN: SoU
NWN: HotU


Registrato il: 12 ago 2005
Inviato: martedì, 06 gennaio 2009 10:54
My understanding is that on enter fires whenever an object enters the area, on client enter fires when the area has finished loading.

I dont think anything was fixed for on client enter - was it ever broken? Seems to me (from what Rob said) that this event is the event that was always intended to be used for starting conversations etc. I think many modders probably just got into the habit of using the wrong event - on enter.

I remember playing around with starting cutscenes by jumping pcs into speaktriggers or using the on enter event and sometimes they did fail and this was back with 1.12.

Its unfortunate that mods that previously worked dont anymore and perhaps I havent been following all this very closely and am missing something. However if modders just have to move their on enter scripts to on client enter then surely thats not too much drama. I guess if you have a huge mod then its a pain but I'd imagine there would be very little script rewrites, just a few mouse clicks for each area you have.
  Profilo: nostrilhair   Invia messaggio a: nostrilhair
JasonNH
Game Owner
Profilo: JasonNHNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Registrato il: 24 gen 2007
Da: New Hampshire
Inviato: mercoledì, 07 gennaio 2009 12:55
Quote: Posted 01/06/09 22:54 (GMT) by nostrilhair

My understanding is that on enter fires whenever an object enters the area, on client enter fires when the area has finished loading.

Mine too, which is why I have been using OnClientEnter for a long time.

Quote: I dont think anything was fixed for on client enter - was it ever broken? Seems to me (from what Rob said) that this event is the event that was always intended to be used for starting conversations etc. I think many modders probably just got into the habit of using the wrong event - on enter.

Bingo. IMHO, this problem is rooted more in a lack of documentation of game mechanics as it relates to scripting than it is to the changes in SoZ.

Quote: I remember playing around with starting cutscenes by jumping pcs into speaktriggers or using the on enter event and sometimes they did fail and this was back with 1.12.

Same here. Good post.
  Profilo: JasonNH   Invia messaggio a: JasonNH
Inder
Game Owner
Profilo: InderNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Registrato il: 26 set 2003
Inviato: mercoledì, 07 gennaio 2009 03:02
I was always under the impression that OnClientEnter should be used insted of OnEnter. Thinking back, I can't recall where I got this notion. Maybe it was just that I saw that Obsidian uses OnClientEnter for all their PC-On Enter related scripts and I took a page from their book.

Regardless, I definitely feel for those people that have to go back and rework their mods to be compliant with this new way of doing things. At least it will be easy, if not tedious, work.
  Profilo: Inder   Invia messaggio a: Inder
NeoAeZ
Game Owner
Profilo: NeoAeZNWN
NWN: SoU
NWN: HotU
SW: KotOR Xbox
NWN 2
NWN 2: MotB
NWN 2: SoZ


Registrato il: 10 giu 2002
Inviato: mercoledì, 07 gennaio 2009 03:41
Just for clarification:
Does this issue relate only to the module OnEnter/OnClientEnter events?

Or does this impact the trigger, area and other OnEnter events?

Thanks.
_________________
Jeremy "neoaez" Collins
  Profilo: NeoAeZ   Invia messaggio a: NeoAeZ
BrianMeyer
Game Owner
Profilo: BrianMeyerNWN 2
NWN 2: MotB


Registrato il: 17 giu 2003
Inviato: mercoledì, 07 gennaio 2009 07:58
There is a function which allows you to set the scripts on the fly for objects, i've used it for doors, if this was run on the module load event, you could fix it globally. A Toolset plugin would be nice too that could change all the properties on areas globabally somehow. ( or just move the script from one event script to the other. ) I have 60 areas and i don't see opening up all of them as that big of a deal, probably fix someother things like areas set to be exterior/interior or the like when they are not supposed to be.

As for a use, you could turn off the ai in area when no one is in area, or make sure nothing is where the player is porting in to via moving creatures out of the way.

Then you can use oncliententer when the pc finished loading.

I see it as something that is not completely clear but i see it as useful.
_________________
DungeonEternal PVP PW | Joining a PW
  Profilo: BrianMeyer   Invia messaggio a: BrianMeyer
mattaus
Game Owner
Profilo: mattausNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Registrato il: 06 apr 2007
Da: Great Britain
Inviato: mercoledì, 07 gennaio 2009 12:25
Thanks Rob - its nice to get feedback from the producers - something that escapes most other game producers!
  Profilo: mattaus   Invia messaggio a: mattaus
Caos81
Game Owner
Profilo: Caos81NWN 2
NWN 2: MotB
NWN 2: SoZ


Registrato il: 05 nov 2006
Da: Milan, Italy
Inviato: mercoledì, 07 gennaio 2009 02:00
Quote: Posted 01/06/09 17:34 (GMT) by Rob McGinnis
Real Translation: OnEnter always worked that way and that is why many things seemed to not work from time to time. OnClientEnter was created because OnEnter was unreliable.

OnClientEnter can't fit the purpose since it doesn't properly fire whenever the PC has a familiar or animal companion or (untested) summoned creature with him.

I figured that OnCLientEnter only fire once whenever the PC enters the area but if you have a summoned creature with you it fires over the summoned creature instead of the PC himself.
_________________
DM Client Extension for NwN2- Inventory & Variables Manager
xSoH System - Sleight of Hand System
  Profilo: Caos81   Invia messaggio a: Caos81
JasonNH
Game Owner
Profilo: JasonNHNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Registrato il: 24 gen 2007
Da: New Hampshire
Inviato: mercoledì, 07 gennaio 2009 03:55
Quote: Posted 01/07/09 14:00 (GMT) by Caos81
I figured that OnCLientEnter only fire once whenever the PC enters the area but if you have a summoned creature with you it fires over the summoned creature instead of the PC himself.

Yes it only fires once, and yes the animal companion will be the first entering object, but you can test this with GetIsPC() and if it is not a PC you can then use GetFirstEnteringPC() / GetNextEnteringPC(). IOW, I don't see any problems being able to do what you need to do with the way OnClientEnter works, but perhaps there is an application I am not thinking of.
  Profilo: JasonNH   Invia messaggio a: JasonNH

Go to Page ( 1 , 2 Avanti )

Nuova discussione    Invia risposta

Cosa significano queste icone?
Come posso imparare a usare i forum?

Jump To:

Ricerca nei forum | FAQ sui forum | Archivi dei forum

 

 

  Visit the Official Site | Technical Support
Neverwinter Nights 2 Official Support
Mostra/nascondi

English
Deutsch
Français
Español
Italiano

Mostra/nascondi

6,232,679 Users
143 Online
12 collegati

9,045,360 messaggi nei forum

Nuove discussioni:
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)


L'ora attuale è: (imposta ora)
gio, 29 luglio 2010 11:18