|
stranger
|
OP
stranger
Joined: Mar 2016
|
Was messing around the _Trade file, but with no sucess.
My goal is to force vendors to regenerate their stocks everytime you talk to them
|
|
|
|
journeyman
|
journeyman
Joined: Sep 2014
|
Hello.
Can you try this code (have not tried myself)
Register the trader you want to regenerate in INIT section of some of your goals:
e.g DB_RegenTrader(CHARACTER_YourTrader)
In KB section add this code
IF DialogStarted(_,_Inst) AND DB_DialogNPCs(_Inst,_Trader,_) AND DB_RegenTrader(_Trader) AND DB_DialogPlayers(_Inst,_Player,1) THEN GenTradeItems(_Player,_Trader);
Let me know if it worked
Cheers!
Last edited by Cadmus88; 24/03/16 09:52 AM.
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
OK, thanks, will try that!
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Not working. But i ust say im no modder, so....
|
|
|
|
old hand
|
old hand
Joined: Aug 2014
|
Can you even alter the scripts in main at all and have any changes stick? I mean, you're modding the main scripts, rebuilding the story and reloading the level? And you've tried making your own goal (not using an existing one)? Hard to troubleshoot without knowing what you've done and also, without having the editor myself >.< Why Steam so slow.
|
|
|
|
journeyman
|
journeyman
Joined: Sep 2014
|
Example:
INIT: DB_RegenTrader(CHARACTER_CYS_FishSeller);
KB: IF DialogStarted(_Dialog,_Inst) AND DB_Dialogs(_Trader,_Dialog) AND DB_RegenTrader(_Trader) THEN DoGenTradeItems(CHARACTER_Player1,_Trader);
Can you try this? It works for me, but osiris is very dependent on how your goals are organized, so if it don't work I need to take a look at you story structure, to understand what is wrong.
Cheers!
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Thanks guys
Im away for easter, so when i return ill test these.
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Completely lost
Cant build the story in the editor, no changes applied
|
|
|
|
old hand
|
old hand
Joined: Jun 2013
|
Completely lost
Cant build the story in the editor, no changes applied The script Cadmus posted works for me. It both builds and regens the trader as intended. So the error is probably related to something else. Did you paste the KB: and INIT:? Because you don't need those, those are the locations where you paste each script. Paste the line DB_RegenTrader(CHARACTER_CYS_FishSeller); in the top INIT section of the goal. And paste the rest of it in the KB section. Also with Cadmus's script you'll need to add a new DB for each trader you want to regen like that. So one DB for the fish seller, one for the potion vendor, etc etc.
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
I didnt add the INIT and KB
Im a newbie here, so i may need i step by step on this
Are u guys addin new goals or editing an existing one??
I do this on the "story" menu on the editor, then build the story
Btw, on a created mod
|
|
|
|
journeyman
|
journeyman
Joined: Sep 2014
|
Hey, so you need to create a new goal, as described here http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=580698#Post580698It need to be a goal that contains a game start event. To this goal you need dock a child goal, where code above need to be added. You need to add each trader you want to regen items in database in INIT section Here is the example how it can be done Goals.zip
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Working guys!!
Thx a lot!!
Any way to make these to work with an old savegame??
|
|
|
|
journeyman
|
journeyman
Joined: Sep 2014
|
I think not. Story chages break savegames
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Everithing was running smooth until i ran into a savagame crash when trying to start a dialog with the traders i put into the RegenTrader
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Loaded an early savegame to test this. Started and ended the dialog with a trader registered to regen quite a few times and got the same crash. It seems there`s a set amount of times i can regen the traders stock. or is something related to memory in the savegame.
|
|
|
|
Support
|
Support
Joined: Mar 2003
|
There is a maximum limit of 64k global items; after that the game runs out of handles for objects, and can crash when trading or generating loot. This should be changed in D:OS 2, but in the EE normally it takes a great deal of crafting and/or trading to reach this limit (I only know of one case, at a game time of just under 350 hours).
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Any way to check if my save reached that limit??
.dmp files??
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Also, everytime the game crashes, Steam updates the game before i can launch it again
|
|
|
|
Support
|
Support
Joined: Mar 2003
|
I'll check if there is a way you could determine how many handles are in use.
If you disable Steam cloud support, does that get rid of the update? That can be done either globally (in the client click on the Steam menu and select Settings, and then Cloud) or just for this game (in the library right click Divinity: Original Sin Enhanced Edition and select Properties, then switch to the Updates tab and check the Steam Cloud section).
For testing, you can exit out of the Steam client and start the game directly from the '..\SteamApps\common\Divinity Original Sin Enhanced Edition\Shipping\EoCApp.exe' program file. You would just be missing the Steamworks functions that way (achievement and playtime tracking, online lobby / Steam friend invites and cloud saves).
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Disabling the SteamCloud has solved the update issue.
Started a fresh game and tested how many times i could start a dialogue with Cylia the Enchantress before the game crashes.
She usually has 170-180 items in her inventory.
Counted 373 dialog starts (and inventory regen) 373 * 170 = 63.410
Pretty close to that 64k limit.
|
|
|
|
stranger
|
OP
stranger
Joined: Mar 2016
|
Any way to edit the trader's inventory??
|
|
|
|
addict
|
addict
Joined: Sep 2015
|
Trader inventories are defined in the TreasureTable.txt files as far as I know. Trader inventory = treasure = NPC inventory. Everything's for sale. So it should be possible to add items to trader inventories via story or char script as well.
|
|
|
|
addict
|
addict
Joined: Mar 2016
|
There is a maximum limit of 64k global items; after that the game runs out of handles for objects.
Do handles become available for reuse when you call ItemHandleDelete(_handle)?
|
|
|
|
Support
|
Support
Joined: Mar 2003
|
No, handles are not reused after being deleted. The handle is a combination of an index, which is reusable, and a usecounter, which is incremented each time it is assigned, so is always unique.
|
|
|
|
addict
|
addict
Joined: Mar 2016
|
Thanks, so you basically cannot easily run out of handles if you keep creating and deleting items? Assuming the index and usecounter are both 16 bit numbers, that is (since that should result in a total of about 4 billion items).
Edit: at least if the usecounter is per index, rather than global for all indices. But if it is global, I don't understand its point, since you can just as well use every index once in that case (except if the idea is to use as few indices as possible?)
Last edited by Tinkerer; 20/04/16 04:34 PM.
|
|
|
|
Support
|
Support
Joined: Mar 2003
|
Local itemhandles are only valid until the next game reload or level change. Global items (anything traded to a merchant becomes global) can run out of handles eventually.
|
|
|
Moderated by Bvs, ForkTong, gbnf, Issh, Kurnster, Larian_QA, LarSeb, Lar_q, Lynn, Monodon, Raze, Stephen_Larian
|
|