Author Topic: Undead player questions and scripting know how!  (Read 641 times)

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #15 on: August 08, 2013, 02:36:44 am »


               When it comes to setting racial types, you can do it with either lin or win, though win might require leto to do it - I just don't know, since we use lin. As for the safety of setting racial types, I got ahold of acaos and discussed it with him:

Funky: one last question, came up on the bioboards - what was the issue with setting racial types of pcs, and was it specific to leto only, not funcs?
acaos: it hasn't been tested and could do nasty things, given how deeply entwined races are in the system
acaos: you'll definitely need to boot them and make them relog
acaos: after changing their race
Funky: I don't plan to
Funky: was a question on the bioboards only '<img'>
acaos: it's more of a 'this could be really dangerous'
acaos: than a 'we are aware of isues'
Funky: ah ok
acaos: since races have lots of hard-coded special behavior for PCs
acaos: you wouldn't muck with their classes either
acaos: same reason
Funky: is that why you chose to make switches in negpos and route all healing/neg spells through that, instead?
acaos: er?
Funky: you know how all heal spells go through neg/pos, and we control undead racial stuff through it?
acaos: right, but that's no different than how NWN handles it in base scripting
Funky: someone on bioboards is considering nwnx_funcs editing races
acaos: just it has it in a dozen scripts
acaos: and we have it in one


Funky
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #16 on: August 08, 2013, 04:12:36 am »


               I'm not sure what acaos is referring to with "nasty things", "hard-coded special behavior", and "it hasn't been tested."  Standard polymorphs already change the race for PCs and the problematic issues typically encountered are for leveling up and compatibility with 1.69 horse scripts.
               
               

               


                     Modifié par WhiZard, 08 août 2013 - 03:13 .
                     
                  


            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #17 on: August 08, 2013, 06:08:16 am »


               

DM_Vecna wrote...

Thayan, are you running Linux or windows nwnx_funncs?



I run Windows nwnx_funcs.

So far I've not noticed any crazy things with changing PC racial types other than some scripting modifications that were needed (the horse scripts, for example). We only change subrace PCs to the Outsider, Undead, Goblinoid, and Orc races though. We'd had some of our subrace PCs up to level 14-ish, so through multiple level-ups I've not had reports of anything screwed up. That's not to say it couldn't/won't happen....it just nothing show-stopping has happened yet and we've been running with this for ~8 months.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #18 on: August 08, 2013, 07:02:35 am »


               

WhiZard wrote...

I'm not sure what acaos is referring to with "nasty things", "hard-coded special behavior", and "it hasn't been tested."  Standard polymorphs already change the race for PCs and the problematic issues typically encountered are for leveling up and compatibility with 1.69 horse scripts.

We're discussing setting of  racial type directly, not polymorphing, which is a completely different ball of wax (though also one of the more crash-and-bug-prone aspects of NWN). A better example would've been monks becoming outsiders at level 20, but that's something that's been extensively playtested already.

He was saying HE hadn't tested setting of racial types (and he did an awful lot of testing when poking around in the engine to make the various eXalt plugins, including the one under discussion, funcs). Further, he was talking about hard-coded issues, at the engine level, things not accessible via nwscript - nothing like the 1.69 horse scripts.

The kinds of 'nasty things' he has in mind are, among other things, potential crash bugs, which are all too common when tinkering with this kind of engine-level editing. Similar issues arise, as he alluded, when you tinker with other character data, like class - I suspect that that came first to his mind because he did a lot of work trying to hack in additional classes like favored soul without the accompanying mandatory client-side haks.

Some edits the engine will outright reject, yeiling unstable or unpredictable behavior, while others simply have unintended consequences. The most recent example from our servers that comes to mind is spellslots. One of our devs decided to expand on some spellslot functionality acaos had added, by using nwnx functions to add some additional commands:

-- "!sb save # NAME" - This will save your current spell books into slot
# (0-9) with name NAME. This works for all non-spontaneous classes.
-- "!sb load #" - This will load  saved spellbook # (0-9) into your active spell book.
-- "!sb list" - This will list your saved spell books.

The dev in question didn't fully understand the nwnx functions he used (and the shortcomings which led acaos not to implement those particular spellbook commands in the first place). As a result, a crash bug was born, by virtue of doing something to the character in memory that the engine just wasn't prepared to cope with. As is often the case with engine-level tinkering (which is bereft of the safety of repeated testing the rest of the engine has been subjected to over the years), unintended consequences resulted, leading an old and previously unproblematic command, !sb empty, to crash the server. The thread on our forums is here, should you be curious:

Click Me

In that case, the correlation between the problem and the edit that caused it was sufficiently strong to allow us to track it down and fix it quickly. That's not always the case, however, and the more things an edit touches on, the more difficult it can be to track down, especially if you don't notice any problems initially. Racial types touch on a lot of things.

I'd sum it up by saying 'here be dragons', but in this case, the dragons often turn out to be real in a metaphorical sense. Nevertheless, experimentation is how the community adds to its knowledge base, so by all means, dive in. Just do so forewarned that this is not necessarily a simpler alternative to nwscript edits to healing/neg spells, which is what the poster in question seemed to be after.

Funky
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #19 on: August 08, 2013, 08:47:11 pm »


               Thanks Funky, your knowledge and experience from your pw team has defined a lot of my experience and fun here over the years.

I am still interested to hear from Thayan which version he is running as I am getting almost no effect when trying to set race on a PC using the Linux version and have confirmed similar issues with _Guile aka Genesis's subrace system using Linux as well. At this point I have not confirmed anyone successfully setting PC race with the Linux version. I have used Elvens nwnx_ funcs and he even tinkered around with my server reporting some nwnx_funcs issues. So perhaps that nwnx plugin is just broken for that function. If you happen to talk to Acaos again maybe he can confirm.  

However I was only trying to use Undead  and Fey (Wemic, Brownie) races so maybe it's just easier to script the effects that getting it to work. '<img'>
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #20 on: August 08, 2013, 09:28:14 pm »


               

FunkySwerve wrote...
We're discussing setting of  racial type directly, not polymorphing, which is a completely different ball of wax


That is exactly what I am questioning- whether the character file field provides any further problems to the hard-code that the polymorph does not.  Leto changes to races have been going on for a long time without problematic behavior.  Polymorph race changes encounter hard-code in numerous places.  When leveling the prestige class assumes your race to be that of your polymorph and feats assume your ability score is modified by the racial modifier of the race of your polymorph.  GetRacialType(), a hard-coded function, again looks at the polymorph race.  Furthermore, unpolymorphing actually writes into the character file.  For example, if I used SetCreatureAppearanceType() to a badger before polymorphing, then after polymorphing and unpolymorphing my creature size would be tiny.  Polymorph just uses data from what I was before (in this case the creature size bug came from it storing an appearance and using that appearance's index to find creature size), writing that in when the unpolymorph occurs.  Given the vast number of times the current race, rather than the character file value, hits the hard-code, I am not sure if there are any problems that are character file value only.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #21 on: August 09, 2013, 12:20:36 am »


               

WhiZard wrote...

FunkySwerve wrote...
We're discussing setting of  racial type directly, not polymorphing, which is a completely different ball of wax


That is exactly what I am questioning- whether the character file field provides any further problems to the hard-code that the polymorph does not.


That's also off-topic. Vecna was asking about using funcs, which edits in-memory, not the character file. The short answer, though, is yes, it's possible to do things with classes that will muck things up. Of course, leto and funcs can do things outside of what happens when polymorphing, so again, proceed with caution.

Funky
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #22 on: August 09, 2013, 12:21:29 am »


               

DM_Vecna wrote...

Thanks Funky, your knowledge and experience from your pw team has defined a lot of my experience and fun here over the years.

I am still interested to hear from Thayan which version he is running as I am getting almost no effect when trying to set race on a PC using the Linux version and have confirmed similar issues with _Guile aka Genesis's subrace system using Linux as well. At this point I have not confirmed anyone successfully setting PC race with the Linux version. I have used Elvens nwnx_ funcs and he even tinkered around with my server reporting some nwnx_funcs issues. So perhaps that nwnx plugin is just broken for that function. If you happen to talk to Acaos again maybe he can confirm.  

However I was only trying to use Undead  and Fey (Wemic, Brownie) races so maybe it's just easier to script the effects that getting it to work. '<img'>


I'm asking acaos about this; hopefully he'll remember.

Funky
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #23 on: August 09, 2013, 03:05:53 pm »


               

DM_Vecna wrote...
I am still interested to hear from Thayan which version he is running..


As I mentioned above, I'm using the Windows version of nwnx_funcs. If you're looking for the specific build number, we're on 0.9.41. With nwnx_funcs, we've had problems with the SetTag function crashing the server, but the SetRace function has not caused any crashes (yet?) of which I'm aware.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #24 on: August 09, 2013, 04:07:42 pm »


               Sounds like there are significant differences between lin and win nwnx_funcs - we use SetTag with no issues at all in lin (it's used for our unique id system, which is ubiquitous). Acaos said he'd have to check the source for setting racial type in lin, when I pasted him the bit above about it not working.

Funky
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #25 on: August 09, 2013, 06:09:16 pm »


               Thanks so much guys.

@Funky: any chance you would be willing to share your nwnx_funcs.so file with me to ensure the issue is not with elven's build?
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #26 on: August 09, 2013, 07:25:43 pm »


               Link:
nwnx_funcs.so

Relevant conversation with acaos (in case you can't tell, my knowledge of linux, and our particular hosting setup, is...limited '<img'> ):

acaos: you're looking for our funcs .so ?
Funky: yup
acaos: it'd be in /local/nwn/live/nwnx
Funky: admin on bioboards requested to see if our SetRacial was working, as his isn't
Funky: kk, ty, looking
acaos: but let me look at the source
Funky: k
Funky: won't give it to him or post a reply until I hear from you
acaos: it's no different from his, though, if he compiled from source
Funky: he's using elven's, he says
acaos: we're using the same funcs he has
acaos: elven uses the same one, or should
Funky: maybe we have an older build or something
acaos: possible
acaos: feel free to give it to him, though it's likely not going to be really useful
Funky: ok, will do
acaos: if he wants to change a race, he really needs to use leto at the least
Funky: oh?
acaos: I feel confident in saying that changing the race of an online PC is not going to work well
Funky: what's the funcs function for, then?
acaos: completeness
Funky: ah
acaos: it's there because it -might- be useful
acaos: but I wouldn't depend on it in any way
acaos: race is -so- buried in hundreds of places
Funky: interesting - there's a thread saying it's been being done on some servers with no issues for quite some time
acaos: hmmm
acaos: weird
acaos: well, he can try it
Funky: linking
acaos: but I'd be stunned if it just worked
Funky: http://social.biowar...ndex/15338697/1
Funky: relevant portion is after my posts
Funky: hopefully I explained your meaning adequately '<img'>
Funky: oh, forgot to mention - the person in question is using WIN nwnx_funcs
Funky: not lin
Funky: another person asked to see our lin to see if our SetRacial would work where his woudl not
acaos: yeah, the lin and win server code are different, too
acaos: I see he mentioend SetTag having issues
Funky: yeah
Funky: so just post him the so, I guess?
acaos: anyway, you got what I meant, I just hadn't tested it and I know there is hard-coded behavior around various racial types
acaos: feel free, yeah
Funky: kk, good
Funky: and thanks again '<img'>

Hope that helps.

Funky
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Undead player questions and scripting know how!
« Reply #27 on: August 10, 2013, 03:56:39 am »


               THANK YOU so much for all of the information.

I hear what you are saying on using SetRace. I am going to have to take a look at Leto. It had always been something I could live without. I will reply back with any results from my testing of SetRace on Linux as well as the two nwnx_funcs.so files.