[WIPz] Putative NoM 3.0

Post » Sat May 28, 2011 9:48 am

Melian brings up a good point, and I'd like to get confirmation of something. Local variables ALWAYS have a default value of 0, but Melian reminded me that the construction set allows the modder to define a global variable's default value.

Does MPP actually set PCGender to 0 or does it simply allow it to remain there? Because if it sets the value at zero, we could simply add the global variable with a default value of 99 or something like that. Then, if the user has MPP or UMP installed, the save game will already have that variable stored as a 1 or 0 and will overwrite our 99 value. Then, if the PCGender is 0, we know it's SET there, because if it's unset, it'll still be 99.

It would still be a good idea for MPP to use a non-zero value for valid PCGender settings, but this would allow us to work around the problem - being compatible both with the existing MPP settings as well as any future modified ones. Like Melian, I think 1 and -1 would be a better choice than 1 and 2, although to be honest, I can't really explain why (except that opposite genders having opposite values has a certain appropriate artistic value). It just seems intuitively a better choice. Filtering on !=1 would render true on -1, 0, 2, or 99, with most of those values being invalid. Filtering on <0 will always render correctly without any false positives (no pun intended).

re: non-present globals

That's not possible. The construction set won't allow a script to compile if it references a global variable that isn't defined. The only way that NoM 3.0 could check the PCGender variable is if it ALSO defines it. However, since the save game will overwrite anything added by a mod, if PCGender is already defined by a previously existing mod, it's old value (in the save game) will overwrite the default value in a newly added mod.
User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Sat May 28, 2011 7:34 am

Tetchy, FYI - a dialogue mod is the *least* likely to check the gender variable, because it doesn't need to: dialogue is the only way gender can be checked without using a script extender, and the point of the var is to make that info available to scripts as well.

Toccatta - yep, it's actually set to 0, not just left there.

As an alternative to asking the player during config: If the default value is NOT a meaningful value, you could just add two idle or hello voice entries, filtered only for PCGender=default value (whatever that ends up being). Set it from the results and it's done.
User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Sat May 28, 2011 9:35 am

Melian brings up a good point, and I'd like to get confirmation of something. Local variables ALWAYS have a default value of 0, but Melian reminded me that the construction set allows the modder to define a global variable's default value.

Yep, the CS allows the modder to define the value - negative values included.

Does MPP actually set PCGender to 0 or does it simply allow it to remain there? Because if it sets the value at zero, we could simply add the global variable with a default value of 99 or something like that. Then, if the user has MPP or UMP installed, the save game will already have that variable stored as a 1 or 0 and will overwrite our 99 value. Then, if the PCGender is 0, we know it's SET there, because if it's unset, it'll still be 99.

MPP uses two dialogue greetings for chargen captain - the first is filtered for PC six = 1 (females) which sets PCGender to 1 in the script section; the second is not filtered for PC six, and sets PCGender to 0.

It would still be a good idea for MPP to use a non-zero value for valid PCGender settings, but this would allow us to work around the problem - being compatible both with the existing MPP settings as well as any future modified ones. Like Melian, I think 1 and -1 would be a better choice than 1 and 2, although to be honest, I can't really explain why (except that opposite genders having opposite values has a certain appropriate artistic value). It just seems intuitively a better choice. Filtering on !=1 would render true on -1, 0, 2, or 99, with most of those values being invalid. Filtering on <0 will always render correctly without any false positives (no pun intended).

Yeah, I wasn't too fond of using 2 either - I'm liking that opposite value idea. :nod:

I wrote PCGender != 1 in place of typing out 'not equal to' - my intention was meant that additional dialogue filters checking PCGender = 0 or PCGender = 2 (or whatever else was decided on) would be unnecessary if the dialogue is structured properly since there's only two genders states (last time I checked in MW anyways). With keeping the default global value as 0, and gender states as 1 and 2, I intended the filter to be >0. But if we go ahead and set the default for PCGender via NOM at 99 and have MPP updated to set the global at 1 or -1, then absolutely, filtering for <0 is a superior method.

I'll update my post in the MPP thread to this affect.

re: non-present globals

That's not possible. The construction set won't allow a script to compile if it references a global variable that isn't defined. The only way that NoM 3.0 could check the PCGender variable is if it ALSO defines it. However, since the save game will overwrite anything added by a mod, if PCGender is already defined by a previously existing mod, it's old value (in the save game) will overwrite the default value in a newly added mod.

Ahh, right. I was thinking that dialogue somehow handled it differently. Rather daft of me as it's rather obvious one needs a variable defined in order to reference it, and here I was posing a case where no mod would define it. :facepalm:


[edit] thanks for that clarification melian!
User avatar
BRIANNA
 
Posts: 3438
Joined: Thu Jan 11, 2007 7:51 pm

Post » Sat May 28, 2011 9:06 am

Well [censored].

(That shows up as censored, of course, but it's nonetheless fitting.)

Alright -- my supreme apologies for going AWOL.

Bit of advice for all I thought I would offer from recent experience:

If an RL censored-bomb hits, and then you get reaaally sick, do not top it off by getting excited and running down the stairs to get the phone, leaping high enough to slam the middle of the top of your head into the corner-edge of a pretty-low ceiling beam, and concluding with a sidelong hammering of the side of your head on the bannister before concluding your stunt. My boys got to see their first blood-dripping-all-over-the-carpet double-head-wound. "Calm down and get me a towel, will you??"

It's amazing how banol serious trauma comes off. In the midst of it, all I could do was yell "sh"it over and over again until I had settled into a daze. How intelligent.

[censored]. I feel like crying every time I think about that thud. But I think I got about 12 XP for it.

I'm alive. I'll get back on the ball shortly. :D Lots of catch-up, and, yes, this clearly means no Necessities for 2009. Scratch that Christmas marketing release deadline. Necessities for 2010. With Oxy Boosters and Gentle Cleansers.
User avatar
Matt Terry
 
Posts: 3453
Joined: Sun May 13, 2007 10:58 am

Post » Sat May 28, 2011 7:41 am

Bit of advice for all I thought I would offer from recent experience:

If an RL censored-bomb hits, and then you get reaaally sick, do not top it off by getting excited and running down the stairs to get the phone, leaping high enough to slam the middle of the top of your head into the corner-edge of a pretty-low ceiling beam, and concluding with a sidelong hammering of the side of your head on the bannister before concluding your stunt.

Wow.
Thank you for the sensible piece of advice. I'll make sure to never ever try this at home.
My best wishes for your swift recovery.
User avatar
Sophie Miller
 
Posts: 3300
Joined: Sun Jun 18, 2006 12:35 am

Post » Fri May 27, 2011 10:32 pm

Where's a good Restore Health potion when you need one?

Here's to a speedy recovery, and tomorrow you can tell everyone "I'll get to it THIS year" with a whole 12 months ahead of you to squeeze it into.
User avatar
LuCY sCoTT
 
Posts: 3410
Joined: Sun Feb 04, 2007 8:29 am

Post » Fri May 27, 2011 11:55 pm

Ye gods! Hope you're doing OK now, Gluby. :hugs:
User avatar
Emily Jeffs
 
Posts: 3335
Joined: Thu Nov 02, 2006 10:27 pm

Post » Sat May 28, 2011 5:02 am

Is there any news on this mod?
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Fri May 27, 2011 10:47 pm

Gluby's status: "User is offline, Last Active Jan 10 2010 08:13" :(
Let us hope he's OK.
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Previous

Return to III - Morrowind