Giving players a different loadout in the SDK



  • Hey there.
    Quick question.

    Is there a way to change someone’s complete loadout in FFA without forcing them to respawn? I’ve looked over the several Kismet nodes available and it seems that despite all of them, there’s a big range of things you still can’t do.

    My problem is this. Using the “Override pawn assets” action, I intend to change someone’s weapon to a custom skeletal mesh. Let’s say this skeletal mesh looks like an alternate version of the BROADSWORD.

    Now, to give someone this “item”, first I’ll need to give them a real Broadsword. I can’t just override their pawn assets from the start, otherwise I’ll end up replacing their Bardiche or something. Looks completely wrong.

    No, I want to first give them a Broadsword, THEN override that asset with my custom mesh.
    I’ve tried several ways and all of them have failed:


    "Change Pawn Loadout"
    0_1459605684714_Untitled-1.png
    Why doesn’t this work?
    There is no way to tell this action that I do NOT want to overwrite the player’s Family. Keeping it at ‘None’ will turn the character into a different pawn as well.
    Note that I don’t care whether or not the Broadsword given to the player overwrites ANY previous items, but a forced respawn is a no-go and I don’t want to change the player’s Family. Any class should be able to receive this item.


    "Change Pawn Loadout WITHOUT RESPAWN"
    0_1459605963509_Untitled-1.png
    Why doesn’t this work?
    This action simply doesn’t do anything in FFA (or probably any gamemode for that matter outside of TO2). A real shame since the many different changes being optional would’ve made this one perfect.


    "Change Player Weapons"
    0_1459606200163_Untitled-1.png
    Why doesn’t this work?
    Again - another very suitable action that - again - sadly doesn’t work outside of TO2.


    "Give Inventory"
    0_1459606421311_Untitled-1.png
    Why doesn’t this work?
    Well… it kinda works but is a dead end. I don’t at all mind this action overwriting the player’s previous inventory. It actually suits my needs just fine.
    HOWEVER the new item doesn’t seem to be applied to any of the old inventory slots! If a Vanguard goes through this event with a GREATSWORD in his primary slot, a SHORTSWORD in his secondary slot and SMOKE POTS in his tertiary slot, none of his weapons will actually be replaced.
    What happens is that he’ll switch to a Broadsword while his old items like the Greatsword or Shortsword (depending on whichever one he wasn’t holding during activation) will remain on his back or hip, unsheathed.
    That’s okay.
    But then the Override Pawn Assets action has no way to target the Broadsword. It’s like it was placed in an secret extra slot. The Override Pawn Assets action can only replace the weapon meshes in the 1st, 2nd or 3rd slot and attempting to do so will only just screw up the inactive Greatsword, Shortsword and Smoke Pots on the Vanguard. The new Broadsword remains unchanged.


    I’ve also tried a complicated method and subpar method that involves doing this WITHOUT giving the player an inventory item but checking whether or not he already has it so it can be replaced.
    Again - impossible in every direction. There’s 2 necessary Kismet conditions missing to do this. A way to check the player’s CLASS or a way to check which SLOT a player currently has equipped.
    If I could check for whether the player is a Knight, then I would know that if he’s carrying a Broadsword in his inventory (this is an existing Kismet condition) then his SECONDARY weapon’s mesh needs to be overridden. For the Man at Arms, that’d be the FIRST.

    But there’s no way to check for a player’s CLASS in Kismet (come on, TBS…).
    So the other possible alternative would be to check for which inventory slot they are currently on.
    You can check for whether or not they’re holding a Broadsword at the moment. Now if only you could check whether or not it’s in their FIRST slot or their SECOND slot. Alas, impossible.


    Does anyone know how to get around these issues?

    All I need to do is replace someone’s Broadsword mesh in a custom FFA map. I don’t want to use mods.
    It currently seems impossible to me to either give someone a weapon and then apply the Override Pawn Assets to said weapon, or to check which slot has a particular weapon in it.



  • I would suggest TB wouldn’t allow this as it changes the core game no? What would stop some mod maker making
    a mod were any players could use any weapons otherwise regardless of classes. Could you imagine fighting an
    maa with those fast long ranged vanguard swords hehe.



  • In Hordetown you could pick up a new weapon without having to respawn, not sure if you have access to that code.



  • @loin I think you are missing the point of a mod



  • This is the same issue i’ve tried dealing with, but failed. This is why i just started using TO2.

    @Eggplant or @Hordy might have some ideas though.



  • It’s a real shame because there’s various very simple changes a developer might make to one of the Kismet actions that opens up a whole world of possibilities for mapmakers, but currently it’s just a dead end.

    Allowing any of the different TO2 inventory actions to work in other gamemodes as well would be the easiest fix.
    Alternatively, the addition of a “IS CLASS?” condition in Kismet could solve various other problems as well.

    @loin said:

    I would suggest TB wouldn’t allow this as it changes the core game no? What would stop some mod maker making
    a mod were any players could use any weapons otherwise regardless of classes. Could you imagine fighting an
    maa with those fast long ranged vanguard swords hehe.

    That’s already possible with the existing Kismet actions. All I ask is the ability to also change the skin of said weapons.
    I think you have a valid point Loin, but it’s just that people go into custom maps expecting unique shit to behold.
    If it were vanilla then god no, I wouldn’t want to be fighting Men at Arms with a Spear either.

    @Vesanus said:

    This is the same issue i’ve tried dealing with, but failed. This is why i just started using TO2.

    You’re the author of the Random Dungeon map, right? It was great, and I opened up your map in the UDK as an example to see what syntax the ‘Override Pawn Assets’ expects in the different path textfields. You’re the reason I made it this far to begin with. I hope you don’t mind :>



  • It would be fun to see Knights with full tower shields using bow , arrows behind them or crossbows, Although
    TB might release this info in view of the fact they are on the next game shortly. I was making some kind of thing mr G
    however due to taking to much time off completely forgot how to use the sdk/kisment softare editor.

    Lastly edit: I would add that TB could allow it but if it some modders got silly they could easily turn it off in the core program.
    After all its likely to be some switches in the final code they have.



  • @Rickvs said:

    But there’s no way to check for a player’s CLASS in Kismet (come on, TBS…).

    There is. Check this out:

    0_1459624088542_test_class.png

    The first property retieved is the ‘pawn’.

    Otherwise I suggest to switch the game mode or use unrealscript if Kismet does not provide the functionality.



  • This is fairly easy to do in a TO2 map, but for other game modes it is trickier to do but possible. I did basically the same thing as what you’re attempting to do here in my Random Weapon maps – A few of the random loadouts have custom skins, like a Longsword reskinned as a Katana.

    The problem with your first screenshot is that Change Pawn Loadout will cause the pawn to respawn. So when you call Override Pawn Assets afterwards, the object variable will not be referencing the player’s new pawn but the old pawn that no longer exists. To get around this you need to call Change Pawn Loadout, acquire the new pawn into an object variable through some means, and then call Override Pawn Assets.

    There is also another issue with Change Pawn Loadout that you need to be aware of. In a non-TO2 map, as far as I could tell Change Pawn Loadout will not let you change a pawn’s loadout to something that is impossible for that class to spawn with normally. It will allow you to do this when running the map within the editor but on a sever they will simply respawn with the class’s default loadout instead. So for example you cannot have a Vanguard spawn with a Broadsword. You would need to have them respawn as a Knight or MAA, with all 3 weapon slots using something that is possible for them to spawn with, call Switch Weapons to force them to switch to secondary (if Knight not MAA), and call Toggle Inputs to prevent them from switching to one of their other weapons. Toggle Inputs will however persist even after they die and respawn, so you will need to re-enable the inputs after they respawn unless you want them to never be able to switch weapons again.



  • @Eggplant But is it allowed, according to Loin modders should not modify anything “I would add that TB could allow it but if it some modders got silly they could easily turn it off in the core program.” What if something silly was added??? TBS might have to disable the mod !!! Obviously something sillier than laser swords or giants running around which are long standing mods… oh wait is loin just creating issues that dont exist?



  • @gregcau
    Laser Sword and Giant Slayers are mods, not custom maps. I am under the impression that Rickvs is making a custom map here, not a mod. I was talking specifically about the Change Pawn Loadout function that is available to use within custom maps, not what is possible in general through mods or other means.



  • @Eggplant Ah I see, my noobness shows.