theimmersion Posted May 12, 2018 Share Posted May 12, 2018 A duffle bag that you can wear, drop, stash in some container.The trick here is that itself opens a special container when "I" key is pressed. The problem is, you can move it to that special container.I made a workaround that removes it when dropped and readds to player but thats an ugly workaround.Can i somehow flag the item as a quest item when its container is being opened? BEGIN MenuMode 1008set rBackpackCURRENT to GetSelf ; <- Returns blank and fails in game (returns code) when it gets to 'setQuestObject' ! -.-#set rBackpackBaseCURRENT to rBackpackCURRENT.GetBaseObject setQuestObject rBackpackBaseCURRENT 1 ; USED TO RE-EVAL LISTplayer.AddItem Pencil01 1 1player.RemoveItem Pencil01 1 1 endifEND BEGIN GameModesetQuestObject rBackpackBaseCURRENT 0END And heres the meat, it will be lots more items and i need a way to not hardcode scripts to specific armor ID's but just use the armor id the script is attached to. I could not find a solution yet. Please help! I guess i could replace the above with:BEGIN MenuMode 1008setQuestObject theimmersionBackpack01 1 ; USED TO RE-EVAL LISTplayer.AddItem Pencil01 1 1player.RemoveItem Pencil01 1 1 endifEND BEGIN GameModesetQuestObject theimmersionBackpack01 0END But now image adding 10 backpacks, id need 10 scripts with as little edits as:script 1 attached tosetQuestObject theimmersionBackpack01 1script 2 attached tosetQuestObject theimmersionBackpack02 1script 3 attached tosetQuestObject theimmersionBackpack03 1 Instead of this (if its possible in some way)script 1 attached to theimmersionBackpack[01-10]setQuestObject this 1 Please help! Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 13, 2018 Share Posted May 13, 2018 I am...really confused about what you want to do. You want your duffel bag to be a quest item. I got that. Why you want that I have no idea. If it's an inventory item, it can't actually be a container, though it can link to one and thus have the appearance of one. But what this means is that the duffel bag item itself doesn't need to be a persistent reference because the inventory it links to is still technically a separate container. That's the best understanding I could get of what you're trying to do. Link to comment Share on other sites More sharing options...
theimmersion Posted May 13, 2018 Author Share Posted May 13, 2018 (edited) Sorry for confusion, tried to find words to condense what i want. Also was very tired because i tried to find solution to this thing all day yesterday.I have a mod i want to update, its called duffle bag. Its simple, you wear a duffle bag on your bag but if you press I key, it opens a container (simulating its the duffle bag) so naturally, it only works when you wear it, Also, if you place the duffle bag armor down and press E on it, message pops up asking you to:openequipcancelEssentially, a container you can transport.Now the problem im having is that you can put the duffle bag into that container (essentially put it into itself) if you get what i mean. That should not be possible. I made a script where if you place the duffle bag into itself (the container that simulates the inventory of the duffle bag), it will return it to you.But i have issue with that. See, if it was a quest item, it would not appear in the container menu in the first place so player cant place the duffle bag into the container by default, looks much better. Of course, side effect that you cant equip/unequip/drop etc. So, i want to toggle the quest item flag from the script but i somehow need to get the base id from the item the script is attached to so i can put the script on any backpack kind of armor and it will work.Otherwise, id need to create scripts for each armor. To highlight, id be using *setQuestObjec* but i just for the life of me cant figure out how to get the damn base id from the armor the script is actually attached to which is really weird. Naturally, im asking because *GetSelf / This* failed.So, i can create the script and hardcode the armor into that script but it would need separate scripts for each backpack armor which i dont want.I want to change the Base ID *setQuestObject theimmersionBackpack01 1* and change it for a variable that gets the base ID from the armor it is attached to.Like:set VarToHoldBaseID to *someway to retrieve the base id from the armor this script is attached to*setQuestObject VarToHoldBaseID 1instead of:*setQuestObject theimmersionBackpack01 1*because now i can make 50 shades of grey duffle bag if i so please and just use the same script.As it now stands, each armor would need its own written script. Hope this explains a bit better. :smile: The goal here: Make players inventory much much smaller, make a backpack mod with its own inventory that has carry weight capacity as well. Im trying to make a immersion mods. Edited May 13, 2018 by theimmersion Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 13, 2018 Share Posted May 13, 2018 (edited) I'm still a little confused about some of the second half of your post, but if I were doing this, if I understand what you want, I would use a slightly complex script with SetNoUnequip, which is a JIP LN function. If I wanted to get the Base ID of something, I'd use GetBaseObject, which is added in NVSE but I don't see a need for it here. Without JIP LN, I would use a script on the magic container that the duffel bag opens and put Begin OnActivate SetQuestObject <Duffel Bag BaseID> 1 StartQuest <QuestID of Duffel Bag Reset Quest> EndAs you can see this starts a quest that I would make. This quest would have Begin GameMode If MenuMode Else If <Duffel Bag BaseID>.GetQuestObject SetQuestObject <Duffel Bag BaseID> 0 Else StopQuest <This Quest> EndIf EndIf EndEdit: I'm on my way out the door and the script is rushed, so if it doesn't work, proofread it and see what you you can fix. Edited May 13, 2018 by EPDGaffney Link to comment Share on other sites More sharing options...
theimmersion Posted May 14, 2018 Author Share Posted May 14, 2018 And the issue here as i keep point out is that <Duffle Bag BaseID>How do i get it without hardcoding it? Link to comment Share on other sites More sharing options...
Mktavish Posted May 14, 2018 Share Posted May 14, 2018 Are you saying any armor piece can then be turned into a duffle bag by picking up this duffle bag world item.And you are wanting to place your script on the base id of the armor you happen to be wearing ? Because honestly I would just have a quest hold the scripting , or have a script base effect run it , via Actor Effect / Perk. And while the player is wearing the back pack ... they are the container just like normal.But you can put constraints on carry weight and item counts for immersion. Plus if it is for immersion ... why not make the player have to take the back pack off to look in it.Something like this on a quest script or Actor effect. Begin MenuMode 1002 ; player inventory If ; what ever conditions needed here. ; close the pipboy , and play animation forcing 3rd person like sitting in chair does. ; To take the back pack off and place it on ground. Player.PlaceAtMe MyBackPackRef 1 ; then move all the player inventory items not equipped , or filter a few others to it ? endifEnd And the player has a perk / entry point / Activate. To filter for this specific container ... which they will get the second option to equip and run a script there.Or it will open the container ... plus you could have a script on the container of menu mode 1008To let the player get the repair and equip different items functionality of the pip boy. Sorry that is just some rough idea ... but could get more specific if that route is within your end product vision. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 14, 2018 Share Posted May 14, 2018 I'm confused still. You should already know the base ID of the duffel bag if you made it. Here's how I would look for the base ID of one of my own items:https://prnt.sc/jhvmcu Link to comment Share on other sites More sharing options...
theimmersion Posted May 14, 2018 Author Share Posted May 14, 2018 (edited) Ugh... xD Ok, Please visualize.On the floor, you see a duffle bag which is a armor (biped 7 - backpack). If you press E on it, a message asks you to take it or open it.If you choose to open it, it opens a container (emulating its the backpack container, its in some cell for that purpose).If you choose to take it, you just take it in your inventory.But you can also open the backpack while you carry it by pressing I key (you just can, why is not important right now).So, when the container opens while the duffle bag armor is in your invenotry, i want it to become a quest item or what ever to hide it from the list.I can actually do all that like this: Begin MenuMode 1if BackpackState == 1set BackpackState to 2endifEND Begin GameModeif IsKeyPressed 23 != OpenInventoryContainerKeyset OpenInventoryContainerKey to IsKeyPressed 23endif ; RE-EQUIP AS UNEQUIPABBLE TO PREVENT PLAYER FROM PLACING IT IN THE CONTAINERif OpenInventoryContainerKey == 1set BackpackState to 1player.unequipitem theimmersionDuffleBagArmor 0 1player.equipitem theimmersionDuffleBagArmor 1 1theimmersionBackpackInventoryREF.OpenTeammateContainer 1endif ; AFTER MENU WAS OPEN AND CLOSED, RE-EQUIP AS REGULAR (DROP-ABLE) ARMOR PIECEif BackpackState != 0player.unequipitem theimmersionDuffleBagArmor 0 1player.equipitem theimmersionDuffleBagArmor 0 1set BackpackState to 0endifEND I keep noting here but dont get a is or is not possible answer nor solution to the detail im pushing for:If i was to make 10 different duffle bags, i would have to write a unique script for each duffle bag because its using the baseID name >theimmersionDuffleBagArmor< and want to avoid that. I want one script to work an all of them. I need this:player.equipitem theimmersionDuffleBagArmor 1 1toplayer.equipitem GetSelf 1 1 I wrote GetSelf as an example. So again, is it possible and how to get the ref or base id or whatever i need for "player.equipitem OBJECT 1 1" to work without hardcoding the BaseID's in the script? Edited May 14, 2018 by theimmersion Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 14, 2018 Share Posted May 14, 2018 So, is your major problem that you want to be able to put the duffel bags inside each other? In that case, the best way I know involves the SetNoUnequip command as it works on a reference, but it requires JIP LN. Are you willing to use JIP LN for your mod? Link to comment Share on other sites More sharing options...
theimmersion Posted May 14, 2018 Author Share Posted May 14, 2018 I give up. xD Link to comment Share on other sites More sharing options...
Recommended Posts