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! |
|
coreyh2
Game Owner
NWN 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 |
|
Xira
Game Owner
NWN 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." |
|
Xira
Game Owner
NWN 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 |
|
JasonNH
Game Owner
NWN 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. |
|
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! |
|
coreyh2
Game Owner
NWN 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. |
|
nostrilhair
Game Owner
NWN 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. |
|
JasonNH
Game Owner
NWN 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. |
|
Inder
Game Owner
NWN 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. |
|
NeoAeZ
Game Owner
NWN 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 |
|
BrianMeyer
Game Owner
NWN 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 |
|
mattaus
Game Owner
NWN 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! |
|
Caos81
Game Owner
NWN 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 |
|
JasonNH
Game Owner
NWN 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. |
|