Author Topic: What fixes are needed to start building a PW  (Read 661 times)

Legacy_Tazzvon

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
What fixes are needed to start building a PW
« on: October 06, 2013, 03:17:20 pm »


               So i am always tinkering with building a PW and i know the community has come up with a lot of altered scripts to fix the original NWN. I am wondering is anyone can give me an idea of what needs to be fixed and maybe where i can find the scripts already made to fix these items. I am looking at such things as spells which i guess are not correct as originally designed by Bioware as well as a lot of exploits i guess people use to take advantage of errors in the original build. I will only be running everything through HOTU, no CEP or other haks (unless someone can prove to me this is neccessary for a successful PW now a days). I really just want a great PW starter mod with all the neccessary fixes to make it enjoyable and less exploitable. I will probably be running NWNX2 as i see this to be a great addition that doesn't effect the client (no extra stuff the client has to do to play).
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #1 on: October 06, 2013, 03:21:09 pm »


               Fixes are a matter of taste so only you can know what you will need for your PW.

With that said, ShaDoOoW has done a great deal of work on a community patch which I have found useful,
               
               

               
            

Legacy_Tazzvon

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #2 on: October 06, 2013, 03:33:15 pm »


               I was always curious about the community patch. If i run it on my server side doesn't that mean the client has to run it also, basically like a HAK?

Nevermind, I took the time to read about it. Should of done that before i questioned it LOL.
               
               

               


                     Modifié par Tazzvon, 06 octobre 2013 - 02:43 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #3 on: October 06, 2013, 03:46:16 pm »


               EDIT: eh so you got it answered by documentation already, nvm

To answer your first question however. Define need for a fix, everything can be solved via punishing which is what majority of PWs does. But imo if you just started CP is great value as you wont need to spend time to fix things you would sooner or later find out yourself.

Also check my PW starter module: http://nwvault.ign.c....Detail&id=6161
(though its mission one update because old vaut no longer lets me update the files..., but Im going to repost on new vault soon)
               
               

               


                     Modifié par ShaDoOoW, 06 octobre 2013 - 04:03 .
                     
                  


            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #4 on: October 06, 2013, 09:16:07 pm »


               The amount of actual changes that need to be done before opening a PW are actually quite considerable, even without personal tastes being a factor.

-You need some sort of system to protect player accounts

-Something to clean up dead bodies and trash loot on the ground when the area is empty of PCs

-Something to clean merchants out so they don't stockpile non-default goods

-Something to stop monsters from leaving their areas and following players (players do this to grief)

-Something to make sure base stats and modified stats of a level 1 aren't ridiculous (exploiters)

-Something to do with the spawning/re-spawning of monsters

-99% of the time you''ll want a custom experience script that doesn't so harshly punish parties

-You need to know how you're going to store information about a PC for persistence, either using local variable storage on PC items, campaign variable database, or MYSQL databases

Those are just off the top of my head. You can probably find different scripts that do some of these things, but they will most likely need alterations due to their date.
               
               

               


                     Modifié par EzRemake, 07 octobre 2013 - 02:35 .
                     
                  


            

Legacy_Tazzvon

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #5 on: October 06, 2013, 09:50:05 pm »


               Thank you for all the replies. EzRemake, thanks for the details. If anyone can think of anything else i would love to hear it. I would like to get the basics put in before i start actually making anything so i don't have to go back and change half the mod for something i forgot.

ShaDoOow, Can you give me an idea of what is not needed in your starter mad (i know the ares and conversation but are all the scripts needed, it looks like a few may be for demo only.)
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #6 on: October 07, 2013, 03:45:05 am »


               

ShaDoOoW - It's not letting me message you for some reason, but I was curious if you could please explain to me how to fix the "server cr@ash du(ping ex&plo^it fix (by exporting character at Acquired events)", as I am well past the need for a base module.


You save when the character unaquires something (though you want to be a little more sophisticated about it). Otherwise, they can transfer it to another character, save that character (assuming you provide that functionality in something like a 'saving pen', or onrest), and cr%ash the server if they know an ex#plo@it to do so. The unsaved character is not saved as a result of the cr)ash, so they have all the items they transferred back again. Here's a code snippet from unacquire:


    /* the object/area/possessor valid checks here are to ensure that
     * barter doesn't break with onunacquire saving */
    if (nItType != BASE_ITEM_POTIONS          &&
        nItType != BASE_ITEM_ENCHANTED_POTION &&
        (!GetIsObjectValid(oItem) ||
         GetIsObjectValid(oArea)  ||
         GetIsObjectValid(GetItemPossessor(oItem)))) {

        ForceDelayedSave(oLoser);
    }

The added checks are to prevent spamming of Exports. ForceDelayedSave is as follows, and does the same:


void ForceDelayedSave (object oPC, float fDelay=2.0) {
    if (!GetIsPC(oPC) || GetIsDM(oPC))
        return;

    int nUptime = GetLocalInt(GetModule(), "uptime");
    int nDelayedSave = GetLocalInt(oPC, "DelayedSave");

    if (nDelayedSave < nUptime) {
        SetLocalInt(oPC, "DelayedSave", nUptime);
        DelayCommand(fDelay, ForceSave(oPC, TRUE));
    } else if (nDelayedSave == nUptime + 1) {
        SetLocalInt(oPC, "DelayedSave", nUptime + 2);
        DelayCommand(10.0, ForceSave(oPC));
    }
}

Obviously that particular function relies on an incrementing uptime timer in mod heartbeat, but there are lots of ways to skin that cat.

If you're nice, you'll also do a FDS onacquire, so that items transferred aren't lost if they forget to save.

That can get a bit tricky, as there may be times when you don't want to autosave, like when they're riffling through their bank items, and it autosaves when they close the chest (another potential ex+pl*oit there). Here are the other two spots where FDS is used in our mod, within a few lines of each other in onacquire:


    /* don't save while transacting in vault */
    if (!GetLocalInt(oLoser, "Vault")              &&
        GetStringLeft(sRes, 13) != "ele_material_" &&
        GetStringLeft(sRes, 13) != "fey_material_")
        ForceDelayedSave(oAcquire);


    string sFound = "&&" + COLOR_LT_GREY + "Found ";
    string sLoser = COLOR_LT_GREY + ".";

    if (GetIsPC(oLoser)) {
        ForceDelayedSave(oLoser);

        if (GetArea(oAcquire) == GetArea(oLoser) && GetLocalInt(GetArea(oAcquire), "NO_PVP")) {
            sFound = "&&" + COLOR_LT_GREY + "Received ";
            sLoser = COLOR_LT_GREY + " from " + GetName(oLoser) + ".";
        }
    }

Funky
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #7 on: October 07, 2013, 07:26:49 am »


               

Tazzvon wrote...

ShaDoOow, Can you give me an idea of what is not needed in your starter mad (i know the ares and conversation but are all the scripts needed, it looks like a few may be for demo only.)

if you dont use CP you will want also the familiar conversation that is included in the mod, if you do then you dont need it (included in CP as well), all the scripts are required, most of them might be merged though (aka my module event scripts are just a placeholder that executes others so you dont need exactly those scripts and all you need is their content - ExecuteScript(...)'<img'>
               
               

               


                     Modifié par ShaDoOoW, 07 octobre 2013 - 06:27 .
                     
                  


            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #8 on: October 07, 2013, 12:58:30 pm »


               I looked through the starter module and was under the impression that the fix was

OnAcquired

void main()
{
object oModule = OBJECT_SELF;
object oPC = GetModuleItemAcquiredBy();
if(GetIsPC(oPC) && GetLocalInt(oModule,ObjectToString(oPC)))
{
ExportSingleCharacter(oPC);//server crash exploit fixing
}
ExecuteScript("x2_mod_def_aqu",oModule);
}


OnUnAcquire

void main()
{
object oModule = OBJECT_SELF;
object oPC = GetModuleItemLostBy();
if(GetIsPC(oPC) && GetLocalInt(oModule,ObjectToString(oPC)))
{
ExportSingleCharacter(oPC);//server crash exploit fixing
}
ExecuteScript("x2_mod_def_unaqu",oModule);
}

What you're talking about has me a little bit confused. Are you saying that the server crash exploit is a separate exploit, and that it's just used as a method of duping? Or does exporting a character while acquiring/un-acquiring an item cause a crash and subsequent dupe?
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #9 on: October 07, 2013, 02:20:15 pm »


               

FunkySwerve wrote...

The added checks are to prevent spamming of Exports. ForceDelayedSave is as follows, and does the same:


ForceSave presumably just does the ExportSingleCharacter?

[edit: added this one] Is that the item's area or the loser's area in the unacquire test?

That can get a bit tricky, as there may be times when you don't want to autosave, like when they're riffling through their bank items, and it autosaves when they close the chest (another potential ex+pl*oit there). Here are the other two spots where FDS is used in our mod, within a few lines of each other in onacquire:


This other one you mention here is along the same lines. If you take stuff out of or put stuff in the vault
and then cause a crash you get duplicates? Or is this something different?

Thanks,

meaglyn
               
               

               


                     Modifié par meaglyn, 07 octobre 2013 - 02:32 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #10 on: October 07, 2013, 03:48:12 pm »


               

EzRemake wrote...

What you're talking about has me a little bit confused. Are you saying that the server crash exploit is a separate exploit, and that it's just used as a method of duping?

yes, another abuse of that is loot reset/merchant gold reset etc, but that module related and if you have something like that you should prevent from being abused by crashing

Or does exporting a character while acquiring/un-acquiring an item cause a crash and subsequent dupe?

from the few crash bugs i know none is related to the acquire/unacquire items

FunkySwerve wrote:

That can get a bit tricky, as there may be times when you
don't want to autosave, like when they're riffling through their bank
items, and it autosaves when they close the chest (another potential
ex+pl*oit there). Here are the other two spots where FDS is used in our
mod, within a few lines of each other in onacquire:


This other one you mention here is along the same lines. If you take stuff out of or put stuff in the vault
and then cause a crash you get duplicates? Or is this something different?

Thanks,

meaglyn

I also didnt understood it. I dont get why would anyone not want to save items when put/get from persistent storage. I dont see any gap when adding items to the chest. If a persistent storage does not save when taking items from it, thats a huge exploit gap (that can be easily exploited even without server crash if its OnClose/OnOpen based) and such system should be avoided. Not saving doesnt help, character just needs to drop that item on a ground and pick it again or someone else can do that and dupe is possible again.
               
               

               


                     Modifié par ShaDoOoW, 07 octobre 2013 - 03:09 .
                     
                  


            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #11 on: October 07, 2013, 05:54:42 pm »


               

FunkySwerve wrote...

cr%ash ex#plo@it


Pardon my ignorance, but is there a reason we're using weird symbols like this?  Is it to prevent people searching for those terms or something?
               
               

               
            

Legacy_Khuzadrepa

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #12 on: October 07, 2013, 07:07:05 pm »


               

MagicalMaster wrote...

FunkySwerve wrote...

cr%ash ex#plo@it


Pardon my ignorance, but is there a reason we're using weird symbols like this?  Is it to prevent people searching for those terms or something?

Yes.
               
               

               
            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #13 on: October 07, 2013, 07:58:08 pm »


               Hmm, are these other crash related issues fixable? I would much rather fix those instead of preventing dupe caused by them, of course, if that's even possible.

In the meantime, are the basic fix scripts that I posted for OnAcquire/OnUnAcquire sufficient, especially if you aren't using persistent storage?
               
               

               


                     Modifié par EzRemake, 07 octobre 2013 - 07:06 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
What fixes are needed to start building a PW
« Reply #14 on: October 07, 2013, 08:17:43 pm »


               

EzRemake wrote...

In the meantime, are the basic fix scripts that I posted for OnAcquire/OnUnAcquire sufficient, especially if you aren't using persistent storage?

they should be, i do exactly this in a PW i was admin of and its working without issues

though, Funky little concerned me about saving character, I assume a small efficiency change could be done since when you pick a bag of 50 items, it will run 51x OnAcquire afaik, and then 51x save character at same time... but it never made any lags in my PW and we dont have a persisten storage - players using mules

also saving character while in polymorph results into few issues, first the polymorph duration, if there was one is reset, second, all merged items are lost (because ExportSingelCharacter unpolymorph player first before save and then polymorph him back), character can also get back temporary hitpoints. From these three issues, none is fixed by the starter module nor CP. I guess I could fix that in a start module if there is demand, but its not suitable for CP because its dependant on many module events which CP avoids modifying for easy use/compatibility.

to fix crash exploits... well, all i can say is that those I know are not possible on a Sinfar, so they can be fixed. But, anytime can appear new one so better have everything handled before someone figures that out.
               
               

               


                     Modifié par ShaDoOoW, 07 octobre 2013 - 07:20 .