Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Omniraptor's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    278
    Reputation
    13
    Thanks
    431
    My Mood
    Inspired

    Lightbulb [Tutorial] How to add backpacks to your As3 Client

    Some of this is probably irrelevant to backpacks or it might be missing something still. It's impossible for me to do any further testing until the server side is working correctly first.

    Once the server side of things are working I can test this further and fix it if need be.

    Right now the character state is not saving when a backpack is used. Once you move to a new map the backpack tab will vanish.

    You'll need the Stats Tab mod installed first before adding any of this.

    Step 1

    Insert this Backpack XML into both the client and server somewhere. Make sure the backpack image is also embedded in the correct sprite sheet.

    Code:
      <Object type="0x1962" id="Backpack">
        <Class>Equipment</Class>
        <Item />
        <Texture>
          <File>lofiObj3</File>
          <Index>0x315</Index>
        </Texture>
        <SlotType>10</SlotType>
        <Description>A backpack that will double your inventory space.</Description>
        <Sound>spell/light_heal</Sound>
        <Activate>Backpack</Activate>
        <Consumable />
        <Backpack />
        <BagType>2</BagType>
        <Soulbound />
      </Object>
    Step 2

    Navigate to src\com\company\assembleegameclient\net\messages\d ata\StatData.as

    Find this:

    Code:
     public static const _5J_:int = 64;
            public static const _bk:int = 65;
            public static const SKIN_STAT:int = 66;
    Add this after :

    Code:
            public static const BACKPACK_0_STAT:int = 67;
            public static const BACKPACK_1_STAT:int = 68;
            public static const BACKPACK_2_STAT:int = 69;
            public static const BACKPACK_3_STAT:int = 70;
            public static const BACKPACK_4_STAT:int = 71;
            public static const BACKPACK_5_STAT:int = 72;
            public static const BACKPACK_6_STAT:int = 73;
            public static const BACKPACK_7_STAT:int = 74;
    Find this:

    Code:
    public function _I_3():Boolean{
                switch (this._0F_4)
                {
                    case _hK_:
                    case _07q:
                        return (true);
                };
                return (false);
            }
    Change to this:

    Code:
    public function _I_3():Boolean{
                switch (this._0F_4)
                {
                    case _hK_:
                    case _07q:
                    case BACKPACK_0_STAT:
                    case BACKPACK_1_STAT:
                    case BACKPACK_2_STAT:
                    case BACKPACK_3_STAT:
                    case BACKPACK_4_STAT:
                    case BACKPACK_5_STAT:
                    case BACKPACK_6_STAT:
                    case BACKPACK_7_STAT:
                        return (true);
                };
                return (false);
            }
    Step 3

    Navigate to src\com\company\assembleegameclient\objects\GameOb ject.as

    Find this and add the line in bold:

    Code:
     public var _81:int = -1;
            public var _ai:int = 0;
            public var _9A_:Vector.<int> = null;
            public var equipData_:Vector.<int> = null;
            public var backpack_:Vector.<Object> = null;
            public var _9B_:uint = 0;
            protected var tex1Id_:int = 0;
            protected var tex2Id_:int = 0;
    Find this and add the lines in bold:

    Code:
    if (_arg1.hasOwnProperty("SlotTypes"))
                {
                    this._9A_ = ConversionUtil._04n(_arg1.SlotTypes);
                    this.equipData_ = new Vector.<int>(this._9A_.length);
                    this.backpack_ = new Vector.<Object>(this._9A_.length);
                    _local4 = 0;
                    while (_local4 < this.equipData_.length)
                    {
                        this.equipData_[_local4] = -1;
                        this.backpack_[_local4] = -1;
                        _local4++;
                    };
                };
    Step 4

    Navigate to src\com\company\assembleegameclient\ui\Inventory.a s

    Find this and add the line in bold:

    Code:
    public var gs_:GameSprite;
        public var _iA_:GameObject;
        public var _A_H_:String;
        public var invsize_:int;
        public var slots_:Vector.<_E_6>;
        public var equipment_:Boolean;
        public var backpack_:Boolean;
        protected var fill_:GraphicsSolidFill;
        protected var path_:GraphicsPath;
        private var graphicsData_:Vector.<IGraphicsData>;
    Replace this function:

    Code:
    public function Inventory(_arg1:GameSprite, _arg2:GameObject, _arg3:String, _arg4:Vector.<int>, _arg5:int, _arg6:Boolean, _offset:int=0, _equipment:Boolean=false):void
        {
            var _local8:_E_6;
            var _local7:int;
            var _local10:int;
            this.slots_ = new Vector.<_E_6>();
            this.fill_ = new GraphicsSolidFill(0x545454);
            this.path_ = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
            this.graphicsData_ = new <IGraphicsData>[this.fill_, this.path_, GraphicHelper.END_FILL];
            super();
            this.gs_ = _arg1;
            this._iA_ = _arg2;
            this._A_H_ = _arg3;
            this.invsize_ = _arg5;
            this.equipment_ = _equipment;
            if (((_arg1) && ((_arg2 == this.gs_.map_.player_))))
            {
                this.gs_.map_.player_.inventory = this;
            };
            while (_local7 < _arg5)
            {
                _local10 = (_local7 + _offset);
                _local8 = new _E_6(this, _local10, _arg4[_local7], ((_arg6) ? (_local10 - 3) : -1), _ls[_arg4.length][_local7], _equipment);
                _local8.x = (int((_local7 % 4)) * (Slot.WIDTH + 4));
                _local8.y = (int((_local7 / 4)) * (Slot.HEIGHT + 4));
                this.slots_.push(_local8);
                addChild(_local8);
                _local7++;
            };
        }
    With this:

    Code:
    public function Inventory(_arg1:GameSprite, _arg2:GameObject, _arg3:String, _arg4:Vector.<int>, _arg5:int, _arg6:Boolean, _offset:int=0, _equipment:Boolean=false, _backpack:Boolean=false):void
        {
            var _local8:_E_6;
            var _local7:int;
            var _local10:int;
            this.slots_ = new Vector.<_E_6>();
            this.fill_ = new GraphicsSolidFill(0x545454);
            this.path_ = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
            this.graphicsData_ = new <IGraphicsData>[this.fill_, this.path_, GraphicHelper.END_FILL];
            super();
            this.gs_ = _arg1;
            this._iA_ = _arg2;
            this._A_H_ = _arg3;
            this.invsize_ = _arg5;
            this.equipment_ = _equipment;
            this.backpack_ = _backpack;
            if (((_arg1) && ((_arg2 == this.gs_.map_.player_))))
            {
                this.gs_.map_.player_.inventory = this;
            };
            while (_local7 < _arg5)
            {
                _local10 = (_local7 + _offset);
                _local8 = new _E_6(this, _local10, _arg4[_local7], ((_arg6) ? (_local10 - 3) : -1), _ls[_arg4.length][_local7], _equipment);
                _local8.x = (int((_local7 % 4)) * (Slot.WIDTH + 4));
                _local8.y = (int((_local7 / 4)) * (Slot.HEIGHT + 4));
                this.slots_.push(_local8);
                addChild(_local8);
                _local7++;
            };
        }
    Step 5

    Navigate to src\com\company\assembleegameclient\ui\_E_6.as

    Replace this function:

    Code:
    public function attemptUse():void{
                var tmp:_T_W_;
                var _local1:XML = ObjectLibrary._Q_F_[this.objectType_];
                if (_local1 == null)
                {
                    return;
                };
                var _local2:Player = this._e9.gs_.map_.player_;
                if ((((_local2 == null)) || (_local2.isPaused())))
                {
                    return;
                };
                var _local3:Boolean = _local1.hasOwnProperty("Consumable");
                var _local4:Boolean = _local1.hasOwnProperty("InvUse");
                if (((!(_local3)) && (!(_local4))))
                {
                    return;
                };
                if (_local3)
                {
                    if (this._04q)
                    {
                        return;
                    };
                    this._04q = true;
                };
                this._e9.gs_.gsc_.useItem(getTimer(), this._e9._iA_.objectId_, thi*****_, this.objectType_, 0, 0);
                _5T_.play("use_potion");
                this._X_6();
            }
    With this:

    Code:
    public function attemptUse():void{
                var tmp:_T_W_;
                var _local1:XML = ObjectLibrary._Q_F_[this.objectType_];
                if (_local1 == null)
                {
                    return;
                };
                var _local2:Player = this._e9.gs_.map_.player_;
                if ((((_local2 == null)) || (_local2.isPaused())))
                {
                    return;
                };
                trace(_local1.@id);
                if (_local1.@id == "Backpack")
                {
                    tmp = _T_W_(this._e9.parent.parent.parent);
                    tmp.addBackpackTab();
                }
                var _local3:Boolean = _local1.hasOwnProperty("Consumable");
                var _local4:Boolean = _local1.hasOwnProperty("InvUse");
                if (((!(_local3)) && (!(_local4))))
                {
                    return;
                };
                if (_local3)
                {
                    if (this._04q)
                    {
                        return;
                    };
                    this._04q = true;
                };
                this._e9.gs_.gsc_.useItem(getTimer(), this._e9._iA_.objectId_, thi*****_, this.objectType_, 0, 0);
                _5T_.play("use_potion");
                this._X_6();
            }
    Step 6

    Navigate to src\com\company\assembleegameclient\ui\_T_W_.as

    Replace the entire thing with this (I made several changes here so easier for me to paste the entire thing):

    Code:
    package com.company.assembleegameclient.ui
    {
    import flash.display.Sprite;
    import com.company.assembleegameclient.game.GameSprite;
    import com.company.assembleegameclient.objects.Player;
    import flash.display.Bitmap;
    import com.company.ui.SimpleText;
    import flash.filters.DropShadowFilter;
    import com.company.assembleegameclient.parameters.Parameters;
    import com.company.util.AssetLibrary;
    import flash.events.MouseEvent;
    import _0C_P_.Options;
     
    public class _T_W_ extends Sprite
    {
     
        public var equips_:Inventory;
        public var _e9:Inventory;
        public var pack_:Inventory;
        public var _0E__:int;
        private var gs_:GameSprite;
        private var go_:Player;
        private var w_:int;
        private var h_:int;
        private var _tm:Bitmap;
        private var nameText_:SimpleText;
        private var _L_P_:Sprite;
        private var _nw:_rN_ = null;
        private var _sI_:_0M_Y_;
        private var _U_U_:_0M_Y_;
        private var _023:_0M_Y_;
        private var _F_C_:_0M_Y_;
        private var stats:Stats;
        private var backpackTab_:TabButton;
        private var invTab_:TabButton;
        private var statTab_:TabButton;
        private var tabBG_:TabBackground;
        private var tabList_:Array;
        private var selectedTab_:int = 0;
        private var stackPots:Boolean = false;
     
        public function _T_W_(_arg1:GameSprite, _arg2:Player, _arg3:int, _arg4:int)
        {
            this.gs_ = _arg1;
            this.go_ = _arg2;
            this.w_ = _arg3;
            this.h_ = _arg4;
            this._tm = new Bitmap(null);
            this._tm.x = -2;
            this._tm.y = -10;
            addChild(this._tm);
            this.nameText_ = new SimpleText(20, 0xB3B3B3, false, 0, 0, "Myriad Pro");
            this.nameText_.setBold(true);
            this.nameText_.x = 36;
            this.nameText_.y = -2;
            if (this.gs_.charList_.name_ == null)
            {
                this.nameText_.text = this.go_.name_;
            }
            else
            {
                this.nameText_.text = this.gs_.charList_.name_;
            };
            this.nameText_.updateMetrics();
            this.nameText_.filters = [new DropShadowFilter(0, 0, 0)];
            addChild(this.nameText_);
            if (this.gs_.gsc_.gameId_ != Parameters.NEXUS_ID)
            {
                this._nw = new _rN_(AssetLibrary._xK_("lofiInterfaceBig", 6), "Nexus", "escapeToNexus");
                this._nw.addEventListener(MouseEvent.CLICK, this._Q_C_);
                this._nw.x = 172;
                this._nw.y = 2;
                addChild(this._nw);
            }
            else
            {
                this._nw = new _rN_(AssetLibrary._xK_("lofiInterfaceBig", 5), "Options", "options");
                this._nw.addEventListener(MouseEvent.CLICK, this._nD_);
                this._nw.x = 172;
                this._nw.y = 2;
                addChild(this._nw);
            };
            this._sI_ = new _0M_Y_(176, 16, 5931045, 0x545454, "Lvl X");
            this._sI_.x = 12;
            this._sI_.y = 30;
            addChild(this._sI_);
            this._sI_.visible = true;
            this._U_U_ = new _0M_Y_(176, 16, 0xE25F00, 0x545454, "Fame");
            this._U_U_.x = 12;
            this._U_U_.y = 30;
            addChild(this._U_U_);
            this._U_U_.visible = false;
            this._023 = new _0M_Y_(176, 16, 14693428, 0x545454, "HP");
            this._023.x = 12;
            this._023.y = 54;
            addChild(this._023);
            this._F_C_ = new _0M_Y_(176, 16, 6325472, 0x545454, "MP");
            this._F_C_.x = 12;
            this._F_C_.y = 78;
            addChild(this._F_C_);
            this.equips_ = new Inventory(_arg1, _arg2, "Inventory", _arg2._9A_.slice(0, 4), 4, true, 0, true);
            this.equips_.x = 14;
            this.equips_.y = 104;
            addChild(this.equips_);
            this.tabList_ = [];
            this.invTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 32), true, 0);
            this.invTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.invTab_.x = 7;
            this.invTab_.y = 152;
            addChild(this.invTab_);
            this.tabList_[0] = this.invTab_;
            this.statTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 33), false, 1);
            this.statTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.statTab_.x = 35;
            this.statTab_.y = 152;
            addChild(this.statTab_);
            this.tabList_[1] = this.statTab_;
            this.backpackTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 34), false, 2);
            this._e9 = new Inventory(_arg1, _arg2, "Inventory", _arg2._9A_.slice(4), 8, true, 4);
            this._e9.x = 7;
            this._e9.y = 7;
            this.invTab_.holder_.addChild(this._e9);
            this.stats = new Stats(191, 45);
            this.stats.x = 6;
            this.stats.y = 7;
            this.statTab_.holder_.addChild(this.stats);
            this.pack_ = new Inventory(_arg1, _arg2, "InventoryBackpack", _arg2._9A_.slice(4), 8, true, 4);
            mouseEnabled = false;
            this.setChildIndex(this.invTab_, (this.numChildren - 1));
            this.draw();
        }
     
        public function addBackpackTab():void
        {
            trace("I should be called by the health potion");
            this.backpackTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.backpackTab_.x = 63;
            this.backpackTab_.y = 152;
            addChild(this.backpackTab_);
            this.tabList_[2] = this.backpackTab_;
            this.pack_.x = 7;
            this.pack_.y = 7;
            this.backpackTab_.holder_.addChild(this.pack_);
            this.setChildIndex(this.backpackTab_, 0);
        }
     
        public function setName(_arg1:String):void
        {
            this.nameText_.text = _arg1;
            this.nameText_.updateMetrics();
        }
     
        public function nextTab():void
        {
            if ((this.selectedTab_ + 1) == this.tabList_.length)
            {
                this.switchTab((this.tabList_[0] as TabButton));
            }
            else
            {
                this.switchTab((this.tabList_[(this.selectedTab_ + 1)] as TabButton));
            };
        }
     
        public function switchTab(_tab:TabButton):void
        {
            var _i:TabButton;
            if (_tab.selected_)
            {
                return;
            };
            for each (_i in this.tabList_)
            {
                _i.setSelected(false);
            };
            _tab.setSelected(true);
            this.selectedTab_ = _tab.tabId_;
            this.setChildIndex(_tab, (this.numChildren - 1));
        }
     
        public function draw():void
        {
            this._tm.bitmapData = this.go_.getPortrait();
            var _local1:String = ("Lvl " + this.go_._81);
            if (_local1 != this._sI_.labelText_.text)
            {
                this._sI_.labelText_.text = _local1;
                this._sI_.labelText_.updateMetrics();
            };
            if (this.go_._81 != 20)
            {
                if (!(this._sI_.visible))
                {
                    this._sI_.visible = true;
                    this._U_U_.visible = false;
                };
                this._sI_.draw(this.go_.exp_, this.go_._7V_, 0);
                if (this._0E__ != this.go_._gz)
                {
                    this._0E__ = this.go_._gz;
                    this._sI_._Y_r(this._0E__, this.go_._gz);
                };
            }
            else
            {
                if (!(this._U_U_.visible))
                {
                    this._U_U_.visible = true;
                    this._sI_.visible = false;
                };
                this._U_U_.draw(this.go_._0L_o, this.go_._n8, 0);
            };
            this._023.draw(this.go_._aY_, this.go_._L_T_, this.go_._P_7, this.go_._uR_);
            this._F_C_.draw(this.go_._86, this.go_._a7, this.go_._0D_G_, this.go_._dt);
            this.stats.draw(this.go_);
            this.equips_.draw(this.go_.equipData_.slice(0, 4));
            this._e9.draw(this.go_.equipData_.slice(4));
        }
     
        public function destroy():void
        {
        }
     
        private function _Q_C_(_arg1:MouseEvent):void
        {
            this.gs_.gsc_._M_6();
            Parameters.data_.needsRandomRealm = false;
            Parameters.save();
        }
     
        private function _nD_(_arg1:MouseEvent):void
        {
            this.gs_.mui_.clearInput();
            this.gs_.addChild(new Options(this.gs_));
        }
     
        private function onTabClick(me:MouseEvent):void
        {
            if ((me.target is TabButton))
            {
                this.switchTab((me.target as TabButton));
            };
        }
     
     
    }
    }//package com.company.assembleegameclient.ui
    Step 7

    Navigate to src\com\company\assembleegameclient\net\_1f.as

    Look for this:

    Code:
    case StatData.INVENTORY_0_STAT:
                        case StatData.INVENTORY_1_STAT:
                        case StatData.INVENTORY_2_STAT:
                        case StatData.INVENTORY_3_STAT:
                        case StatData.INVENTORY_4_STAT:
                        case StatData.INVENTORY_5_STAT:
                        case StatData.INVENTORY_6_STAT:
                        case StatData.INVENTORY_7_STAT:
                        case StatData.INVENTORY_8_STAT:
                        case StatData.INVENTORY_9_STAT:
                        case StatData.INVENTORY_10_STAT:
                        case StatData.INVENTORY_11_STAT:
                            _arg1.equipData_[(_local4._0F_4 - StatData.INVENTORY_0_STAT)] = _local4._h;
                            break;
    Add this directly underneath:

    Code:
                        case StatData.BACKPACK_0_STAT:
                        case StatData.BACKPACK_1_STAT:
                        case StatData.BACKPACK_2_STAT:
                        case StatData.BACKPACK_3_STAT:
                        case StatData.BACKPACK_4_STAT:
                        case StatData.BACKPACK_5_STAT:
                        case StatData.BACKPACK_6_STAT:
                        case StatData.BACKPACK_7_STAT:
                           _arg1.backpack_[(_local4._0F_4 - StatData.BACKPACK_0_STAT)] = _local4._h;
                            break;
    p.s snuffleugapus made dis
    any news on dj manual knees?

  2. #2
    sacredmike's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    Uranus ;)
    Posts
    685
    Reputation
    15
    Thanks
    3,255
    My Mood
    Devilish
    Who knows if Snuffle made it.. Probably made by @Kithio and @Club559 again.
    i'm actually just a horny boy

  3. #3
    Omniraptor's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    278
    Reputation
    13
    Thanks
    431
    My Mood
    Inspired
    Quote Originally Posted by sacredmike View Post
    Who knows if Snuffle made it.. Probably made by @Kithio and @Club559 again.
    i know nothing
    any news on dj manual knees?

  4. #4
    Snuffleupagus's Avatar
    Join Date
    Dec 2014
    Gender
    female
    Posts
    54
    Reputation
    10
    Thanks
    76
    This really wasn't meant to be shared yet otherwise I would have just posted it.

    It needs work still, I'd advise not to use this yet.

  5. #5
    Travoos's Avatar
    Join Date
    Jul 2012
    Gender
    female
    Posts
    282
    Reputation
    23
    Thanks
    649
    My Mood
    Tired
    I'd also like to point out equipData_ isn't the correct variable name, it's actually _zq
    At first I thought that variable was popping up from the Seraphs' Dominion client but it's actually just renamed

    Quote Originally Posted by sacredmike View Post
    Who knows if Snuffle made it.. Probably made by @Kithio and @Club559 again.
    Actually not this time, @Kithio was being too strict and being like "you HAVE to make backpacks this EXACT WAY or they shouldn't be added" so I just gave up on making backpacks
    Last edited by Travoos; 02-21-2015 at 07:24 PM.

  6. The Following 4 Users Say Thank You to Travoos For This Useful Post:

    KieronZeCoder69 (02-22-2015),sacredmike (02-21-2015),TJRAE%TJAJAZetjtjtjjt (03-11-2015),toby2449 (03-01-2015)

  7. #6
    sacredmike's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    Uranus ;)
    Posts
    685
    Reputation
    15
    Thanks
    3,255
    My Mood
    Devilish
    Quote Originally Posted by Club559 View Post
    I'd also like to point out equipData_ isn't the correct variable name, it's actually _zq
    At first I thought that variable was popping up from the Seraphs' Dominion client but it's actually just renamed
    Yeah, I figured that out. But, this code barely works and won't even let me connect to nexus.
    i'm actually just a horny boy

  8. #7
    Snuffleupagus's Avatar
    Join Date
    Dec 2014
    Gender
    female
    Posts
    54
    Reputation
    10
    Thanks
    76
    This shouldn't stop you from logging into Nexus or anything like that. I've tested this on the latest Phoenix source due to it already having some backpack code, which might be the reason why you're having trouble connecting to whatever source you are using.

  9. #8
    Kithio's Avatar
    Join Date
    May 2014
    Gender
    male
    Posts
    641
    Reputation
    16
    Thanks
    804
    My Mood
    Innocent
    Quote Originally Posted by Snuffleupagus View Post
    This shouldn't stop you from logging into Nexus or anything like that. I've tested this on the latest Phoenix source due to it already having some backpack code, which might be the reason why you're having trouble connecting to whatever source you are using.
    I saw your thread about backpacks, I like it... Pretty nice seeing you step up from the seraphs client and making content that was not copied ;3

    +1

     


    I is pansexual furry and proud

    Server Information:
    Status: Confused

  10. The Following 2 Users Say Thank You to Kithio For This Useful Post:

    [MPGH]Ahl (02-21-2015),sacredmike (02-21-2015)

  11. #9
    sacredmike's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    Uranus ;)
    Posts
    685
    Reputation
    15
    Thanks
    3,255
    My Mood
    Devilish
    Quote Originally Posted by Snuffleupagus View Post
    This shouldn't stop you from logging into Nexus or anything like that. I've tested this on the latest Phoenix source due to it already having some backpack code, which might be the reason why you're having trouble connecting to whatever source you are using.
    I'm not using Creepylava source.. I'm using MMOE's source. Maybe that's my problem? But, it's not like it matters.

    - - - Updated - - -

    Quote Originally Posted by Kithio View Post


    So cute.
    i'm actually just a horny boy

  12. #10
    Slendergo's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    382
    Reputation
    17
    Thanks
    250
    My Mood
    Inspired
    Quote Originally Posted by Darkfark View Post
    Some of this is probably irrelevant to backpacks or it might be missing something still. It's impossible for me to do any further testing until the server side is working correctly first.

    Once the server side of things are working I can test this further and fix it if need be.

    Right now the character state is not saving when a backpack is used. Once you move to a new map the backpack tab will vanish.

    You'll need the Stats Tab mod installed first before adding any of this.

    Step 1

    Insert this Backpack XML into both the client and server somewhere. Make sure the backpack image is also embedded in the correct sprite sheet.

    Code:
      <Object type="0x1962" id="Backpack">
        <Class>Equipment</Class>
        <Item />
        <Texture>
          <File>lofiObj3</File>
          <Index>0x315</Index>
        </Texture>
        <SlotType>10</SlotType>
        <Description>A backpack that will double your inventory space.</Description>
        <Sound>spell/light_heal</Sound>
        <Activate>Backpack</Activate>
        <Consumable />
        <Backpack />
        <BagType>2</BagType>
        <Soulbound />
      </Object>
    Step 2

    Navigate to src\com\company\assembleegameclient\net\messages\d ata\StatData.as

    Find this:

    Code:
     public static const _5J_:int = 64;
            public static const _bk:int = 65;
            public static const SKIN_STAT:int = 66;
    Add this after :

    Code:
            public static const BACKPACK_0_STAT:int = 67;
            public static const BACKPACK_1_STAT:int = 68;
            public static const BACKPACK_2_STAT:int = 69;
            public static const BACKPACK_3_STAT:int = 70;
            public static const BACKPACK_4_STAT:int = 71;
            public static const BACKPACK_5_STAT:int = 72;
            public static const BACKPACK_6_STAT:int = 73;
            public static const BACKPACK_7_STAT:int = 74;
    Find this:

    Code:
    public function _I_3():Boolean{
                switch (this._0F_4)
                {
                    case _hK_:
                    case _07q:
                        return (true);
                };
                return (false);
            }
    Change to this:

    Code:
    public function _I_3():Boolean{
                switch (this._0F_4)
                {
                    case _hK_:
                    case _07q:
                    case BACKPACK_0_STAT:
                    case BACKPACK_1_STAT:
                    case BACKPACK_2_STAT:
                    case BACKPACK_3_STAT:
                    case BACKPACK_4_STAT:
                    case BACKPACK_5_STAT:
                    case BACKPACK_6_STAT:
                    case BACKPACK_7_STAT:
                        return (true);
                };
                return (false);
            }
    Step 3

    Navigate to src\com\company\assembleegameclient\objects\GameOb ject.as

    Find this and add the line in bold:

    Code:
     public var _81:int = -1;
            public var _ai:int = 0;
            public var _9A_:Vector.<int> = null;
            public var equipData_:Vector.<int> = null;
            public var backpack_:Vector.<Object> = null;
            public var _9B_:uint = 0;
            protected var tex1Id_:int = 0;
            protected var tex2Id_:int = 0;
    Find this and add the lines in bold:

    Code:
    if (_arg1.hasOwnProperty("SlotTypes"))
                {
                    this._9A_ = ConversionUtil._04n(_arg1.SlotTypes);
                    this.equipData_ = new Vector.<int>(this._9A_.length);
                    this.backpack_ = new Vector.<Object>(this._9A_.length);
                    _local4 = 0;
                    while (_local4 < this.equipData_.length)
                    {
                        this.equipData_[_local4] = -1;
                        this.backpack_[_local4] = -1;
                        _local4++;
                    };
                };
    Step 4

    Navigate to src\com\company\assembleegameclient\ui\Inventory.a s

    Find this and add the line in bold:

    Code:
    public var gs_:GameSprite;
        public var _iA_:GameObject;
        public var _A_H_:String;
        public var invsize_:int;
        public var slots_:Vector.<_E_6>;
        public var equipment_:Boolean;
        public var backpack_:Boolean;
        protected var fill_:GraphicsSolidFill;
        protected var path_:GraphicsPath;
        private var graphicsData_:Vector.<IGraphicsData>;
    Replace this function:

    Code:
    public function Inventory(_arg1:GameSprite, _arg2:GameObject, _arg3:String, _arg4:Vector.<int>, _arg5:int, _arg6:Boolean, _offset:int=0, _equipment:Boolean=false):void
        {
            var _local8:_E_6;
            var _local7:int;
            var _local10:int;
            this.slots_ = new Vector.<_E_6>();
            this.fill_ = new GraphicsSolidFill(0x545454);
            this.path_ = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
            this.graphicsData_ = new <IGraphicsData>[this.fill_, this.path_, GraphicHelper.END_FILL];
            super();
            this.gs_ = _arg1;
            this._iA_ = _arg2;
            this._A_H_ = _arg3;
            this.invsize_ = _arg5;
            this.equipment_ = _equipment;
            if (((_arg1) && ((_arg2 == this.gs_.map_.player_))))
            {
                this.gs_.map_.player_.inventory = this;
            };
            while (_local7 < _arg5)
            {
                _local10 = (_local7 + _offset);
                _local8 = new _E_6(this, _local10, _arg4[_local7], ((_arg6) ? (_local10 - 3) : -1), _ls[_arg4.length][_local7], _equipment);
                _local8.x = (int((_local7 % 4)) * (Slot.WIDTH + 4));
                _local8.y = (int((_local7 / 4)) * (Slot.HEIGHT + 4));
                this.slots_.push(_local8);
                addChild(_local8);
                _local7++;
            };
        }
    With this:

    Code:
    public function Inventory(_arg1:GameSprite, _arg2:GameObject, _arg3:String, _arg4:Vector.<int>, _arg5:int, _arg6:Boolean, _offset:int=0, _equipment:Boolean=false, _backpack:Boolean=false):void
        {
            var _local8:_E_6;
            var _local7:int;
            var _local10:int;
            this.slots_ = new Vector.<_E_6>();
            this.fill_ = new GraphicsSolidFill(0x545454);
            this.path_ = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
            this.graphicsData_ = new <IGraphicsData>[this.fill_, this.path_, GraphicHelper.END_FILL];
            super();
            this.gs_ = _arg1;
            this._iA_ = _arg2;
            this._A_H_ = _arg3;
            this.invsize_ = _arg5;
            this.equipment_ = _equipment;
            this.backpack_ = _backpack;
            if (((_arg1) && ((_arg2 == this.gs_.map_.player_))))
            {
                this.gs_.map_.player_.inventory = this;
            };
            while (_local7 < _arg5)
            {
                _local10 = (_local7 + _offset);
                _local8 = new _E_6(this, _local10, _arg4[_local7], ((_arg6) ? (_local10 - 3) : -1), _ls[_arg4.length][_local7], _equipment);
                _local8.x = (int((_local7 % 4)) * (Slot.WIDTH + 4));
                _local8.y = (int((_local7 / 4)) * (Slot.HEIGHT + 4));
                this.slots_.push(_local8);
                addChild(_local8);
                _local7++;
            };
        }
    Step 5

    Navigate to src\com\company\assembleegameclient\ui\_E_6.as

    Replace this function:

    Code:
    public function attemptUse():void{
                var tmp:_T_W_;
                var _local1:XML = ObjectLibrary._Q_F_[this.objectType_];
                if (_local1 == null)
                {
                    return;
                };
                var _local2:Player = this._e9.gs_.map_.player_;
                if ((((_local2 == null)) || (_local2.isPaused())))
                {
                    return;
                };
                var _local3:Boolean = _local1.hasOwnProperty("Consumable");
                var _local4:Boolean = _local1.hasOwnProperty("InvUse");
                if (((!(_local3)) && (!(_local4))))
                {
                    return;
                };
                if (_local3)
                {
                    if (this._04q)
                    {
                        return;
                    };
                    this._04q = true;
                };
                this._e9.gs_.gsc_.useItem(getTimer(), this._e9._iA_.objectId_, thi*****_, this.objectType_, 0, 0);
                _5T_.play("use_potion");
                this._X_6();
            }
    With this:

    Code:
    public function attemptUse():void{
                var tmp:_T_W_;
                var _local1:XML = ObjectLibrary._Q_F_[this.objectType_];
                if (_local1 == null)
                {
                    return;
                };
                var _local2:Player = this._e9.gs_.map_.player_;
                if ((((_local2 == null)) || (_local2.isPaused())))
                {
                    return;
                };
                trace(_local1.@id);
                if (_local1.@id == "Backpack")
                {
                    tmp = _T_W_(this._e9.parent.parent.parent);
                    tmp.addBackpackTab();
                }
                var _local3:Boolean = _local1.hasOwnProperty("Consumable");
                var _local4:Boolean = _local1.hasOwnProperty("InvUse");
                if (((!(_local3)) && (!(_local4))))
                {
                    return;
                };
                if (_local3)
                {
                    if (this._04q)
                    {
                        return;
                    };
                    this._04q = true;
                };
                this._e9.gs_.gsc_.useItem(getTimer(), this._e9._iA_.objectId_, thi*****_, this.objectType_, 0, 0);
                _5T_.play("use_potion");
                this._X_6();
            }
    Step 6

    Navigate to src\com\company\assembleegameclient\ui\_T_W_.as

    Replace the entire thing with this (I made several changes here so easier for me to paste the entire thing):

    Code:
    package com.company.assembleegameclient.ui
    {
    import flash.display.Sprite;
    import com.company.assembleegameclient.game.GameSprite;
    import com.company.assembleegameclient.objects.Player;
    import flash.display.Bitmap;
    import com.company.ui.SimpleText;
    import flash.filters.DropShadowFilter;
    import com.company.assembleegameclient.parameters.Parameters;
    import com.company.util.AssetLibrary;
    import flash.events.MouseEvent;
    import _0C_P_.Options;
     
    public class _T_W_ extends Sprite
    {
     
        public var equips_:Inventory;
        public var _e9:Inventory;
        public var pack_:Inventory;
        public var _0E__:int;
        private var gs_:GameSprite;
        private var go_:Player;
        private var w_:int;
        private var h_:int;
        private var _tm:Bitmap;
        private var nameText_:SimpleText;
        private var _L_P_:Sprite;
        private var _nw:_rN_ = null;
        private var _sI_:_0M_Y_;
        private var _U_U_:_0M_Y_;
        private var _023:_0M_Y_;
        private var _F_C_:_0M_Y_;
        private var stats:Stats;
        private var backpackTab_:TabButton;
        private var invTab_:TabButton;
        private var statTab_:TabButton;
        private var tabBG_:TabBackground;
        private var tabList_:Array;
        private var selectedTab_:int = 0;
        private var stackPots:Boolean = false;
     
        public function _T_W_(_arg1:GameSprite, _arg2:Player, _arg3:int, _arg4:int)
        {
            this.gs_ = _arg1;
            this.go_ = _arg2;
            this.w_ = _arg3;
            this.h_ = _arg4;
            this._tm = new Bitmap(null);
            this._tm.x = -2;
            this._tm.y = -10;
            addChild(this._tm);
            this.nameText_ = new SimpleText(20, 0xB3B3B3, false, 0, 0, "Myriad Pro");
            this.nameText_.setBold(true);
            this.nameText_.x = 36;
            this.nameText_.y = -2;
            if (this.gs_.charList_.name_ == null)
            {
                this.nameText_.text = this.go_.name_;
            }
            else
            {
                this.nameText_.text = this.gs_.charList_.name_;
            };
            this.nameText_.updateMetrics();
            this.nameText_.filters = [new DropShadowFilter(0, 0, 0)];
            addChild(this.nameText_);
            if (this.gs_.gsc_.gameId_ != Parameters.NEXUS_ID)
            {
                this._nw = new _rN_(AssetLibrary._xK_("lofiInterfaceBig", 6), "Nexus", "escapeToNexus");
                this._nw.addEventListener(MouseEvent.CLICK, this._Q_C_);
                this._nw.x = 172;
                this._nw.y = 2;
                addChild(this._nw);
            }
            else
            {
                this._nw = new _rN_(AssetLibrary._xK_("lofiInterfaceBig", 5), "Options", "options");
                this._nw.addEventListener(MouseEvent.CLICK, this._nD_);
                this._nw.x = 172;
                this._nw.y = 2;
                addChild(this._nw);
            };
            this._sI_ = new _0M_Y_(176, 16, 5931045, 0x545454, "Lvl X");
            this._sI_.x = 12;
            this._sI_.y = 30;
            addChild(this._sI_);
            this._sI_.visible = true;
            this._U_U_ = new _0M_Y_(176, 16, 0xE25F00, 0x545454, "Fame");
            this._U_U_.x = 12;
            this._U_U_.y = 30;
            addChild(this._U_U_);
            this._U_U_.visible = false;
            this._023 = new _0M_Y_(176, 16, 14693428, 0x545454, "HP");
            this._023.x = 12;
            this._023.y = 54;
            addChild(this._023);
            this._F_C_ = new _0M_Y_(176, 16, 6325472, 0x545454, "MP");
            this._F_C_.x = 12;
            this._F_C_.y = 78;
            addChild(this._F_C_);
            this.equips_ = new Inventory(_arg1, _arg2, "Inventory", _arg2._9A_.slice(0, 4), 4, true, 0, true);
            this.equips_.x = 14;
            this.equips_.y = 104;
            addChild(this.equips_);
            this.tabList_ = [];
            this.invTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 32), true, 0);
            this.invTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.invTab_.x = 7;
            this.invTab_.y = 152;
            addChild(this.invTab_);
            this.tabList_[0] = this.invTab_;
            this.statTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 33), false, 1);
            this.statTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.statTab_.x = 35;
            this.statTab_.y = 152;
            addChild(this.statTab_);
            this.tabList_[1] = this.statTab_;
            this.backpackTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 34), false, 2);
            this._e9 = new Inventory(_arg1, _arg2, "Inventory", _arg2._9A_.slice(4), 8, true, 4);
            this._e9.x = 7;
            this._e9.y = 7;
            this.invTab_.holder_.addChild(this._e9);
            this.stats = new Stats(191, 45);
            this.stats.x = 6;
            this.stats.y = 7;
            this.statTab_.holder_.addChild(this.stats);
            this.pack_ = new Inventory(_arg1, _arg2, "InventoryBackpack", _arg2._9A_.slice(4), 8, true, 4);
            mouseEnabled = false;
            this.setChildIndex(this.invTab_, (this.numChildren - 1));
            this.draw();
        }
     
        public function addBackpackTab():void
        {
            trace("I should be called by the health potion");
            this.backpackTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.backpackTab_.x = 63;
            this.backpackTab_.y = 152;
            addChild(this.backpackTab_);
            this.tabList_[2] = this.backpackTab_;
            this.pack_.x = 7;
            this.pack_.y = 7;
            this.backpackTab_.holder_.addChild(this.pack_);
            this.setChildIndex(this.backpackTab_, 0);
        }
     
        public function setName(_arg1:String):void
        {
            this.nameText_.text = _arg1;
            this.nameText_.updateMetrics();
        }
     
        public function nextTab():void
        {
            if ((this.selectedTab_ + 1) == this.tabList_.length)
            {
                this.switchTab((this.tabList_[0] as TabButton));
            }
            else
            {
                this.switchTab((this.tabList_[(this.selectedTab_ + 1)] as TabButton));
            };
        }
     
        public function switchTab(_tab:TabButton):void
        {
            var _i:TabButton;
            if (_tab.selected_)
            {
                return;
            };
            for each (_i in this.tabList_)
            {
                _i.setSelected(false);
            };
            _tab.setSelected(true);
            this.selectedTab_ = _tab.tabId_;
            this.setChildIndex(_tab, (this.numChildren - 1));
        }
     
        public function draw():void
        {
            this._tm.bitmapData = this.go_.getPortrait();
            var _local1:String = ("Lvl " + this.go_._81);
            if (_local1 != this._sI_.labelText_.text)
            {
                this._sI_.labelText_.text = _local1;
                this._sI_.labelText_.updateMetrics();
            };
            if (this.go_._81 != 20)
            {
                if (!(this._sI_.visible))
                {
                    this._sI_.visible = true;
                    this._U_U_.visible = false;
                };
                this._sI_.draw(this.go_.exp_, this.go_._7V_, 0);
                if (this._0E__ != this.go_._gz)
                {
                    this._0E__ = this.go_._gz;
                    this._sI_._Y_r(this._0E__, this.go_._gz);
                };
            }
            else
            {
                if (!(this._U_U_.visible))
                {
                    this._U_U_.visible = true;
                    this._sI_.visible = false;
                };
                this._U_U_.draw(this.go_._0L_o, this.go_._n8, 0);
            };
            this._023.draw(this.go_._aY_, this.go_._L_T_, this.go_._P_7, this.go_._uR_);
            this._F_C_.draw(this.go_._86, this.go_._a7, this.go_._0D_G_, this.go_._dt);
            this.stats.draw(this.go_);
            this.equips_.draw(this.go_.equipData_.slice(0, 4));
            this._e9.draw(this.go_.equipData_.slice(4));
        }
     
        public function destroy():void
        {
        }
     
        private function _Q_C_(_arg1:MouseEvent):void
        {
            this.gs_.gsc_._M_6();
            Parameters.data_.needsRandomRealm = false;
            Parameters.save();
        }
     
        private function _nD_(_arg1:MouseEvent):void
        {
            this.gs_.mui_.clearInput();
            this.gs_.addChild(new Options(this.gs_));
        }
     
        private function onTabClick(me:MouseEvent):void
        {
            if ((me.target is TabButton))
            {
                this.switchTab((me.target as TabButton));
            };
        }
     
     
    }
    }//package com.company.assembleegameclient.ui
    Step 7

    Navigate to src\com\company\assembleegameclient\net\_1f.as

    Look for this:

    Code:
    case StatData.INVENTORY_0_STAT:
                        case StatData.INVENTORY_1_STAT:
                        case StatData.INVENTORY_2_STAT:
                        case StatData.INVENTORY_3_STAT:
                        case StatData.INVENTORY_4_STAT:
                        case StatData.INVENTORY_5_STAT:
                        case StatData.INVENTORY_6_STAT:
                        case StatData.INVENTORY_7_STAT:
                        case StatData.INVENTORY_8_STAT:
                        case StatData.INVENTORY_9_STAT:
                        case StatData.INVENTORY_10_STAT:
                        case StatData.INVENTORY_11_STAT:
                            _arg1.equipData_[(_local4._0F_4 - StatData.INVENTORY_0_STAT)] = _local4._h;
                            break;
    Add this directly underneath:

    Code:
                        case StatData.BACKPACK_0_STAT:
                        case StatData.BACKPACK_1_STAT:
                        case StatData.BACKPACK_2_STAT:
                        case StatData.BACKPACK_3_STAT:
                        case StatData.BACKPACK_4_STAT:
                        case StatData.BACKPACK_5_STAT:
                        case StatData.BACKPACK_6_STAT:
                        case StatData.BACKPACK_7_STAT:
                           _arg1.backpack_[(_local4._0F_4 - StatData.BACKPACK_0_STAT)] = _local4._h;
                            break;
    p.s snuffleugapus made dis
    this doesnt look like it works

  13. #11
    KieronZeCoder69's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    On my computer
    Posts
    439
    Reputation
    20
    Thanks
    219
    My Mood
    Aggressive
    Quote Originally Posted by sacredmike View Post
    Yeah, I figured that out. But, this code barely works and won't even let me connect to nexus.
    yeah same i can't connect to nexus either now

    - - - Updated - - -

    Quote Originally Posted by Slendergo View Post
    this doesnt look like it works
    it doesn't....

  14. #12
    Slendergo's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    382
    Reputation
    17
    Thanks
    250
    My Mood
    Inspired
    Quote Originally Posted by Darkfark View Post
    Some of this is probably irrelevant to backpacks or it might be missing something still. It's impossible for me to do any further testing until the server side is working correctly first.

    Once the server side of things are working I can test this further and fix it if need be.

    Right now the character state is not saving when a backpack is used. Once you move to a new map the backpack tab will vanish.

    You'll need the Stats Tab mod installed first before adding any of this.

    Step 1

    Insert this Backpack XML into both the client and server somewhere. Make sure the backpack image is also embedded in the correct sprite sheet.

    Code:
      <Object type="0x1962" id="Backpack">
        <Class>Equipment</Class>
        <Item />
        <Texture>
          <File>lofiObj3</File>
          <Index>0x315</Index>
        </Texture>
        <SlotType>10</SlotType>
        <Description>A backpack that will double your inventory space.</Description>
        <Sound>spell/light_heal</Sound>
        <Activate>Backpack</Activate>
        <Consumable />
        <Backpack />
        <BagType>2</BagType>
        <Soulbound />
      </Object>
    Step 2

    Navigate to src\com\company\assembleegameclient\net\messages\d ata\StatData.as

    Find this:

    Code:
     public static const _5J_:int = 64;
            public static const _bk:int = 65;
            public static const SKIN_STAT:int = 66;
    Add this after :

    Code:
            public static const BACKPACK_0_STAT:int = 67;
            public static const BACKPACK_1_STAT:int = 68;
            public static const BACKPACK_2_STAT:int = 69;
            public static const BACKPACK_3_STAT:int = 70;
            public static const BACKPACK_4_STAT:int = 71;
            public static const BACKPACK_5_STAT:int = 72;
            public static const BACKPACK_6_STAT:int = 73;
            public static const BACKPACK_7_STAT:int = 74;
    Find this:

    Code:
    public function _I_3():Boolean{
                switch (this._0F_4)
                {
                    case _hK_:
                    case _07q:
                        return (true);
                };
                return (false);
            }
    Change to this:

    Code:
    public function _I_3():Boolean{
                switch (this._0F_4)
                {
                    case _hK_:
                    case _07q:
                    case BACKPACK_0_STAT:
                    case BACKPACK_1_STAT:
                    case BACKPACK_2_STAT:
                    case BACKPACK_3_STAT:
                    case BACKPACK_4_STAT:
                    case BACKPACK_5_STAT:
                    case BACKPACK_6_STAT:
                    case BACKPACK_7_STAT:
                        return (true);
                };
                return (false);
            }
    Step 3

    Navigate to src\com\company\assembleegameclient\objects\GameOb ject.as

    Find this and add the line in bold:

    Code:
     public var _81:int = -1;
            public var _ai:int = 0;
            public var _9A_:Vector.<int> = null;
            public var equipData_:Vector.<int> = null;
            public var backpack_:Vector.<Object> = null;
            public var _9B_:uint = 0;
            protected var tex1Id_:int = 0;
            protected var tex2Id_:int = 0;
    Find this and add the lines in bold:

    Code:
    if (_arg1.hasOwnProperty("SlotTypes"))
                {
                    this._9A_ = ConversionUtil._04n(_arg1.SlotTypes);
                    this.equipData_ = new Vector.<int>(this._9A_.length);
                    this.backpack_ = new Vector.<Object>(this._9A_.length);
                    _local4 = 0;
                    while (_local4 < this.equipData_.length)
                    {
                        this.equipData_[_local4] = -1;
                        this.backpack_[_local4] = -1;
                        _local4++;
                    };
                };
    Step 4

    Navigate to src\com\company\assembleegameclient\ui\Inventory.a s

    Find this and add the line in bold:

    Code:
    public var gs_:GameSprite;
        public var _iA_:GameObject;
        public var _A_H_:String;
        public var invsize_:int;
        public var slots_:Vector.<_E_6>;
        public var equipment_:Boolean;
        public var backpack_:Boolean;
        protected var fill_:GraphicsSolidFill;
        protected var path_:GraphicsPath;
        private var graphicsData_:Vector.<IGraphicsData>;
    Replace this function:

    Code:
    public function Inventory(_arg1:GameSprite, _arg2:GameObject, _arg3:String, _arg4:Vector.<int>, _arg5:int, _arg6:Boolean, _offset:int=0, _equipment:Boolean=false):void
        {
            var _local8:_E_6;
            var _local7:int;
            var _local10:int;
            this.slots_ = new Vector.<_E_6>();
            this.fill_ = new GraphicsSolidFill(0x545454);
            this.path_ = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
            this.graphicsData_ = new <IGraphicsData>[this.fill_, this.path_, GraphicHelper.END_FILL];
            super();
            this.gs_ = _arg1;
            this._iA_ = _arg2;
            this._A_H_ = _arg3;
            this.invsize_ = _arg5;
            this.equipment_ = _equipment;
            if (((_arg1) && ((_arg2 == this.gs_.map_.player_))))
            {
                this.gs_.map_.player_.inventory = this;
            };
            while (_local7 < _arg5)
            {
                _local10 = (_local7 + _offset);
                _local8 = new _E_6(this, _local10, _arg4[_local7], ((_arg6) ? (_local10 - 3) : -1), _ls[_arg4.length][_local7], _equipment);
                _local8.x = (int((_local7 % 4)) * (Slot.WIDTH + 4));
                _local8.y = (int((_local7 / 4)) * (Slot.HEIGHT + 4));
                this.slots_.push(_local8);
                addChild(_local8);
                _local7++;
            };
        }
    With this:

    Code:
    public function Inventory(_arg1:GameSprite, _arg2:GameObject, _arg3:String, _arg4:Vector.<int>, _arg5:int, _arg6:Boolean, _offset:int=0, _equipment:Boolean=false, _backpack:Boolean=false):void
        {
            var _local8:_E_6;
            var _local7:int;
            var _local10:int;
            this.slots_ = new Vector.<_E_6>();
            this.fill_ = new GraphicsSolidFill(0x545454);
            this.path_ = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
            this.graphicsData_ = new <IGraphicsData>[this.fill_, this.path_, GraphicHelper.END_FILL];
            super();
            this.gs_ = _arg1;
            this._iA_ = _arg2;
            this._A_H_ = _arg3;
            this.invsize_ = _arg5;
            this.equipment_ = _equipment;
            this.backpack_ = _backpack;
            if (((_arg1) && ((_arg2 == this.gs_.map_.player_))))
            {
                this.gs_.map_.player_.inventory = this;
            };
            while (_local7 < _arg5)
            {
                _local10 = (_local7 + _offset);
                _local8 = new _E_6(this, _local10, _arg4[_local7], ((_arg6) ? (_local10 - 3) : -1), _ls[_arg4.length][_local7], _equipment);
                _local8.x = (int((_local7 % 4)) * (Slot.WIDTH + 4));
                _local8.y = (int((_local7 / 4)) * (Slot.HEIGHT + 4));
                this.slots_.push(_local8);
                addChild(_local8);
                _local7++;
            };
        }
    Step 5

    Navigate to src\com\company\assembleegameclient\ui\_E_6.as

    Replace this function:

    Code:
    public function attemptUse():void{
                var tmp:_T_W_;
                var _local1:XML = ObjectLibrary._Q_F_[this.objectType_];
                if (_local1 == null)
                {
                    return;
                };
                var _local2:Player = this._e9.gs_.map_.player_;
                if ((((_local2 == null)) || (_local2.isPaused())))
                {
                    return;
                };
                var _local3:Boolean = _local1.hasOwnProperty("Consumable");
                var _local4:Boolean = _local1.hasOwnProperty("InvUse");
                if (((!(_local3)) && (!(_local4))))
                {
                    return;
                };
                if (_local3)
                {
                    if (this._04q)
                    {
                        return;
                    };
                    this._04q = true;
                };
                this._e9.gs_.gsc_.useItem(getTimer(), this._e9._iA_.objectId_, thi*****_, this.objectType_, 0, 0);
                _5T_.play("use_potion");
                this._X_6();
            }
    With this:

    Code:
    public function attemptUse():void{
                var tmp:_T_W_;
                var _local1:XML = ObjectLibrary._Q_F_[this.objectType_];
                if (_local1 == null)
                {
                    return;
                };
                var _local2:Player = this._e9.gs_.map_.player_;
                if ((((_local2 == null)) || (_local2.isPaused())))
                {
                    return;
                };
                trace(_local1.@id);
                if (_local1.@id == "Backpack")
                {
                    tmp = _T_W_(this._e9.parent.parent.parent);
                    tmp.addBackpackTab();
                }
                var _local3:Boolean = _local1.hasOwnProperty("Consumable");
                var _local4:Boolean = _local1.hasOwnProperty("InvUse");
                if (((!(_local3)) && (!(_local4))))
                {
                    return;
                };
                if (_local3)
                {
                    if (this._04q)
                    {
                        return;
                    };
                    this._04q = true;
                };
                this._e9.gs_.gsc_.useItem(getTimer(), this._e9._iA_.objectId_, thi*****_, this.objectType_, 0, 0);
                _5T_.play("use_potion");
                this._X_6();
            }
    Step 6

    Navigate to src\com\company\assembleegameclient\ui\_T_W_.as

    Replace the entire thing with this (I made several changes here so easier for me to paste the entire thing):

    Code:
    package com.company.assembleegameclient.ui
    {
    import flash.display.Sprite;
    import com.company.assembleegameclient.game.GameSprite;
    import com.company.assembleegameclient.objects.Player;
    import flash.display.Bitmap;
    import com.company.ui.SimpleText;
    import flash.filters.DropShadowFilter;
    import com.company.assembleegameclient.parameters.Parameters;
    import com.company.util.AssetLibrary;
    import flash.events.MouseEvent;
    import _0C_P_.Options;
     
    public class _T_W_ extends Sprite
    {
     
        public var equips_:Inventory;
        public var _e9:Inventory;
        public var pack_:Inventory;
        public var _0E__:int;
        private var gs_:GameSprite;
        private var go_:Player;
        private var w_:int;
        private var h_:int;
        private var _tm:Bitmap;
        private var nameText_:SimpleText;
        private var _L_P_:Sprite;
        private var _nw:_rN_ = null;
        private var _sI_:_0M_Y_;
        private var _U_U_:_0M_Y_;
        private var _023:_0M_Y_;
        private var _F_C_:_0M_Y_;
        private var stats:Stats;
        private var backpackTab_:TabButton;
        private var invTab_:TabButton;
        private var statTab_:TabButton;
        private var tabBG_:TabBackground;
        private var tabList_:Array;
        private var selectedTab_:int = 0;
        private var stackPots:Boolean = false;
     
        public function _T_W_(_arg1:GameSprite, _arg2:Player, _arg3:int, _arg4:int)
        {
            this.gs_ = _arg1;
            this.go_ = _arg2;
            this.w_ = _arg3;
            this.h_ = _arg4;
            this._tm = new Bitmap(null);
            this._tm.x = -2;
            this._tm.y = -10;
            addChild(this._tm);
            this.nameText_ = new SimpleText(20, 0xB3B3B3, false, 0, 0, "Myriad Pro");
            this.nameText_.setBold(true);
            this.nameText_.x = 36;
            this.nameText_.y = -2;
            if (this.gs_.charList_.name_ == null)
            {
                this.nameText_.text = this.go_.name_;
            }
            else
            {
                this.nameText_.text = this.gs_.charList_.name_;
            };
            this.nameText_.updateMetrics();
            this.nameText_.filters = [new DropShadowFilter(0, 0, 0)];
            addChild(this.nameText_);
            if (this.gs_.gsc_.gameId_ != Parameters.NEXUS_ID)
            {
                this._nw = new _rN_(AssetLibrary._xK_("lofiInterfaceBig", 6), "Nexus", "escapeToNexus");
                this._nw.addEventListener(MouseEvent.CLICK, this._Q_C_);
                this._nw.x = 172;
                this._nw.y = 2;
                addChild(this._nw);
            }
            else
            {
                this._nw = new _rN_(AssetLibrary._xK_("lofiInterfaceBig", 5), "Options", "options");
                this._nw.addEventListener(MouseEvent.CLICK, this._nD_);
                this._nw.x = 172;
                this._nw.y = 2;
                addChild(this._nw);
            };
            this._sI_ = new _0M_Y_(176, 16, 5931045, 0x545454, "Lvl X");
            this._sI_.x = 12;
            this._sI_.y = 30;
            addChild(this._sI_);
            this._sI_.visible = true;
            this._U_U_ = new _0M_Y_(176, 16, 0xE25F00, 0x545454, "Fame");
            this._U_U_.x = 12;
            this._U_U_.y = 30;
            addChild(this._U_U_);
            this._U_U_.visible = false;
            this._023 = new _0M_Y_(176, 16, 14693428, 0x545454, "HP");
            this._023.x = 12;
            this._023.y = 54;
            addChild(this._023);
            this._F_C_ = new _0M_Y_(176, 16, 6325472, 0x545454, "MP");
            this._F_C_.x = 12;
            this._F_C_.y = 78;
            addChild(this._F_C_);
            this.equips_ = new Inventory(_arg1, _arg2, "Inventory", _arg2._9A_.slice(0, 4), 4, true, 0, true);
            this.equips_.x = 14;
            this.equips_.y = 104;
            addChild(this.equips_);
            this.tabList_ = [];
            this.invTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 32), true, 0);
            this.invTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.invTab_.x = 7;
            this.invTab_.y = 152;
            addChild(this.invTab_);
            this.tabList_[0] = this.invTab_;
            this.statTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 33), false, 1);
            this.statTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.statTab_.x = 35;
            this.statTab_.y = 152;
            addChild(this.statTab_);
            this.tabList_[1] = this.statTab_;
            this.backpackTab_ = new TabButton(AssetLibrary._xK_("lofiInterfaceBig", 34), false, 2);
            this._e9 = new Inventory(_arg1, _arg2, "Inventory", _arg2._9A_.slice(4), 8, true, 4);
            this._e9.x = 7;
            this._e9.y = 7;
            this.invTab_.holder_.addChild(this._e9);
            this.stats = new Stats(191, 45);
            this.stats.x = 6;
            this.stats.y = 7;
            this.statTab_.holder_.addChild(this.stats);
            this.pack_ = new Inventory(_arg1, _arg2, "InventoryBackpack", _arg2._9A_.slice(4), 8, true, 4);
            mouseEnabled = false;
            this.setChildIndex(this.invTab_, (this.numChildren - 1));
            this.draw();
        }
     
        public function addBackpackTab():void
        {
            trace("I should be called by the health potion");
            this.backpackTab_.addEventListener(MouseEvent.CLICK, this.onTabClick);
            this.backpackTab_.x = 63;
            this.backpackTab_.y = 152;
            addChild(this.backpackTab_);
            this.tabList_[2] = this.backpackTab_;
            this.pack_.x = 7;
            this.pack_.y = 7;
            this.backpackTab_.holder_.addChild(this.pack_);
            this.setChildIndex(this.backpackTab_, 0);
        }
     
        public function setName(_arg1:String):void
        {
            this.nameText_.text = _arg1;
            this.nameText_.updateMetrics();
        }
     
        public function nextTab():void
        {
            if ((this.selectedTab_ + 1) == this.tabList_.length)
            {
                this.switchTab((this.tabList_[0] as TabButton));
            }
            else
            {
                this.switchTab((this.tabList_[(this.selectedTab_ + 1)] as TabButton));
            };
        }
     
        public function switchTab(_tab:TabButton):void
        {
            var _i:TabButton;
            if (_tab.selected_)
            {
                return;
            };
            for each (_i in this.tabList_)
            {
                _i.setSelected(false);
            };
            _tab.setSelected(true);
            this.selectedTab_ = _tab.tabId_;
            this.setChildIndex(_tab, (this.numChildren - 1));
        }
     
        public function draw():void
        {
            this._tm.bitmapData = this.go_.getPortrait();
            var _local1:String = ("Lvl " + this.go_._81);
            if (_local1 != this._sI_.labelText_.text)
            {
                this._sI_.labelText_.text = _local1;
                this._sI_.labelText_.updateMetrics();
            };
            if (this.go_._81 != 20)
            {
                if (!(this._sI_.visible))
                {
                    this._sI_.visible = true;
                    this._U_U_.visible = false;
                };
                this._sI_.draw(this.go_.exp_, this.go_._7V_, 0);
                if (this._0E__ != this.go_._gz)
                {
                    this._0E__ = this.go_._gz;
                    this._sI_._Y_r(this._0E__, this.go_._gz);
                };
            }
            else
            {
                if (!(this._U_U_.visible))
                {
                    this._U_U_.visible = true;
                    this._sI_.visible = false;
                };
                this._U_U_.draw(this.go_._0L_o, this.go_._n8, 0);
            };
            this._023.draw(this.go_._aY_, this.go_._L_T_, this.go_._P_7, this.go_._uR_);
            this._F_C_.draw(this.go_._86, this.go_._a7, this.go_._0D_G_, this.go_._dt);
            this.stats.draw(this.go_);
            this.equips_.draw(this.go_.equipData_.slice(0, 4));
            this._e9.draw(this.go_.equipData_.slice(4));
        }
     
        public function destroy():void
        {
        }
     
        private function _Q_C_(_arg1:MouseEvent):void
        {
            this.gs_.gsc_._M_6();
            Parameters.data_.needsRandomRealm = false;
            Parameters.save();
        }
     
        private function _nD_(_arg1:MouseEvent):void
        {
            this.gs_.mui_.clearInput();
            this.gs_.addChild(new Options(this.gs_));
        }
     
        private function onTabClick(me:MouseEvent):void
        {
            if ((me.target is TabButton))
            {
                this.switchTab((me.target as TabButton));
            };
        }
     
     
    }
    }//package com.company.assembleegameclient.ui
    Step 7

    Navigate to src\com\company\assembleegameclient\net\_1f.as

    Look for this:

    Code:
    case StatData.INVENTORY_0_STAT:
                        case StatData.INVENTORY_1_STAT:
                        case StatData.INVENTORY_2_STAT:
                        case StatData.INVENTORY_3_STAT:
                        case StatData.INVENTORY_4_STAT:
                        case StatData.INVENTORY_5_STAT:
                        case StatData.INVENTORY_6_STAT:
                        case StatData.INVENTORY_7_STAT:
                        case StatData.INVENTORY_8_STAT:
                        case StatData.INVENTORY_9_STAT:
                        case StatData.INVENTORY_10_STAT:
                        case StatData.INVENTORY_11_STAT:
                            _arg1.equipData_[(_local4._0F_4 - StatData.INVENTORY_0_STAT)] = _local4._h;
                            break;
    Add this directly underneath:

    Code:
                        case StatData.BACKPACK_0_STAT:
                        case StatData.BACKPACK_1_STAT:
                        case StatData.BACKPACK_2_STAT:
                        case StatData.BACKPACK_3_STAT:
                        case StatData.BACKPACK_4_STAT:
                        case StatData.BACKPACK_5_STAT:
                        case StatData.BACKPACK_6_STAT:
                        case StatData.BACKPACK_7_STAT:
                           _arg1.backpack_[(_local4._0F_4 - StatData.BACKPACK_0_STAT)] = _local4._h;
                            break;
    p.s snuffleugapus made dis
    this is so bad, there isnt any server sided to pply the inventory, most of this is just stupid files that wont work

  15. #13
    KieronZeCoder69's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    On my computer
    Posts
    439
    Reputation
    20
    Thanks
    219
    My Mood
    Aggressive
    Quote Originally Posted by Slendergo View Post
    this is so bad, there isnt any server sided to pply the inventory, most of this is just stupid files that wont work
    lol much agreed, why post a tutorial if it don't work?

  16. #14
    TJRAE%TJAJAZetjtjtjjt's Avatar
    Join Date
    Aug 2014
    Gender
    male
    Posts
    166
    Reputation
    10
    Thanks
    106
    how to add this to SERVER SOURCE?

  17. #15
    Snuffleupagus's Avatar
    Join Date
    Dec 2014
    Gender
    female
    Posts
    54
    Reputation
    10
    Thanks
    76
    Quote Originally Posted by GhostMareeX View Post
    how to add this to SERVER SOURCE?
    Good question. Everyone that said they would help with the server code never did.

    I consider this one of the highest priorities for Private servers.

  18. The Following User Says Thank You to Snuffleupagus For This Useful Post:

    TJRAE%TJAJAZetjtjtjjt (03-11-2015)

Page 1 of 2 12 LastLast

Similar Threads

  1. [TUTORIAL]How to Add Skins to the AS3 Client/Server
    By Snuffleupagus in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 65
    Last Post: 04-06-2016, 11:10 PM
  2. [TUTORIAL] How to Add a Stats Tab for the AS3 Client
    By Snuffleupagus in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 28
    Last Post: 02-21-2015, 09:04 AM
  3. [Tutorial] How to add more tiers to your AS3 Client
    By Omniraptor in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 9
    Last Post: 02-19-2015, 06:12 AM
  4. AS3 Tutorial - How to add images to the main screen
    By Lxys in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 0
    Last Post: 02-19-2015, 03:15 AM
  5. [Tutorial] How to set hotkeys to your basic hacks.
    By wr194t in forum Visual Basic Programming
    Replies: 4
    Last Post: 11-08-2007, 03:44 AM