spinspider Posted April 23, 2010 Share Posted April 23, 2010 Is there a mod that lets you add any item to your inventory? Link to comment Share on other sites More sharing options...
spinspider Posted April 24, 2010 Author Share Posted April 24, 2010 There is supposedly one at Cheathappens, but you need to subscribe in order to download... Link to comment Share on other sites More sharing options...
spinspider Posted April 24, 2010 Author Share Posted April 24, 2010 ? Link to comment Share on other sites More sharing options...
hdhd Posted April 25, 2010 Share Posted April 25, 2010 I think the author on cheathappens added manually each item to the script because there isn't any ResourceToString function in the toolset yet. I tried for instance UT_AddItemToInventory(sItemTag, nAmount);additem.nss - additem.nss(57): Declaration does not match parameters (while compiling var_constants_h.nss) The main issue is when the user types in runscript additem R"item.uti". The UT_AddItemToInventory function only accepts resources not strings and because you can't convert them you have to hardcode the whole function: //found on social.bioware resource StringToResource( string sTemplate ) { if( sTemplate != "" ) { sTemplate = StringLowerCase( sTemplate ); if( sTemplate == "chicken.utc" ) return R "chicken.utc"; if( sTemplate == "hurlock.utc" ) return R "hurlock.utc"; // etc for every possible resource. } return R ""; } Link to comment Share on other sites More sharing options...
KainPrimus Posted April 25, 2010 Share Posted April 25, 2010 http://www.dragonagenexus.com/downloads/file.php?id=1035 Get. Link to comment Share on other sites More sharing options...
hdhd Posted April 25, 2010 Share Posted April 25, 2010 @Don_KainThis mod spawns only merchants but isn't an additem console command. @LehcarI made the additem script: // ----------------------------------------------------------------------------- // additem // ----------------------------------------------------------------------------- /* Adds an item to the player Usage: runscript additem <item tag> <amount> <item tag> - Resource of item to add to inventory <amount> - Amount of this item to add to inventory Example: runscript additem gen_im_acc_amu_am17.uti 4 */ // ----------------------------------------------------------------------------- // hdhd // ----------------------------------------------------------------------------- I would post the whole code but it is too big (1255 lines). I generated it with a php script (could probably be improved some more, but it's working :biggrin: ) //script to generate the StringToResource function, *.uti files have to be exported with the toolset <?php $path="c:\exported"; $file="file1.txt"; $fp = fopen($file, 'w'); chdir($path); fwrite($fp, "resource StringToResource( string sTemplate ) {\n"); fwrite($fp, " if( sTemplate != \"\" ) {\n"); fwrite($fp, " sTemplate = StringLowerCase( sTemplate ); \n"); foreach (glob("*.uti") as $filename) { fwrite($fp, " if (sTemplate == \"" . $filename . "\") return R\"" . $filename . "\"; \n "); } fwrite($fp, " }\n"); fwrite($fp, " return R\"\";\n"); fwrite($fp, "}\n"); Link to comment Share on other sites More sharing options...
Kamajii Posted April 25, 2010 Share Posted April 25, 2010 I would post the whole code but it is too big (1255 lines). I generated it with a php script (could probably be improved some more, but it's working :biggrin: ) Could always pastebin it if you don't want to post that big of a script in the post. http://paste2.org/new-paste Link to comment Share on other sites More sharing options...
hdhd Posted April 25, 2010 Share Posted April 25, 2010 Okay, here's the source http://pastebin.com/sds4hmD7 I also uploaded it on nexus http://www.dragonagenexus.com/downloads/file.php?id=1131 Link to comment Share on other sites More sharing options...
Kamajii Posted April 25, 2010 Share Posted April 25, 2010 Okay, here's the source http://pastebin.com/sds4hmD7 I also uploaded it on nexus http://www.dragonagenexus.com/downloads/file.php?id=1131 You're right, that is indeed long. Link to comment Share on other sites More sharing options...
spinspider Posted April 25, 2010 Author Share Posted April 25, 2010 Ahh yes thank you so much!! <3 But I'm not 100% clear on how to use this. Is there someplace where I can find a list what the "tag" for each item is? Link to comment Share on other sites More sharing options...
Recommended Posts