dubiousintent Posted May 16, 2018 Share Posted May 16, 2018 Added 'TIP: Level Lists and GetBaseObject versus GetBaseForm' to "Scripting" section of the wiki "Getting started creating mods using GECK" article. Seems a little incomplete to me, so would appreciate any comments. [Edit: turned reference to Tip into a direct link, thanks to Mktavish.] -Dubious- Link to comment Share on other sites More sharing options...
Mktavish Posted May 16, 2018 Share Posted May 16, 2018 sorry dubious , but I cannot find the addition you mention from that link ... why not just link the specific page ? Did you know that Tunnel Snakes Rule !!! Link to comment Share on other sites More sharing options...
dubiousintent Posted May 17, 2018 Share Posted May 17, 2018 Because it's all one page. I usually either search the page on the string "TIP: Level Lists", or jump down to the "Refs: Scripting" section and click on the internal "Tip:" link there. Hmm. Let me see if the forum will permit that internal link. Yes it apparently does if I post it as an external link form. Learn some new. I'll do that in future. -Dubious- Link to comment Share on other sites More sharing options...
Mktavish Posted May 17, 2018 Share Posted May 17, 2018 So I guess you knew that Tunnel snakes Rule ? Sorry to drag up oldy moldy stuff then . Your post tip , with my addition suggestion. GetBaseObject Returns the base object id of the calling reference ... if called on references spawned by one. Will return the leveled character/creature form-ID found in the Lvled section below Creature / NPC of the object tree. Which will not be an actual NPC , but merely an object that holds a list of other Base actors.GetBaseForm (A function added by NVSE) Returns the actual base form of a leveled calling reference. Meaning it goes within the list of the lvled object , and finds the Base-ID it picked at random. Hence this would have to be called in scripting , after the Lvled item ref loads .~~~~~~~~~~~~~~~~ Just my 2cp on it ... and still could probably be explained better :laugh: Add edit : yes definitely adding a link to the actual page was most helpful Link to comment Share on other sites More sharing options...
dubiousintent Posted May 17, 2018 Share Posted May 17, 2018 I think those are good clarifications, and added them. But for "GetBaseForm", by my reading it returns the "Base-ID" template FormID common to all the instanced objects of the one randomly selected from the list rather than a "reference" FormID of the random object spawned. This is one of those instances where the precise distinctions between "Base-ID" (the template), "Ref-ID" (the instance reference), and the more general abstract "Form-ID" need to be kept in mind and made clear. BTW: I decided there are now so many TIPS (30) in the Scripting section they needed their own headers so they would appear in the ToC. It will make it easier to edit them as well. And it is not my intention to hijack this thread. Just it's spawned useful info for scripters. -Dubious- Link to comment Share on other sites More sharing options...
theimmersion Posted May 17, 2018 Author Share Posted May 17, 2018 (edited) Ok, to laying it all out. I want to make it so that you have only 50 carry weight. Picking up a backpack would have its own inventory and thus its carry weight of about 100 (balancing later to come)?The backpack cant be just in your inventory, its always equipped if you pick it up until you drop it. If you pick another backpack variation, the first one should be dropped. I want to expand that on Power Armors as well, you cant just have them in your inventory, you either wear them, or carry them via (z grab).Which i also want to make the z grab a bit more stronger and make it so it sticks when you change cells.Because your magic pockets cant hold a freakin' PA. xDThe issue im seeing tho is that backpacks would have to be persistent refs and manually placed if they are to have inventory each and also have somehow to disable the ability to sell it to vendors because of that. But you should be able to store it into a larger crate tho. Now id need to find a way to recognize its a crate for the backpack to fit. Want to make a brahmin follower as well that you could bring with you on your travels and carry your stuff.Want to make small stals with NPC renting or selling brahmin for that purpouse. Similar to Skyrim and horses, in front of major holds.But i digress...... first is to try and hinder player carrying 10+ guns/clothing/armors/etcWhich means backpacks. :smile:So, anyone up for a larger project mod? Perhaps should actually start a new topic for that mod im trying to make with a list of things need to be done and what is done etc... ? I callded it Fallout Restarted (yeah, just cant find a good name) xD Edited May 17, 2018 by theimmersion Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 17, 2018 Share Posted May 17, 2018 Yes, GBF will return a Base ID, not a Ref ID, which can be confusing as both types can be let/set to a ref variable. ----------------------------------------------------------------------------------------------------------------------------------So, for what you want to do, here are some general steps:1. The player carry weight is something you probably have already done. 2. The backpack carry weight can be done by linking them to another actor's inventory (put said actor in a special hidden cell and give them no AI) and usinghttps://geckwiki.com/index.php/OpenTeammateContainer 3. You can use a perk with an Entry Point for Activate, or you can just make all the in-world backpacks activators and script a message box. If you make them takable inventory items, you can do an OnAdd block that equips the item, whereas with an Activator, you'd add the inventory version (a separate form ID entirely) to the player and then script it to be equipped after adding it (in that same block, not using OnAdd), setting the NoUnequip flag. Whatever the case, the other button should be the OpenTeammateContainer button. Also, unless you need loads of conditionalised buttons, this is the best way to script message boxes:https://geckwiki.com/index.php/MessageBoxExAlt So far, all of this can be done on each duffel bag's base object. 4. You could use the hotkey with IsKeyPressed, but I'd rather use IsControlPressed or much better,https://geckwiki.com/index.php/SetOnControlDownEventHandlerand then explain in the description which hotkey you're setting it to use. This makes it easier to avoid conflicts, at least in my view. Unfortunately, the player can't change the hotkeys, so it's not perfect. If you want it to be the I key, then I'd still prefer an event handler:https://geckwiki.com/index.php/SetOnKeyDownEventHandler Note that event handlers must be set every time the game is launched. Do this with a quest that runs in MenuMode 4 and uses If GetGameRestarted. 5. What I think you are having trouble with is replacing theimmersionDuffleBagArmor from your example scripts with a more general thing, because what you never did was offer your complete script, formatted and indented in a code text box with an explanation of where it's used and I now suspect you were using a quest script. What you need to do is in that script, or any quest script, have a ref variable called rBackpack or rDuffelBag or whatever you want (but for our sake, please prefix it with a lowercase r). Then, when you want to do these operations on it, let/set that variable to GetEqObj 7: let rDuffelBag := GetEqObj 7 You can do a safety check by keeping all your duffel bag base IDs in a form list and then you can check If rDuffelBag.IsInList:https://geckwiki.com/index.php/IsInList 6. You can set the NoUnequip flag any time you like viahttps://geckwiki.com/index.php/SetNoUnequipand check it withhttps://geckwiki.com/index.php/GetNoUnequip 7. A simple way to handle forcing the player to be unable to hold the duffel bag without equipping it would be to use an OnUnequip block with one of these:https://geckwiki.com/index.php/Drophttps://geckwiki.com/index.php/DropAlthttps://geckwiki.com/index.php/DropMeOf course, you can add conditions in there if you like. 8. To switch duffel bags, you can include a check in the button that equips a duffel bag: If player.GetEqObj 7 Let rBackPack := player.GetEqObj 7 If rBackPack.IsInList <Form List You've Made For Duffel Bags> player.DropAlt rBackPack 1 EndIf EndIf9. All right, I need to get out of here. Ask me any questions, tell me if I forgot something, &c. &c. Link to comment Share on other sites More sharing options...
theimmersion Posted May 17, 2018 Author Share Posted May 17, 2018 Lots of info. Ill check and see what i can do. Awesome. Thanks! BTW, gotta ask, i just could not find anything on aligning mags or trigger in .nif files for weapons. I have a model where the clip is not where it supposed to be. No matter where i move it within the .nif file, it always ends up on the same but wrong location.Also, a list of the .nif strings that activate things would be nice if it existed (or however its called). Ya know, like you name a node ##PPInvis and anything within that node will be invisible unless equipped etc... That would be amazing. Would be cool if there were some that makes something invisible while holstered. Link to comment Share on other sites More sharing options...
EPDGaffney Posted May 17, 2018 Share Posted May 17, 2018 I would make a separate post about the .nif stuff. I've never actually worked with weapon NIFs, so you'd be waiting for someone else. Candidates that come to mind are uhMattBravo, madmongo, and pixelhate. I tend to think of pix as something of a NIF expert, and if you wanted to message him directly, you can tell him I suggested it and I apologise if he's busy. I realise my post has something about setting the NoUnequip flag as soon as you equip the backpack. I don't remember why I said that. I think I had a different approach in mind when I started, I left for a bit, and then I came back with a new plan. So you may want to disregard that line if you can't discern why I said it. Link to comment Share on other sites More sharing options...
theimmersion Posted May 17, 2018 Author Share Posted May 17, 2018 NoUnequip should be a safeguard the player doesnt place the armor into the container its connected to or doesnt sell it to a vendor and similar things. xD Ill try and work it out. Ill post my results. Link to comment Share on other sites More sharing options...
Recommended Posts