Cloning Inventory? [SINGLEPLAYER]

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Cloning Inventory? [SINGLEPLAYER]

Postby ~DJ~ » Mon Feb 04, 13 5:37 am

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:
Last edited by ~DJ~ on Mon Feb 04, 13 5:38 am, edited 1 time in total.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby Poor » Mon Feb 04, 13 10:55 pm

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.
Poor
Poster
 
Posts: 190
Joined: Tue Jan 04, 11 7:42 pm

Postby ~DJ~ » Tue Feb 05, 13 2:47 am

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
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 10 guests