Announcement

Collapse
No announcement yet.

Loadout WORM re-visited

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loadout WORM re-visited

    OK, download link as promised:

    www.dan.wronger.com/LW.html

    This is an old version and I'm gonna implement Immortius suggestion for adding it to the preferences menu in the near future.


    For those who don't know what this is, it's basically a mutator that allows you to change what items/prices/quantities/names appear in the ThieveryShops, without modifing the actual map. It's mainly intended for scripters who want an easy way to implement new items they've created but it can also be used to tweak the limits/prices of exisiting items.

    Theres a more comprehensive readme included in the zip

    I know MM is dying to nitpick my code and whinge about how I've done things, so now he can go well ahead

  • #2
    Cool. Too bad the link doesn't work.
    The only constant is change.
    (And I wouldn't have it any other way.)

    Comment


    • #3
      Cool, thanks Dan

      I hate to disappoint you man, but in this case, if it works, that's all I care about. But if it for some or other reason doesn't...
      ]V[]V[

      Comment


      • #4
        Interesting. Personally, I would have done something like this (no guarantee of it being error free) using a SpawnNotify subclass:

        [code:1:8ba206b256]//================================================== ===========================
        // ThThiefShopConfig.
        //================================================== ===========================
        class ThThiefShopConfig expands Mutator config(ThMutators);

        var ThSpawnNotifyThiefShop ThShopChanger;
        var bool Initialised;
        var() config bool OverwriteExistingShops;

        event PostBeginPlay() {
        local ThieveryShopThieves TShop;
        if(!Initialised) {
        ThShopChanger = Spawn(class'ThSpawnNotifyThiefShop');
        if (OverwriteExistingShops) {
        foreach AllActors(class'ThieveryShopThieves', TShop) {
        if (!TShop.IsA'ThieveryShopThievesThiefMatch'&#41 ;)
        ThShopChanger.SpawnNotification(TShop);
        }
        }
        Initialised = True;
        }
        }

        //================================================== ===========================
        // ThSpawnNotifyThiefShop.
        //================================================== ===========================
        class ThSpawnNotifyThiefShop expands SpawnNotify config(ThMutators);

        var() config ThieveryWeapon MeleeWeapon[15];
        var() config int MeleeWeaponCost[15];
        var() config ThieveryAmmo RangedWeapon[15];
        var() config int RangedWeaponCost[15];
        var() config int RangedWeaponQuantity[15];
        var() config ThieveryPickup Item[15];
        var() config int ItemCost[15];
        var() config int ItemQuantity[15];
        var() config int ItemLimit[15];

        var ThieveryShopThieves Shop;

        simulated event Actor SpawnNotification(Actor A) {
        local int i;
        if (Role == ROLE_Authority && A.IsA('ThieveryShopThieves') && !A.IsA('ThieveryShopThievesThiefMatch')&#4 1; {
        Shop = ThieveryShopThieves(A);
        for (i=0, i < 15, i++) {
        Shop.Melee[i].Item = MeleeWeapon[i];
        Shop.Melee[i].Cost = MeleeWeaponCost[i];
        Shop.Melee[i].Quantity = 1; // You don't really need more... do you?
        Shop.Ranged[i].Item = RangedWeapon[i];
        Shop.Ranged[i].Cost = RangedWeaponCost[i];
        Shop.Ranged[i].Quantity = RangedWeaponQuantity[i];
        Shop.Items[i].Item = Item[i];
        Shop.Items[i].Cost = ItemCost[i];
        Shop.Items[i].Quantity = ItemQuantity[i];
        Shop.ItemsLimit[i] = ItemLimit[i];
        }
        }
        return A;
        }
        [/code:1:8ba206b256]

        It's pretty much what you do anyway though, and you have all those nifty options to do with setting default inventories and overwriting types, etc.
        Immortius' Forge

        Comment


        • #5
          Originally posted by The_Dan
          Note: I have no idea what happens if your ini configuration specifies some objects in a package that is on your computer, but not the clients. However, I'd really like to know. I'm hoping that aslong as the package is defined in your ServerPackages, it should be downloaded automatically to the client, although it's never been tried yet, so who knows?
          If you specify a class in a package that the client doesn't have, every reference to that class on the client will return None. And since Spawn(None); is bound to fail, those objects wil simply not exist on the client at all. But since the server usually controls everything, things like gravity vortexes still work even tho they are invisible, as player position and death messages are replicated from the server.

          Oh, and I do believe everything in ServerPackages is required on the client for him to be able to play.

          Also, I haven't looked at your code yet, but I'm a little concerned that you might not have written the netcode so that only the server .ini settings count...
          ]V[]V[

          Comment


          • #6
            Originally posted by MortalMonkey
            Oh, and I do believe everything in ServerPackages is required on the client for him to be able to play.
            So if a scripter included his custom package in ServerPackages, would clients automatically download it (I assume this is the case), or would they just fail to connect?

            (I can't remember whether the readme I included mentioned about editing ServerPackages, but it really should do)

            (Oh, and I almost certainly forgot that LoadoutWORM itself needs to go in ServerPackages, doh!)

            Originally posted by MortalMonkey
            Also, I haven't looked at your code yet, but I'm a little concerned that you might not have written the netcode so that only the server .ini settings count...
            Replication ain't one of my strongpoints, but my understanding was this:
            -None of the functions calls in LoadoutWORM are replicated, and so they only occur on the server
            -However, all ThieveryShop variables are replicated, and so client-side ThieveryShops would be updated when the server ThieveryShops are

            Therefore, the server will do all the processing and then pass the new ThieveryShop variables down to the clients.


            However, a potential problem that I have yet to verify are:

            -I remember reading somewhere that "Spawn" function calls aren't replicated, and so when the mutator spawns a ThieveryShop (due to there being no existing one), it will receive a reference to a different ThieveryShop than the one being spawned on the client
            Potential solution: Cause the mutator to wait until the ThieveryDeathMatchPlus script has spawned a ThieveryShop, and then grab a reference to that instead of spawning a new ThieveryShop

            (I figured this is happening because the mutator PostBeginPlay is happening before the bulk of the ThieveryDeathMatchPlus PostBeginPlay, which handles the spawning of the usual ThieveryShops)

            Comment


            • #7
              Also, would anyone like to elaborate on the main difference between the following:

              var() config int Dave;

              &

              var() globalconfig int Dave;

              I assume globalconfig accesses the ini settings of the server, & config takes into account the ini settings of the actual player accessing the variables. I keep changing my mind about which way round these config types are.

              I sense I might have used the wrong config type, but since all the processing should be server-side, it shouldn't matter in this instance.


              (I seem to have blank patches here and there in my knowledge of UScript, due to learning the language by reading other peoples scripts)

              Comment


              • #8
                Originally posted by The_Dan
                -I remember reading somewhere that "Spawn" function calls aren't replicated, and so when the mutator spawns a ThieveryShop (due to there being no existing one), it will receive a reference to a different ThieveryShop than the one being spawned on the client
                Potential solution: Cause the mutator to wait until the ThieveryDeathMatchPlus script has spawned a ThieveryShop, and then grab a reference to that instead of spawning a new ThieveryShop .
                My old poison bolt mutator spawned ThieveryShops with no problem (I do test all my stuff over my LAN, despite the fact my second computer barely runs UT). I do perfer using SpawnNotify though. Either way is fine.

                Originally posted by The_Dan
                (I seem to have blank patches here and there in my knowledge of UScript, due to learning the language by reading other peoples scripts)
                Ditto.

                As far as I can tell, setting stuff as Server Packages serves two purposes.

                1. Clients will automatically download them if they don't have them (all other download related options willing - server and client set to allow downloads).
                2. Clients will load the packages. When I didn't have my poisonbolts package set as a server package, even though the client had the package, the bolts wouldn't appear.
                Immortius' Forge

                Comment


                • #9
                  Originally posted by The_Dan
                  Also, would anyone like to elaborate on the main difference between the following:

                  var() config int Dave;

                  &

                  var() globalconfig int Dave;

                  I assume globalconfig accesses the ini settings of the server, & config takes into account the ini settings of the actual player accessing the variables. I keep changing my mind about which way round these config types are.
                  When I first heard of globalconfig and config, my thoughts were the same. But Then I had doubts, as this was not how Unreal usually handled net variables. So I looked it up on UnrealWiki, and lo an behold, all a globalconfig does is to pass on the config variables to any subclasses (which config doesn't). It has nothing whatsoever to do with replication.
                  ]V[]V[

                  Comment


                  • #10
                    unfortunately the loadout worm does not have a setting for limiting ranged weapons, therefore you can not use it (from what i can tell) for limiting firebolts to 2. you can change the price, and limit items like potions, but the developers never intended on limiting any ranged weapons at all so they didn't implement it. Your mutator would have to add that functionality in for that to work.

                    Comment

                    Working...
                    X