XP awards, leveling, and validation

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

Locked
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

XP awards, leveling, and validation

Post by AcadiusLost »

I haven't given this system much time, more or less just plugged in the code we had and left it at that, though it's a little off in how it works in practice so far on the 003 beta.

Upon completing the leveling process, you get an error saying the XP has been obtained without the proper scripts (guessing the 003 statics and kill XP doesn't use the acr_xp_i functions). The level gets taken away, but the XP remains. So, that part seems to be working, from a core script perspective.

However, if you log out and back in again- it allows you to level properly and the level "sticks" just fine. Same for leveling from 2nd to 3rd- gives the error, takes away and regrants XP, logging out/in lets you take the level. This behavior is essentially an exploit that should be addressed (NWNx4 persistency code might do the trick). But, for now, allows Beta test PCs to level while testing, even sans DM and proper functions to award XP.

Now, the wacky part is leveling from 3rd to 4th. 4th is when validation is supposed to be required... somehow when you try to confirm the 4th level process, it kicks you clear back to level 1, then re-awards the XP. No amount of logging in/out seems to work to counteract this or make the levels "stick". Not sure if there would be less problem if the XP was granted via the ALFA scripts.

Also, we never made any kind of DM tool for level validations, did we?
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Interesting behavior. I don't think Ronan got around to testing any of this out. Would you like to post the bug report on our bug tracker? :D

There's no DM tool to control ALFA systems yet but I'd like to add our custom extensions to DMFI (which should actually already be integrated in the DM client IIRC).
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

ç i p h é r wrote:Interesting behavior. I don't think Ronan got around to testing any of this out.
When I looked closely into acr_xp_i last night, I realized I'd missed the all-caps notation of "PROTOTYPE ONLY - Probably doesn't work" in the header of the file. So... I would agree with that assessment. Impressive that it did as well as it has, but shouldn't have been tossed into the first ACR hak in that form. Spent a few hours testing and debugging the system, I think I have level validation and releveling working correctly now, will commit the code in a few minutes as v0.2 of acr_xp_i.

For the record, there were two conceptual problems with the code as written before: one was that the ACR_ProcessPlayerLevelAttempt() was written with a mind to it firing /before/ the PC had leveled, rather than after they hit "confirm/OK"- while the only event hook we have to work with fires after- so some of the calculations, function names, and other quirks needed fixing for that.

The second hitch was that the code assumed you could take XP away to delevel, then return it again immediately to relevel (not an unreasonable assumption)- however, in practice, putting the two SetXP calls next to each other seems to de-level the PC, but not trigger the levelup again until logout/login. I tried wrapping the second _SetXP in a 3-second DelayCommand, and it worked fine.

Current ALFA XP totals and validation records/checks are still being performed on the c-skin using ALFA_GetPCPersistantObject() - what is the replacement for this code, so I can work it in for next release?


Also- scripted an activatable self-validation widget for Beta servers that want it.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Good news, thanks AL.
AcadiusLost wrote:Current ALFA XP totals and validation records/checks are still being performed on the c-skin using ALFA_GetPCPersistantObject() - what is the replacement for this code, so I can work it in for next release?
Quite simple really.

SetLocalInt(oSkin, ACR_XXX_XXXX, nInt) becomes ACR_SetPersistentInt(oPC, ACR_XXX_XXX, nInt)

where oSkin = ACR_GetPCPersistentObject(...). Just use the correct function for the data type in question. You'll need to include the global include file acr_i (if it's not already included indirectly).

Let me know if that's not clear.
User avatar
Rusty
Retired
Posts: 2847
Joined: Mon Feb 21, 2005 10:36 pm
Location: London
Contact:

Post by Rusty »

NWNx4 should remove a need for DM level validation, unless we wish to retain the mechanism for policy reasons.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

If that counts as a DMA policy stance (for NWN2-Beta), I'll just switch the need for validation off in the code with the next ACR update, easily done.
User avatar
Rusty
Retired
Posts: 2847
Joined: Mon Feb 21, 2005 10:36 pm
Location: London
Contact:

Post by Rusty »

For the time being, particularly if it makes beta-testing easier.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

Level validation removed (well, pushed back to the unattainable level 21 technically).

Also fixed a missing reference to the "XP anchor" for a even-CR encounter which we arbitrarily set as 30.0 (to the DMG's 300). This in place, XP awards seem to be working for combat encounters as discussed previously by Standards. Level 1 sorc solo killling a CR 0.33 orc gets 19 xp. We'll see how it "feels" in beta testing.
Locked