OblivionRanger Posted August 25, 2017 Share Posted August 25, 2017 As stated, I'm working on my mod "cherry." The basic idea is taking the idea of droppable gold and expanding it, along with adding container function to the coinpurses found throughout Skyrim. Coinpurses as containers will require either re-categorizing in CK - the three coinpurses (S,M, and L) are registered as harvestable flora in Vanilla - or creating three new strongboxes and assigning the coinpurse meshes accordingly. IE creating (StrongboxCPS [CoinPurseSmall]) with the mesh for a small coinpurse and replacing the harvestable Vanilla coinpurses with the new "Strongbox coinpurses. I would also like a limit per coinpurse; no more than say 25 septims in a small coinpurse [Container full]? The droppable coins would require four, maybe five, conditions (if my logic is correct) based on how many coins the player drops, similar to dropping arrows. If the player has 500 Iron Arrows in inventory and drops all 500, 500 individual arrows do not land on the ground around him. The game mechanics drop a certain number of quivers, each with a set number of arrows. Say 10 quivers with 50 arrows each. The script should end up doing something along the lines of:Player drops gold; check amountAmount is 101 - 250: drop large coinpurseAmount is 26 - 100: drop medium coinpurseAmount is 11 - 25: drop small coinpurseAmount is 10: drop object "Coinstack" (New texture/mesh of a stack of 10 gold coins)Amount is <10: drop individual coinsIf possible, I'd like the dropped coinpurses created by this script to act as semi-permanent containers, with the option to either open - to add or take gold - or to just take the whole coinpurse - a la current Vanilla mechanics.Honestly, I'd be content if it were possible to just drop X coinpurses dependent on gold amount dropped. The player drops 1248 gold; the game generates 4 large coinpurses, 2 medium coinpurses, 1 small coinpurse, 1 coinstack, and 7 individual septims. One other note, I've already added weight to the septims. I used a crafting recipe from CCOR as a guideline. 600 septims can be smelted in to one 5-pound gold ingot. So, 120 septims weigh roughly a pound and each septim weighs roughly 0.0085. For comparison, with 16 ounces to a pound; one ounce is 7.5 septims. Each septim weighs just a little more than an eighth of an ounce. From a RP perspective, this makes sense considering the relative cheapness of some goods in Skyrim, even after various economy tweak mods. (I run with Trade Routes and a low price anchor, and common clothes have an average value of around 9 septims.) So; that being said,1) Is it possible to change the category of an item in CK (Flora to container) or am I looking at a hard code/engine limit?2) How would I implement the change from harvestable coinpurse to strongbox style coinpurses?3) How should the drop script actually read?4) Is it possible to "drop" containers? 5) On the septim weight, does the balance seem about right? Reasonable? Any and all help is appreciated. Link to comment Share on other sites More sharing options...
OblivionRanger Posted August 25, 2017 Author Share Posted August 25, 2017 Note to Admin: If there is a more appropriate forum or subforum for this topic, please move accordingly. Thank you. Link to comment Share on other sites More sharing options...
greyday01 Posted August 25, 2017 Share Posted August 25, 2017 To make a coinpurse looking container just duplicate and rename a container then edit it so it uses the coinpurse mesh. It's the only way to change the category of in item. The rest I'm not sure how to do about it Link to comment Share on other sites More sharing options...
foamyesque Posted August 25, 2017 Share Posted August 25, 2017 As GreyDay says, the only way to convert them to containers will be to create new containers, assign the meshes appropriately, and replace all instances of the originals in the game world with your new ones. As that is a pretty monumental task I would look into ways of dynamically replacing the flora via a search quest and scripting, but I've never tried using them for that purpose so I can't say if it will work. Implementing the maximum amount is doable with a bit of OnItemAdded scripting, which can also serve to reject any attempts to add anything that isn't gold to the purse. Dropping containers is possible, either 'dropping' them through a script-driven PlaceAtMe(), or, if they were added to a player's inventory somehow (not usual, but possible) through the standard UI. Deleting the container when empty (i.e. someone did a take-all) is possible through an OnItemRemoved event. Adding additional activation options so that the player can simply take the whole purse without needing to open the container inventory at all is possible through a perk, using the Activate perk entry point, which then runs some additional scripting to transfer all the gold to the player (allowing the OnItemRemoved event to then clean up the container). Link to comment Share on other sites More sharing options...
OblivionRanger Posted August 25, 2017 Author Share Posted August 25, 2017 (edited) Dropping containers is possible, either 'dropping' them through a script-driven PlaceAtMe(), or, if they were added to a player's inventory somehow (not usual, but possible) through the standard UI.So, it would read something like:Player drops 250 goldplayer.placeatme StrongBoxCPLStrongBoxCPL Inventory count = f, 250 Deleting the container when empty (i.e. someone did a take-all) is possible through an OnItemRemoved event. This would be a scripted command to MarkForDelete? Similar to the ability to either read or take a book? [Always Pick Up Books mod] Thank you for the help thus far. Edited August 25, 2017 by OblivionRanger Link to comment Share on other sites More sharing options...
OblivionRanger Posted August 25, 2017 Author Share Posted August 25, 2017 Well, Strongbox with a coinpurse .nif responds to Havok. :) First step solved. Link to comment Share on other sites More sharing options...
foamyesque Posted August 25, 2017 Share Posted August 25, 2017 (edited) Dropping containers is possible, either 'dropping' them through a script-driven PlaceAtMe(), or, if they were added to a player's inventory somehow (not usual, but possible) through the standard UI.So, it would read something like:Player drops 250 goldplayer.placeatme StrongBoxCPLStrongBoxCPL Inventory count = f, 250 Deleting the container when empty (i.e. someone did a take-all) is possible through an OnItemRemoved event. This would be a scripted command to MarkForDelete? Similar to the ability to either read or take a book? [Always Pick Up Books mod] Thank you for the help thus far. MarkForDelete is a console command; the Papyrus equivalent is just Delete(). However there are some things that will prevent the object from actually being deleted, which you should read about on the CK wiki. It's good practice to put a Disable() ahead of Delete() for that reason. To do the placing and transfer, you'd want something on the lines of: Actor Property PlayerRef Auto MiscObject Property Gold001 Auto Container Property StrongboxCPS Auto Container Property StrongboxCPM Auto Container Property StrongboxCPL Auto ... Function DropPurse(int iGold) ObjectReference droppedPurse = none if PlayerRef.GetItemCount(Gold001) < iGold iGold = PlayerRef.GetItemCount(Gold001) endif if iGold < 25 droppedPurse = PlayerRef.PlaceAtMe(StrongboxCPS) elseif iGold < 100 droppedPurse = PlayerRef.PlaceAtMe(StrongboxCPM) else droppedPurse = PlayerRef.PlaceAtMe(StrongboxCPL) endif PlayerRef.RemoveItem(Gold001, iGold, true, droppedPurse) EndFunction It doesn't perfectly match to your desired conditions but it should illustrate the principles. Are you familiar with how properties work? Edited August 25, 2017 by foamyesque Link to comment Share on other sites More sharing options...
OblivionRanger Posted August 26, 2017 Author Share Posted August 26, 2017 Somewhat. I've been reading back over the tutorials in CK Wiki. And I have a very basic knowledge of Java, so the concepts are familiar. Off to work.... Thank you! Link to comment Share on other sites More sharing options...
OblivionRanger Posted August 26, 2017 Author Share Posted August 26, 2017 (edited) I should be able to do something along the lines of count-drop to generate multiple coin purses, right?I'll edit in the syntax when I get home tonight. Function CPLVal while iGold == 250 playerref.placeatme(StrongboxCPL)endwhile ;insert the function to the drop script along the lines of - if iGold == 50 playerref.placeatme(StrongboxCPS)elseif iGold == 100 playerref.placeatme(StrongboxCPM)elseif iGold > 250 function(CPLVal)endif Look right? At least in theory? That should cause the large coinpurses to drop as long as the player has at least 250 gold and then drop a medium and a small purse. Edited August 30, 2017 by OblivionRanger Link to comment Share on other sites More sharing options...
OblivionRanger Posted August 26, 2017 Author Share Posted August 26, 2017 OK, removing the coinpurse if it's emptied should use something similar to this script, right? ScriptName SimpleToggle Extends ObjectReference Bool bToggle Event OnActivate(ObjectReference akActionRef) bToggle = !bToggle ; Set Bool to whatever it's not - player takes all If bToggle ; True, player takes all ; Do stuff, delete() Else ; False ; Undo stuff, don't delete Endif EndEvent Found this in the complete examples on CK Wiki. Link to comment Share on other sites More sharing options...
Recommended Posts