XP Scaling for Level >10

Discussion in 'General Modification' started by Gaear, Jul 25, 2013.

Remove all ads!
  1. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    I always use tabs ... that must have been an Allyx holdover from way back when.

    You realize that it wouldn't have worked the first time anyway of course, regardless of tabs or spaces. ;)
     
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Okay, adding this in ... basically it needs to be added to every san_dying script in existence, with every critter proto in existence assigned a san_dying script (in addition to the combat standard routines bit)?
     
  3. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Unfortunately, yes.

    If you want to cut down on work, you can narrow it down to critters above a certain level, e.g. CR 8 and above.

    Also, some creatures already have a shared san_dying script (e.g. Hextor Invaders and Drow).
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Got it, thanks.
     
  5. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Re: Circle of Eight Modpack v7 / v7 NC Bug Report Thread

    ToEE never ceases to surprise: apparently the dwarves in the Quarry spawn with flag #32 already set to 1. I also tested with freshly spawned Dwarves (via console) - same result.

    Beyond the implication for the XP reduction (it nullifies the script because ToEE then thinks it has already reduced the CR), it raises a few questions:
    1. Do other NPC protos suffer the same issue?
    2. The internal variable used (obj_f_npc_pad_i_3) has so far been assumed to be unimportant. Is it? Could it influence something?
    3. Likewise for other "pad" variables.

    Certainly something to keep an eye for, at any rate.

    For the Dwarves in particular, you can just remove the check, i.e. use
    Code:
    modify_CR( attachee, get_av_level() )
    instead of
    Code:
    if should_modify_CR( attachee ):
    	modify_CR( attachee, get_av_level() )
    
    It was meant as a failsafe, but most NPCs die only once anyway :p
     
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Re: Circle of Eight Modpack v7 / v7 NC Bug Report Thread

    That's bizarre. I confirmed the dwarves and then randomly checked Elmo. He too has flag 32 set at his inception. :blegh:

    Maybe we should just switch the XP script flag to 31 and assume that everyone either has or can have 32 set. Elmo didn't have 31 set, and I'd rather not check every proto in existence to see if it has 32.

    I've got only one proto up to 31 in use for dialogue control (Abiram). He'd have to be busted down.
     
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Re: Circle of Eight Modpack v7 / v7 NC Bug Report Thread

    Well, what do you know, I learned another new thing today.

    Apparently the npc_get/set script doesn't work with flag #32 - as in, it's bugged - setting any flag will mark #32 as set (has to do with binary representation of integers). So using 31 is certainly better.

    The bad news is that Elmo and the Dwarves are spawned with flags 1 & 3 set, respectively. So who knows, maybe some other will have flag 31 set.

    To see whether any flag is set, you should type:
    Code:
    [obj].obj_get_int(obj_f_npc_pad_i_3)
    
    If it returns a number other than 0, at least one flag is set (however, to see exactly which flags are set, you have to convert it to binary representation).

    A possible solution might be to switch over the flag function to internal variable pad_i_4 - I'll have to test it (I'll write a script to automatically go through every proto and see what flags/variables are being used).
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Re: Circle of Eight Modpack v7 / v7 NC Bug Report Thread

    Ok, indeed pad_4 is clear for all protos. pad_3 had values preassigned for 16 protos, in the range of bit flags 1-3.
    Thus I reassigned npc_get / npc_set to pad_4. (this may influence internal testing, beware)
    Tested on the Dwarf and it worked fine (but not on the first time, of course ;) ).

    Also attached:
    -A long due script piece for Belsornig that will prevent his Temple from regrouping if you're working for him (=have been given the second task).
    -Removed debug code from Hold Person (it was writing feedback into a text file for testing purposes, added it a long time ago and forgot to remove that bit)
     

    Attached Files:

  9. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Re: Circle of Eight Modpack v7 / v7 NC Bug Report Thread

    Cool, thanks. :thumbsup:

    So does that mean we still change all affected scripts to flag 31?
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Re: Circle of Eight Modpack v7 / v7 NC Bug Report Thread

    Not sure I understand what you mean, so I'll just restate what I've changed:

    - For the purpose of XP rewards, we're using flag # 31. (this is already done in the updated script)
    - In general, the internal variable used is pad_4 instead of pad_3. pad_4 is clean for all protos, pad_3 sometimes has values preassigned. The change is transparent for you or other users (you use npc_get etc just the same), except if you've already started a game and set some flags before the update. Restarting the game would fix it.
    - Don't use flag #32, it doesn't work. 1-31 is ok.
     
  11. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Re: Circle of Eight Modpack v7 / v7 NC Bug Report Thread

    Right, I was thinking we stated the internal flag somewhere in each script that used the master script, sorry.
     
  12. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Moved the bug report/fix stuff over here for clarity ...

    SA, are there any implications with the 'sometimes set' flags for NPCS that use them for other stuff, like dialogue limit/control? Just wondering if, say, Captain Achan will act like he's already said something he's only supposed to say once, which would be bad for some quests/gameplay.
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    In theory, if he were to suffer from that issue (i.e. being born with some flags set to 1), then yes. The game would think that he's already said his piece. That's why I switched to pad_4, which as far as I know is all zeros for every NPC, unlike pad_3.

    Specifically for Achan, I haven't noticed that he has any set flags by default, at least when I swept across all the protos.

    The ones that did have some flags set were: (when using pad_3)

    Burne
    Rufus
    Elmo
    Meleny
    Spugnoir
    Zert
    Raimol
    Paida
    Thrommel
    Jaer
    Sargen
    Ariakas
    Dwarf Warrior
    Fireforge
    King Battlehammer
    Elmo (second version - proto 14723)

    And the flags set were all in the range of #1-3.
     
  14. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Question about the dying script: will appending this to joinable NPCs' dying scripts do anything weird without the 'if (attachee.leader_get() == OBJ_HANDLE_NULL):' bit? I'd rather not add that for every NPC. ;)

    [edit]

    Also FYI, py00006captain is now the dump script for critters with no previous san-dying script defined (like py00002black jay is for start combat), though ironically Captain Renton doesn't use it. ;) It contains the plain xp script.

    Code:
    def san_dying( attachee, triggerer ):
    	if should_modify_CR( attachee ):
    		modify_CR( attachee, get_av_level() )
    	return RUN_DEFAULT
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Unless they're using flag 31, it should cause no harm.
     
Our Host!