ogionite Posted April 20, 2017 Share Posted April 20, 2017 Hi, I have searched but failed in finding something like what I'm after... I'm looking for a simple script to add to crates and barrels, that will periodically sell whatever is inside for about 1/10 of the "list price". I'm looking to expand the tieves guild accessories with a smuggling branch. For extra sprinkles and cherries n top, it would be great to be able to select what to be sold, alternatively make a "demands list" to see what is currently attractive to smugglers. I would hope this is already made somewhere, the game isn't exactly new, but I fail to find it... :/ Anyone? Link to comment Share on other sites More sharing options...
Surilindur Posted April 20, 2017 Share Posted April 20, 2017 One of the simple and also 'dumb' methods might be to use OBSE to calculate the value of all items. A foreach loop using individual item refs (sort of) might make it possible to adjust price on an item-by-item basis according to, for example, the damage sustained by weapons and such. However a GetItems call would be faster at times. The example below is dumb, uses base price set in the Construction Set (plus enchantment additions to price by using GetFullGoldValue instead of GetGoldValue) and only looks at the base price (however it may be named): scriptname YourPrefixSimpleGoldValue array_var TempArr ; temporary array iterator float TotalValue ; total gold value of items begin _Function {} ; initialise the TotalValue of items to 0 (probably already is 0, though) let TotalValue := 0 ; loop over each base item returned by GetItems, using TempArr as interator ; TempArr = { "key": <int>, "value": <ref> } foreach TempArr <- ( GetItems ) ; add the gold value of each base item, multiplied by the number of items the container has let TotalValue += ( ( GetFullGoldValue TempArr["value"] ) * ( GetItemCount TempArr["value"] ) ) loop ; set the OBSE user-created function return value that will be returned when the function exits setfunctionvalue TotalValue endI have not tested that, but something like that would be simple using OBSE. Calling it on a container would work like: let YourGoldValue := SomeContainerRef.call YourPrefixSimpleGoldValueBut it has been a while since I did anything much with Oblivion scripting, so there might be a small issue somewhere there. But hopefully it can give you an overall idea of what the script could look like when implemented one (simple and dumb) way. :thumbsup: The commands can be found in the OBSE Command Documentation. If someone knows of an existing solution (or has a better solution, an improved solution, ideas, anything really) feel free to chime in. If there already exists a working solution, then reinventing the wheel is probably somewat futile. :P Link to comment Share on other sites More sharing options...
ogionite Posted April 21, 2017 Author Share Posted April 21, 2017 That's great, but since I don't run OBSE there might be issues.... :/ I never got it to work properly on my system I'm afraid.This script is valuable to me either way as it gives me a good starting point. Thanks mate. Link to comment Share on other sites More sharing options...
Surilindur Posted April 21, 2017 Share Posted April 21, 2017 Ouch. Okay, no problem. However without OBSE that script is actually probably not a good starting point at all, being of a new 'script type' of sorts added by OBSE (function script, an object script by type, but not treated as one), using a loop structure of sorts and structured in a way that will never compile without OBSE. :blush: Are you running the game under WINE on Linux or something... ? Or an older version of Windows like Win 2000? OBSE should not really be impossible to get working, and you cannot use some of the more complex mods without it. :confused: Oh well. I hope you will find a solution somewhere - or hopefully someone will end up pointing you to one, whichever happens first. Link to comment Share on other sites More sharing options...
ogionite Posted April 21, 2017 Author Share Posted April 21, 2017 Thanks. I dunno why I never got it to work actually... Never bothered to dig into it.Well, I'll see what sort out. Link to comment Share on other sites More sharing options...
Recommended Posts