Announcement

Collapse
No announcement yet.

hud+inventory drop problem

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

    hud+inventory drop problem

    hello i'm working in a rpg game and i'm facing a little problem with my scaleform inventory, i will try to explain a little bit the escenario.

    i have a hud that will display life, armor, mana, etc, it has three slot for placing inventory items that can be used in game.

    my problem is that when i have the item in my inventory, i don't know how to pass the item from the inventory to the hud, i can't drag it into the hud, the item exist only in the inventory scaleform movie.

    i tried to merge the inventory into the hud and using a variable to show/hide the inventory part, but there i'm facing another problem, don't know how to get the input from the player, because the hud shows the inventory, but the input from the player still moves the pawn, i can't pick a item a drag from the inventory to the hud.

    any ideas on how to solve this ?

    thanks in advance for all the help.

    #2
    If you create a separate movie/screen/what ever to handle the item being dragged, both your HUD and Inventory can reference that and swap items between each other. All depends on how you select the slots in either screen.

    Comment


      #3
      i just want to drag the item from the inventory screen to the hud, like in diablo games, how can i reference the item slowJusko ?

      Comment


        #4
        Create windows in the hud movie instead of a separate movies
        i have like 15 windows in GOTA already lol...
        Though my GFxHudMovie Class has 7000 lines already

        You wanna hide that , window , wich is a symbol

        Simple inventorywindow.visible = false.. or _visible i guess you know it : ) .

        Then if you wanna like move it aroudn with the mouse drag the window you can use a drag button , in the inventory sample there is that thing already.

        Comment


          #5
          hello Neongho, i tried your approach, using two or three movies as a part of the hud, i hide the main inventory screen and unhide it when i press the inventory key, but when i press "i" to show the inventory screen the inventory shows, but i don't know how to pass the input from the player to the inventory+hud screen, i mean, the inventory shows, but the mouse is not moving because the control is on the player's pawn.

          how cani pass the control over the inventory ? i don't know how to do it.

          thanks for your help Neongho

          Comment


            #6
            Mmmh , i think that you must stabilish a priority or something like that ... mmh

            if i understand well ,that what you mean is that you instanced 3 movies , from your hud ? or you have 3 MovileClips/symbol instances on your main GFx Movie ?

            i send you my Hud class maybe that helps
            Code:
            //-----------------------------------------------------------
            //
            //-----------------------------------------------------------
            
            class ArenaHud extends HUD;
            
            
            //Movies
            var GFxArenaHudMovie HudMovie;
            var GFxArenaScoreBox ScoreBoardMovie;
            var GFxArenaMainMenu MainMenuMovie;
            
            //BattleStatusVars
            var int PlayerVigour;
            Var int PlayerHealth;
            var int PlayerAdrenaline;
            var int PlayerMorale;
            var int PlayerAmmo;
            
            //CanvasButtonsMovie
            Var string Dialogue;
            
            var bool bShouldRenderUseMessage;
            var string UseMessage;
            
            var array<Name> PPENames;
            
            
            
            function PostProcessChain obtainPPEs()
            
            {
               local PostProcessChain PPC;
               local int v;
            
               PPC = PostProcessChain(DynamicLoadObject("GOTACinematics.LoadingScreenPPC",
                               class'PostProcessChain'));
            
            
               for (v = 0; v < PPC.Effects.length; v++ )
               {
            	PPENames.addItem(PPC.Effects[v].EffectName);
                `log("ppe"$v@PPC.Effects[v].EffectName);
               }
            
               return PPC;
            
            }
            
            
            
            
            
            
            
            
            ///BUTTONSSSTEM////////////////////////////////////////////////////////////
            
            
            function SetChoicesButtonsInvisible()
            {
            HUDmovie.SetChoicesButtonsInvisible();
            
            }
            
            
            
            function SetChoicesButtonInvisible(int I)
            {
             HudMovie.DiaChoicesButtons[I].SetBool("_visible",false);
            }
            
            
            function SetChoicesButtonVisible(int I)
            {
             HudMovie.DiaChoicesButtons[I].SetBool("_visible",true);
            }
            
            
            ///BUTTONSSSTEM////////////////////////////////////////////////////////////
            
            
            
            
            //
            //function DrawMorale()
            //{
            //Canvas.SetPos(80,260);
            //Canvas.SetDrawColor(255,255,0,255);
            //Canvas.Font = class'Engine'.static.GetMediumFont();
            //Canvas.DrawText(PlayerMorale);
            //}
            
            
            //function DrawAdrenaline()
            //{
            //Canvas.SetPos(80,230);
            //Canvas.SetDrawColor(255,255,255,255);
            //anvas.Font = class'Engine'.static.GetMediumFont();
            //Canvas.DrawText(PlayerAdrenaline);
            //}
            
            
            
            //function DrawHealth()
            //{
            //Canvas.SetPos(80,200);
            //Canvas.SetDrawColor(0,255,0,200);
            //Canvas.Font = class'Engine'.static.GetMediumFont();
            //Canvas.DrawText(PlayerHealth);
            //}
            
            
            //function DrawVigour()
            //{
            //Canvas.SetPos(80,170);
            //Canvas.SetDrawColor(0,0,255,255);
            //Canvas.Font = class'Engine'.static.GetMediumFont();
            //Canvas.DrawText(PlayerVigour);
            //}
            
            function DrawUseMessage()
            {
            Canvas.SetPos(525,650);
            Canvas.SetDrawColor(255,0,0,200);
            Canvas.Font = class'Engine'.static.GetMediumFont();
            Canvas.DrawText(UseMessage);
            }
            
            
            
            
            function SetUseText(string NewText)
            {
            UseMessage = newText;
            }
            
            
            
            
            
            
             function ChangeTaskText ( String TextToChange )
             {
               HudMovie.ChangeTheTaskText(TextToChange);
             }
            
            
             function ChangeConvText( String TextToChange )
             {
              HudMovie.ChangeTheConvText(TextToChange);
             }
            
            
            
            
            
            singular event Destroyed()
            {
                    // Each HUD element needs to be shut down in the Destroyed() event!
            	if (HudMovie != none)
            	{
            		HudMovie.Close(true);
            		HudMovie = none;
            	}
            
            	super.Destroyed();
            }
            
            
            
            event PostBeginPlay()
            {
            
            super.PostBeginPlay();
            
            //HudMovie
            HudMovie=new class'GFxArenaHudMovie';
            HudMovie.Init(class'Engine'.static.GetEngine().GamePlayers[HudMovie.LocalPlayerOwnerIndex]);
            
            ScoreBoardMovie=new class'GFxArenaScoreBox';
            ScoreBoardMovie.Init(class'Engine'.static.GetEngine().GamePlayers[ScoreBoardMovie.LocalPlayerOwnerIndex]);
            
            MainMenuMovie=new class'GFxArenaMainMenu';
            MainMenuMovie.Init(class'Engine'.static.GetEngine().GamePlayers[MainMenuMovie.LocalPlayerOwnerIndex]);
            
            //start the menu
            //StartTheMainMenu();
            
            
            //ConvenrastionSystem
            SetChoicesButtonsInvisible();
            
            SetTimer(3,false,NameOf(startTheHud));
            //setTimer(2,false,NameOf(StartTheScoreBoard));
            
            
            
            
            }
            
            function StartTheScoreBoard()
            {
            ScoreBoardMovie.start();
            
            
            }
            
            
            function StartTheHud()
            {
            HudMovie.start();
            HudMovie.SetEveryHUDElementHidden();
            
            }
            
            function StartTheMainMenu()
            {
             if(WorldInfo.GetMapName(false) == "arenamainmenu")
             {
              MainMenuMovie.start();
             }
            }
            
            
            ////////////////////////////////////////Hide And show windows//////////////////////////
            
             //inventory
            function ShowBattleStatuspannel()
            {
            HudMovie.ShowBattlestatusPannel();
            }
            
            
            //inventory
            function ShowCrosshair()
            {
            HUDmovie.ShowCrossHair();
            }
            
            
            
            //inventory
            function ShowInventory()
            {
            HudMovie.ShowInventory();
            }
            
            //Skills
            function ShowSkills()
            {
            HudMovie.ShowSkills();
            }
            
            //Merchant
            function ShowMerchantPannel()
            {
            HudMovie.ShowMerchantPannel();
            }
            
            //Matches window
            function ShowHouseMerchant()
            {
            HudMovie.ShowHouseMerchWindow();
            }
            
            
            
            //Matches window
            function ShowMatches()
            {
            HudMovie.ShowMatches();
            }
            
            //Matches window
            function ShowMouse()
            {
            HudMovie.ShowMouse();
            }
            
            
            
            
            
            //Hide(())//
            
            
               //inventory
            function HideBattleStatuspannel()
            {
            HudMovie.HideBattlestatusPannel();
            }
            
            
            //inventory
            function HideCrosshair()
            {
            HUDmovie.HideCrossHair();
            }
            
            
            //inventory
            function HideInventory()
            {
            HudMovie.HideInventory();
            }
            
            //Skills
            function HideSkills()
            {
            HudMovie.HideSkills();
            }
            
            //Merchant
            function HideMerchantPannel()
            {
            HudMovie.HideMerchantPannel();
            }
            
            //Matches
            function HideMatches()
            {
            HudMovie.HideMatches();
            }
            
            //Matches window
            function HideMouse()
            {
            HudMovie.HideMouse();
            }
            
            
            function HideDiaButtons()
            {
            HUDMovie.HideDiaButtons();
            }
            //////////////////////////////////Hide and show windows//////////////////////////////////////////
            
            
            ///UpdateArenaList////
            
            function UpdateTheArenaList()
            {
            HudMovie.UpdateTheMatchesList();
            
            
            
            }
            
            
            ///UpdateArenaList////
            
            
            
            ///////UpdateSkillsScaleForm/////////////////////////////
            
            
             function UpdateSKills()
             {
             local ArenaPlayerController APC;
             local Pawn P;
             local ArenaPawn AP;
            
            
              APC = ArenaPlayerController(PlayerOwner);
              P = APC.Pawn;
              AP = ArenaPAwn(P);
            
            //SetSkillsonHudMovie--------------------------------------------------//
            
              //Weapon Skills-----------------
              HUDMovie.SkillWindow.SetFloat("SpearSkillXP",AP.Skills.SpearSkillXp);
              HUDMovie.SkillWindow.SetFloat("SpearSkillLevel",AP.Skills.SpearSkillLevel);
            
              HUDMovie.SkillWindow.SetFloat("OneHandedSkillXP",AP.Skills.OneHandedWeaponSkillXp);
              HUDMovie.SkillWindow.SetFloat("OneHandedSkillLevel",AP.Skills.OneHandedWeaponSkillLevel);
            
            //SetSkillsonHudMovie--------------------------------------------------//
            
            
              HUDMovie.SkillWindow.ActionScriptVoid("UpdateTheSkills");
             }
            
            
             function UpdateInventory()
             {
            
             HUDMovie.UpdateInventory();
            
             }
            
            
             function AddMerchantInvitem(String itemType, Int ItemID, int ItemSlotToAdd, int ItemCost)
             {
            
            HudMovie.AddMerchantInvitem(itemType,ItemID,ItemSlotToAdd,ItemCost);
            
             }
            
              function AddPlayerInvitem(String itemType, Int ItemID, int ItemSlotToAdd, int ItemCost)
             {
            
              HudMovie.AddPlayerInvitem(itemType,ItemID,ItemSlotToAdd,ItemCost);
            
             }
            
            
            function DeleteMerchantInvitem(int ItemSlotToDelete)
            {
            HUdMovie.DeleteMerchantInvitem(ItemSlottodelete);
            
            }
            
            
            
            
            function UpdatePlayerStatusWindow()
            {
            local GFxObject EnergyBar;
            local GFxObject AlimentationBar;
            Local GFxObject HidratationBar;
            local GFxObject HealthBar;
            
            local ArenaGameInfo AGI;
            
            AGI = ArenaGameInfo(WorldInfo.game);
            
            EnergyBar = HudMovie.PlayerStatusWindow.GetObject("EnergyBar");
            AlimentationBar = HudMovie.PlayerStatusWindow.GetObject("HungerBar");
            HealthBar = HudMovie.PlayerStatusWindow.GetObject("HealthBar");
            HidratationBar =  HudMovie.PlayerStatusWindow.GetObject("HidratationBar");
            
             if(AGI != none)
             {
            
               if(EnergyBar != none )
               {
               EnergyBar.SetFloat("_xscale",(100/3000) * AGI.PlayerStatusInstance.Energy);
               }
            
               if(AlimentationBar != none )
               {
               AlimentationBar.SetFloat("_xscale",(100/1000) * AGI.PlayerStatusInstance.Alimentation);
               }
            
               if(HealthBar != none )
               {
               //HealthBar.SetFloat("_xscale",(175/100) * );
               }
            
               if(HidratationBar != none )
               {
               HidratationBar.SetFloat("_xscale",(100/1000) * AGI.PlayerStatusInstance.Hidratation);
               }
            
            
             }
            
            
            }
            
            
            
             ////Set Basic Hud elements up///
            
            function SetBHudElementsUp()
            {
            
            ShowBattleStatuspannel();
            
            }
            
            ///////UpdateSkillsScaleForm/////////////////////////////
            
            
            
            
            
            event PostRender()
            {
            local GameInfo GI;
            GI = WorldInfo.game;
            
            
            	super.PostRender();
            
                if(bShouldRenderUseMessage){
                DrawUseMessage();}
            
            
            
            
               	if (HudMovie != none)
            	{
                HudMovie.TickHUD(0);
                if(HudMovie.HoursText != none){
                HudMovie.HoursText.SetText(ArenaGameInfo(GI).Hours); }
            
                if(hudMovie.MinutesText != none){
                HudMovie.MinutesText.SetText(ArenaGameInfo(GI).Minutes);}
            
            
            
            	}
            
            }
            
            
            
            
            
            
            
            DefaultProperties
            {
            UseMessage = "";
            
            }

            Comment


              #7
              i think i got your idea, you mean when i press "i" to create the Inventory movie into the hud, in this way the hud movie will be handle the input because in my inventory movie class i have set the default properties to do that, i'm right on this ?

              if i'm right on this i can drag a item from the inventory movie, just create into the hud, to a slot into the hud ?

              Comment


                #8
                To be exact like this in same movie , as not movies but as , symbols , " GFxObjects" Symbo/window

                then you can add a drag thing it's cool

                Comment


                  #9
                  i need to use something special on the flash side ? i mean any click component ? or i can just declare the GFxObject in my hud and work with it ?

                  Comment


                    #10
                    Code:
                     
                    //Start the movie
                    function bool start (optional bool StartPaused = True)
                    {
                      super.start();
                      Advance(0);
                    
                    
                       //Root
                       root = GetVariableObject("_root");
                    
                       //**texts outputs
                      TaskText = GetVariableObject("_root.TaskText");
                      ConvText = GetVariableObject("_root.ConversationText");
                    
                    
                    
                       //Hud
                       BattleStatusPannel =  GetVariableObject("_root.BattleStatusPannel_MC");
                    
                       HealthBar =  GetVariableObject("_root.BattleStatusPannel_MC.HealthTheBar");
                       VigourBar =  GetVariableObject("_root.BattleStatusPannel_MC.VigourTheBar");
                       AdrenalineBar =  GetVariableObject("_root.BattleStatusPannel_MC.AdranelineTheBar");
                    
                       BaseOfAdrenalineBar =  GetVariableObject("_root.BattleStatusPannel_MC.BaseOfAdrenalineBar");
                       BaseOfVigourBar =  GetVariableObject("_root.BattleStatusPannel_MC.BaseOfVigourBar");
                       BaseOfHealthBar =  GetVariableObject("_root.BattleStatusPannel_MC.BaseOfHealthBar");
                    
                       //The ArenaMouse
                       ArenaMouse = GetVariableObject("_root.arenaMouse");
                       InvPopUpWindow = GetVariableObject("_root.InventoryPopUpWindow");
                    
                    
                       //Windows
                    
                       //RPG gameplay
                    
                       //PlayerInventoryWindow
                       PlayerInvWindow =  GetVariableObject("_root.PlayerInventoryWindow");
                       //merchantToPlayerWindow
                       merchWindow = GetVariableObject("_root.MerchantWindow");
                       //SkillToPlayerWindow                                                                              /////////////////////////////////////////////////////
                       SkillWindow = GetVariableObject("_root.SkillsWindow");                             //    here!                                                    //
                       //arenasListPanel
                       ArenasWindow = GetVariableObject("_root.PlayerArenasPannel");               /////////////////////////////////////////////////////
                       //Chest window
                       ChestWindow = GetVariableObject("_root.ChestWindow");
                       //HouseM window
                       HouseMerchWindow = GetVariableObject("_root.HouseStuffWindow");
                       //mAP Window
                       MapWindow = GetVariableObject("_root.MapWindow");
                       //BeforeBattle Window
                       BeforeBattleWindow = GetVariableObject("_root.BeforeBattleWindow");
                       //ItemOptions window
                       ItemOptionsWindow = GetVariableObject("_root.ItemOptionsWindow");
                    as for example

                    Also , to start in actionscript

                    " MAKE NOT ALL YOUR WINDOWS EXTEND FROM THE SAME FORM "

                    Click on the pic wich is suposed to be the window , then convert into symbol
                    After that you define the symbol form

                    MySymbol form , " this with every window you do " o if you change something in one , you gona change something in all of em ...

                    Then give it an instance name , like daimakuInventoryWindow hehe whatever : ) .

                    I made a fast tut on how to set up inventory slots in order to make your ivnentory , also chosker made one aswell wich is more complex

                    Comment


                      #11
                      thanks Neongho, i think i got the main idea on how to handle and do this, by the way, where is your tut for the inventory ?

                      i will try to do this on my rpg inventory, if i have any question i will ask here.

                      thanks again Neongho.

                      Comment


                        #12
                        http://forums.epicgames.com/threads/...light=ItemSlot
                        serve urself! , also if you have any critic or you get stuck on it tell me so i can even correct it By the way : ) .

                        This took me 3 days to figure out , but lucky you are you will only have to stay 2 hours or moar if you follow this,

                        Well the basis is that , data , that data provider with your self made struct contains the information for transactions and that stuff ,
                        such as demage item type item id ...

                        Comment

                        Working...
                        X