Finally got a bunch of my ACR edits and additions committed to the SVN last night. This included RP XP scripts, the 2-handed use of bastardswords via martial proficiency, some fixes and additions to 1984 logging, and:
-Death scripts- I've hopefully cleared up the oddities with the death system, by making unique tags for bodies and corpses, allowing the GetCorpseFromPlayer() functions to not be mislead by the high-turnover PC crowd. I had to add exception handling for ACR_Get/Set/Delete_Persistent* functions, but the overhead should be low for those. Seem to be working reliably again. Also added better logging and DM channel feedback for Rezes, and made possessed NPC rezes IC (applies penalty). Made a constant switch to control which penalty is applied for 1st level PCs (XP loss vs. CON loss), set it for XP loss.
-I've added handling for tag-based scripts for the OnAcquire, OnUnAcquire, OnEquip, and OnUnEquip item events. Once the server is recompiled, any script named with the format "i_ITEMTAG_oa" will fire whenever the item so tagged is acquired. Similarly, "i_ITEMTAG_oua" will fire on unacquire (drop, sell, barter), "i_ITEMTAG_oe" will fire onEquipped, "i_ITEMTAG_oue" will fire on unequipped. This should make some of the "special" items easier to handle without wrestling with the ACR. Note that currently OnActivate items work on a scriptname = itemtag basis, though we could expand to include "i_ITEMTAG_ac" format as well. It certainly has advantages for script list organization. Abstracted out item handling to functions in acr_items_i.nss, to help clean up acr_mod_events_i, though had to leave most of the content in there to avoid recursive includes for now. Didn't have the steam to sort out the conflicts.
-I've found a 2da on the vault that stops the overhead text from spoken words from floating up into the sky. It works clientside, so could be packaged with the amended alfa_acr.hak once we prepare it for the hotfixed update later this week. The text stays put, then fades away, just like in NWN1.
-There is a limitation I've found in the SQL plugin for NWNx4 - whenever there is a brief failure of the SQL database, all subsequent attempts to connect for reads or writes will fail with an error in the xp_mysql.txt file "The SQL Server has gone away." - even after the SQL server is back up. To the host, nothing is visibly wrong with the server, but players will be unable to log in (booted out on login). I've been working to automate a fix for this- so far it seems reloading the module via StartNewModule() is not sufficient to fix it. I have posed the question to the folks at NWNx4, hopefully they can shed some light. In the meantime, I've scripted a system that will detect these DB failures, and dump the players who are logged in, two minutes after giving them a warning about what's going on. Reloading the module from the NWNx4 GUI reliably reestablishes the SQL connections, I just haven't found a way to automate this yet.
Assorted additions
Moderators: ALFA Administrators, Staff - Technical
- AcadiusLost
- Chosen of Forumamus, God of Forums
- Posts: 5061
- Joined: Tue Oct 19, 2004 8:38 am
- Location: Montara, CA [GMT -8]
- Contact:
- Teric neDhalir
- Githyanki
- Posts: 1495
- Joined: Mon Jan 05, 2004 10:04 pm
- Location: Manchester UK
Re: Assorted additions
This is brilliant. I've just gone through and reorganized my scripts to take advantage of all of these built-in functions. Thanks for making it so easy, AL. Now I don't have to check out the mod and insert an ExecuteScript("WynnaRodOWonder", GetItemActivated()) (or whatever event's appropriate) into the mod files.AcadiusLost wrote: -I've added handling for tag-based scripts for the OnAcquire, OnUnAcquire, OnEquip, and OnUnEquip item events. Once the server is recompiled, any script named with the format "i_ITEMTAG_oa" will fire whenever the item so tagged is acquired. Similarly, "i_ITEMTAG_oua" will fire on unacquire (drop, sell, barter), "i_ITEMTAG_oe" will fire onEquipped, "i_ITEMTAG_oue" will fire on unequipped. This should make some of the "special" items easier to handle without wrestling with the ACR. Note that currently OnActivate items work on a scriptname = itemtag basis, though we could expand to include "i_ITEMTAG_ac" format as well. It certainly has advantages for script list organization. Abstracted out item handling to functions in acr_items_i.nss, to help clean up acr_mod_events_i, though had to leave most of the content in there to avoid recursive includes for now. Didn't have the steam to sort out the conflicts.
Enjoy the game