Spivey Posted November 18, 2012 Share Posted November 18, 2012 Ok just need to know if it is possable to do an item change out on load of a cell.. What I am looking to do is swap the static misc cigarette cartons and packs scattered around the game with one of two usable chem versions I have made. I know how to get the random and such to work to chance spawn one of the other two items, but what I need to know is if there is some way to (while spawning the new) remove the old world object. Thanks in advance to anyone with an answer thats not about me being dumb......or worse. Link to comment Share on other sites More sharing options...
Xaranth Posted November 18, 2012 Share Posted November 18, 2012 See the NVSSCap misc item and its associated script. Link to comment Share on other sites More sharing options...
Spivey Posted November 18, 2012 Author Share Posted November 18, 2012 (edited) Im not quite sure how to apply that...not that I don't thank you for some form of reply heh. The trouble is not swapping items in my inventory but rather the ones laying around the game world. For example the carton on the shelf in Doc's house at the start of the game, what I want to make happen is for it to be replaced by one of the items I have made when the cell loads. It will let me trash the item or add one at it's current location but not both at once. What I am looking for is a way to combine both actions. No way I can think to list the commands in the script to allow for me to do both actions. I have tried it in everyway my limited scripting skill will allow. One big complex mess of if's and then again super simple small and clean and the end is always the same...two cartons of random type or none at all. I can't place an item at the location of one that is disabled, but it won't let me disable the base item after I spawn the new one on it. I'm getting the notion that it might not be something I can do... Edited November 18, 2012 by Spivey Link to comment Share on other sites More sharing options...
Xaranth Posted November 18, 2012 Share Posted November 18, 2012 Im not quite sure how to apply that...not that I don't thank you for some form of reply heh. The trouble is not swapping items in my inventory but rather the ones laying around the game world. For example the carton on the shelf in Doc's house at the start of the game, what I want to make happen is for it to be replaced by one of the items I have made when the cell loads. It will let me trash the item or add one at it's current location but not both at once. What I am looking for is a way to combine both actions. No way I can think to list the commands in the script to allow for me to do both actions. I have tried it in everyway my limited scripting skill will allow. One big complex mess of if's and the again super simple small and clean and the end is always the same...two cartons of random type or none at all. I can't place an item at the location of one that is disabled, but it won't let me disable the base item after I spawn the new one on it. I'm getting the notion that it might not be something I can do... Ah, I'm guessing you made new 3D objects as well? Hm. Off the top of my head, this should work. An Object script attached to the existing Cigarette Carton/Pack objects. scn DunnyCigCartonReplace Begin onLoad PlaceAtMe NewCigaretteCartonObject Disable MarkForDelete end All this talk of cigarettes makes me want one. Mmm. Anyway, if I have time, I'll make a test mod later and see if it works, and if not, why not. But now I have to fix the dishwasher. Link to comment Share on other sites More sharing options...
Spivey Posted November 18, 2012 Author Share Posted November 18, 2012 Well should you go for that smoke enjoy it.... Only trouble is that was just what I tried in my short 'n' sweet version of the script. Last run came up with it just outright removing both objects, or maybe just removing the bas one and since it was gone not spawning the new one. Link to comment Share on other sites More sharing options...
Xaranth Posted November 18, 2012 Share Posted November 18, 2012 Well, that wasn't my partner in crime returning, so I had a chance to test it, and for me, I had no issues with the following two scripts. For testing, I swapped packs with cartons: scn DummyCigReplacerCarton begin onLoad PlaceAtMe CigarettePackDummy Disable MarkForDelete end and scn DummyCigReplacerPack begin onLoad PlaceAtMe CigaretteCartonDummy Disable MarkForDelete end They even preserved geometry, which I was afraid I'd have to do manually. Mind, if your new cigarette objects don't have identical geometry to the existing objects, you might have to account for that to avoid clipping/positioning weirdness. Let me know how it goes. Link to comment Share on other sites More sharing options...
Xaranth Posted November 18, 2012 Share Posted November 18, 2012 Well should you go for that smoke enjoy it.... Only trouble is that was just what I tried in my short 'n' sweet version of the script. Last run came up with it just outright removing both objects, or maybe just removing the bas one and since it was gone not spawning the new one. Hm, that's strange. Can I see the scripts you're using? And tell me how they're implemented. Screenshots of the form editor for your new objects and the modified cigarette objects would help, too. Isn't debugging lovely? Link to comment Share on other sites More sharing options...
Spivey Posted November 18, 2012 Author Share Posted November 18, 2012 That's just odd when I tried just that this morning it won't work. I have mine set up (or did anyway) to run only the 1st time the cell loads and then not just swap the items out but run a random roll to choose what one would replace it.. All that's missing from what you have is the random chance for it to replace the normal carton with my brand A or B but if it works without that it should work with it.. Back to the start I guess......... Link to comment Share on other sites More sharing options...
Xaranth Posted November 18, 2012 Share Posted November 18, 2012 That's just odd when I tried just that this morning it won't work. I have mine set up (or did anyway) to run only the 1st time the cell loads and then not just swap the items out but run a random roll to choose what one would replace it.. All that's missing from what you have is the random chance for it to replace the normal carton with my brand A or B but if it works without that it should work with it.. Back to the start I guess......... With the scripts I used, it will run when the items loads: With disable and markfordelete calls, the existing items will be gone, so you don't need to worry about a runonce flag. But if you only want to replace some of them on a pseudo-random basis, that won't work. You'd need a doOnce flag added. If your scripts are near-duplicates of mine, then there might be something else at fault. The first thing I would do is just place some of your own items directly into the world, probably in a test cell would be best. That will verify the geometry of whatever you want to replace the existing objects. If there's something weird with your pivot point, for example, the items you want might be spawning but placed so high or low you can't see them. There also might be some issues with FNV actually getting the geometry - pathing fails or whatnot. Link to comment Share on other sites More sharing options...
Spivey Posted November 18, 2012 Author Share Posted November 18, 2012 Well I am at a loss as to why but for some reason it will not work on the packs and carton in Doc's house at the start of the game.. It will run the replacer script but seems to always dupe the items so I end up with 2 cartons and 6 packs all of random types. But I decided so I would not have to hear the start up speech over and again I would drop one carton in Victors shack and it's workin on it. Reloaded game like 5 times and was swaping 'em out at random and removing the original. Not sure why the ones at Doc's don't work but I'll take it if thats the only bug. Seems it has been working just fine everywhere else so I feel like a total dumb ass. Lol seems I have been seconds from pulling out my hair for the last day and a half for nothing. Thanks very much though for confirming I was infact doing this right, now I just need to help the Powder Gangers in my next playthrough so I can whomp Doc in the head.. Link to comment Share on other sites More sharing options...
Recommended Posts