QQuix Posted May 6, 2008 Author Share Posted May 6, 2008 Hi, again, Vagrant0, I decided to stay a little late and run some tests. Maybe the results will convince you that, at least in my scenario, the getref+duplication thing will not cause any trouble and my mod is not irresponsible as you said. (here is where I got really mad at you … but I don’t keep bad feelings for more than a few seconds … they take you nowhere) The issue at hand is my script that do both: the GetRef scan and the item duplication: I forced it to run EVERY FRAME, while I ran 10 round-trips between the front door and the counter inside Divine Elegance It ran 1982 times in a few seconds and created 1982 copies of each of the 319 items in the cell´s containers Results: Performance: I couldn’t feel any difference. Not even an extra flicker on the screenSavegame size: 6 Kbytes increase (from 3.034.443 to 3.040.693)I don´t expect the script to run even a fraction of that. It will run ONCE per game load, the first time the player enters the showroom.And I won´t create any new object after this point Link to comment Share on other sites More sharing options...
QQuix Posted May 6, 2008 Author Share Posted May 6, 2008 Vagrant0, I am not skilled enough in writing, in order to tell you how seriously I take every single word you wrote and how much I appreciate you taking the time to write them. I want to finish this mod, I want it to be as good as it could be and I want people to use it. And, in the process, I want to learn as much as I can, so I may write even better (and more useful) mods in the future. I still don´t see any way of doing without the getref, but It just occurred to me a way to avoid the duplication. But it is 5 AM down here and I am not thinking well. I will explore this new idea a little further and do some tests. I hope you can take some time to tell me what you think. PS. My previous post was written before I saw your last. So the thread got a little out of sync. Link to comment Share on other sites More sharing options...
Vagrant0 Posted May 6, 2008 Share Posted May 6, 2008 Vagrant0,I still don´t see any way of doing without the getref, but It just occurred to me a way to avoid the duplication. I will explore this new idea a little further and do some tests. I hope you can take some time to tell me what you think.As I had said, you really can't do anything of this sort without getref. Since it is only being run once per load, there aren't any concerns about it. One reason why you havn't noticed your save getting bloated is because all you are doing is adding items to a container, and not actually loading any of them into the game. The other end of that is also how many of those items were scripted. As to your new idea, hopefully you aren't just dumping all the containers within the cell to a new one. While yes, it would get around that duplicate issue, it could be bad depending on what respawn settings you have on that container and what wasn't initially in a respawning container. Making it a non-respawnign container would create problems similar to the duplication thing since the contents of the shop would be increasing every time the cell respawned. Given that most clothing mods use respawning containers, this isn't a particularly serious issue, but in those odd cases of some mod adding something which doesn't respawn, may create problems for others. The changing booth idea also suffered from this, but was more limited in that things would only be moved if they were tried out, rather than everything being moved. Link to comment Share on other sites More sharing options...
wizardmirth Posted May 6, 2008 Share Posted May 6, 2008 Wizadrmirth, I didn't quite understand your method, and I would appreciate if you detail it a bit. But, from the little I understood, it does not apply to my scenario. My mod has to do with clothes. Clothes are created by the hundreds by many moders and I can't / shouldn't / wouldn't include their meshes/textures in mine. I am doing a Fashion Show or Showroom were the player can see the clothes before buying. And I want it to be dynamic, so if a new clothes mod comes out in the future, the player would be able to see those new products the shop has to offer.They are different goals but in any case duplicate references are a bad idea. I like your idea and hope you can find a way to do it efficiently. My goal is to convert clothes & armor mods that normally dump the items somewhere so that they appear in my new shop for sale. I was also thinking of trying to create a resource where modders can easily put their items into one place like a new vendor chest or normal chest so that all new mods that are give-aways can all be found in the same place. Link to comment Share on other sites More sharing options...
QQuix Posted May 6, 2008 Author Share Posted May 6, 2008 Vagrant0, No. Nothing of such. Being my first mod, I want to make it as isolated as possible. That was the reason for the idea of copying the items once and not touching those containers afterwards. This way I tried to reduce the damage of an eventual bug in the code. The ‘new idea’ may not be as good as I first thought. But I would like your opinion if it would be any better. What I really need is a reference to the base object of each items in the vendor chests so I can use something like ´Model04.AddItem FancyBootsObjectID 1´. The idea is to create a linked list of some clutter item, let´s say a Cup (or an inkwell or whatever). Each of the cups would store a reference to one of the items in the vendor chests.That is why I think it is not that good after all: instead of adding 300 items to my MainDresser, I would add 300 cups to some hidden cell. The only advantage I can see right now is that they would be my own objects and if the player deactivates the clothes mod(s), there wouldn’t be a single ‘foreign’ object in my basement in the saved games. Only references that I won´t need anymore, as they will be refreshed on the next game load. What do you think? Is it worth the trouble? Another thing: How come the AddItem/RemoveItem functions are spread all over the CS WIKI sample codes without a single warning about overusing them? There are some issues about duplicating the base object, but that is not my case. I don´t have any use for different base object, for I am not changing any of the item´s attributes. Link to comment Share on other sites More sharing options...
Vagrant0 Posted May 6, 2008 Share Posted May 6, 2008 Another thing: How come the AddItem/RemoveItem functions are spread all over the CS WIKI sample codes without a single warning about overusing them? There are some issues about duplicating the base object, but that is not my case. I don´t have any use for different base object, for I am not changing any of the item´s attributes.Don't really understand how your idea works. It seems like it would take alot more scripting, and would still be duplicating those items. The moving everything to a new container, then building your list off that container, and taking things out of that container to use on the models would probably be a better option. The issue with disabling one mod or another is similar to what can happen with house mods. If you put stuff from another mod in containers belonging to that house mod, those items "can" cause problems to occur if the mod which those items belong to is disabled. Sometimes these problems, although small, can be enough to break a saved game. If the housemod is disabled, anything stored within the mod simply goes poof, which just sucks for the player. The reason why there aren't any warnings with additem/removeitem is because most people using them aren't doing so quite as much as what you are intending to do. What you might want to read ishttp://cs.elderscrolls.com/constwiki/index...Common_MistakesWhich covers some of the reasons for bloating. Just instead of using duplicateallitems, you're making hundreds of individual copies. The result is still the same once those items have been put into use by something. What you might want to do, is focus on how the list is made and used, not on what happens with items. A better solution might present iteself if you work from the end result toward the beginning. Link to comment Share on other sites More sharing options...
QQuix Posted May 7, 2008 Author Share Posted May 7, 2008 Today, I cycle thru the container and the items inside them. For each item, I do a "MainDresser.AddItem item 1" The idea works like this: Instead of the AddItem, I set a "ref CupItem" (that is in the Cup script) to the original item. This way the original item wouldn’t be duplicated. I already have the code to cycle the cups to set/retrieve data inside. Then when I need to, I locate the proper Cup and use something like ´Model04.AddItem Cup.CupItem 1´ and lather on I do a ´Model04.RemoveAllItems´. This is already coded and working fine. As for the end result, it is to make the player´s life easier if it has installed some of the many mods that add clothes to DE. To accomplish that, I have a few items on a table in the showroom: Two are activators: as the models enter the stage, one at a a time, the player can click one of these activators to add the clothes the model is wearing to one of two lists that we could call "Shopping Cart" and "Wish List" (like in Amazon.com); This way, I break down the initial large list into smaller and more manageable lists. The wish list will be used the next time the player visits the show room and asks (clicking a third activator) to review it. This way the models will show only clothes from the wish list. The cart list is a container to be used as a vendor container (an additional vendor), so the player will be presented a much smaller and pre-selected list in the buy/sell menu and he can just buy the whole list, as it was he who built the list in the first place. But the real problem is how to compose the set of clothes the models will wear together (meaning which boot goes with which skirt, glove, etc) There is no way I can do it in code. Here I can´t avoid presenting the player the huge list I tried to avoid all along. But, at least, the list will get smaller over time as the player moves items to the other lists. This way, the player himself will tell the mod which item goes with which. All the lists interface with the player by filling up a container when the player opens it and using RemoveAllItems afterwards (CS WIKI says that RemoveAllItems prevents savegame bloat). The interface will be the same the player uses when he opens any other container in the game (no MessageBox whatsoever ...I hate them). This interface is also very limited, but is the best I have within the game engine limitations. Same thing goes for the use of activators, as I also don´t like the game´s dialog system. You see? We debated over the initial duplication, but everything you said applies also to other parts of the mod and is directly related to my end results. I am moving things around much more carefully than I was before. Link to comment Share on other sites More sharing options...
Vagrant0 Posted May 7, 2008 Share Posted May 7, 2008 And now you're just complicating things further. As I mentioned previously, you were attempting to do something which the game was not designed to do. Any time this is the case, there will be some aspects which just don't work very well. Most of the interface stuff for instance is hard coded. There are only two ways to select items from a container, one is message boxes, one is the standard inventory menu. If neither work to what you want to do, you cannot do it. The problem with using a inventory menu is that things selected go to the player, and not anywhere else. Trying to figure out what was taken out, and then transfer that item somewhere else is complicated enough in and of itself. And if you had read, removeallitems only prevents bloat if the items are never duplicated in the first place, but instead are moved from one container to another. Using it with scripted items will still result in those scripts existing within memory. Link to comment Share on other sites More sharing options...
Vagrant0 Posted May 7, 2008 Share Posted May 7, 2008 Maybe you decides using pluggy is a good idea. it is not even hard to install to ones that already have OBSE.The problem with using something like pluggy, is that the OP wanted to have things work with any mod, even those which havn't been done yet, as well as mods which they themself don't use. This is the main reason why OBSE and Nextref are needed. If it was for personal use, or if they only wanted certain mods to work with it, they could just simply merge all the mods together, and require people just obtain the data files for those clothing mods, and not have to deal with nearly as many complications, nor would they need to use OBSE. Link to comment Share on other sites More sharing options...
nosisab Posted May 7, 2008 Share Posted May 7, 2008 Maybe you decides using pluggy is a good idea. it is not even hard to install to ones that already have OBSE.The problem with using something like pluggy, is that the OP wanted to have things work with any mod, even those which havn't been done yet, as well as mods which they themself don't use. This is the main reason why OBSE and Nextref are needed. If it was for personal use, or if they only wanted certain mods to work with it, they could just simply merge all the mods together, and require people just obtain the data files for those clothing mods, and not have to deal with nearly as many complications, nor would they need to use OBSE. I think another way, vanilla scripting is poor... it is not the SDK, it is not enough to more than simple things and is OK if simple things are sufficient to whatever we want. The point is that so far I know, there are no impediments to use OBSE, nor even the legal kind. Pluggy and TSFC are plugins to OBSE and they extend the scripting capacity to pointers. Pointers are among the most powerful low level instructions any language can have, including C (assemblers don't need even being mentioned). Tools so powerful are to be used with responsibility, no doubts here. But there are things that can't be accomplished without then, or else be very difficult to do, enough to be close unfeasible. And you touched the point that seems to me the very focus of this thread... capacity to manipulate things of other existent mods, and even those not yet existent. At this level not even licenses issues are concerned, these would be problems to solve at higher one. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.