Page 1 of 1

Cloning Inventory? [SINGLEPLAYER]

PostPosted: Mon Feb 04, 13 5:37 am
by ~DJ~
HAI.

So.. yeah.
I have a custom AI/Bot/Pawn.
I want to clone our Inventory (weapons) and give the copies of our weapon(s) to the AI.

The way I'm doing it, it deletes our weapons as the function 'AddInventory' calls to DeleteInventory from there. I tried overriding the AddInventory function, commenting out that part but it crashes if I do so with some 'loop' error.

Anyone got a clue on how I can do it?
THANKS. :oops:

PostPosted: Mon Feb 04, 13 10:55 pm
by Poor
Two Actors shouldn't have the same item in their Inventory chains. Instead you have to spawn new ones for each Actor. With weapons, you also have to spawn and assign the ammunition. InitializeInventory() in ScriptedPawn shows you how to properly give a pawn a weapon. I also have the code for it in my clone aug if you want.

PostPosted: Tue Feb 05, 13 2:47 am
by ~DJ~
lmao, I AM working on a clone-aug. :lol:

thanks for that, I'll look into that.
I'll respond back if I fail at it, steal your code etc. THANKS! :D