Jump to content

Photo

Item cheat?


  • Please log in to reply
12 replies to this topic

#1
Lehcar

Lehcar

    Faithful poster

  • Members
  • PipPipPipPip
  • 2,068 posts
Is there a mod that lets you add any item to your inventory?

#2
Lehcar

Lehcar

    Faithful poster

  • Members
  • PipPipPipPip
  • 2,068 posts
There is supposedly one at Cheathappens, but you need to subscribe in order to download...

#3
Lehcar

Lehcar

    Faithful poster

  • Members
  • PipPipPipPip
  • 2,068 posts
?

#4
hdhd

hdhd

    Enthusiast

  • Members
  • PipPip
  • 222 posts
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 "";
}


#5
Don_Kain

Don_Kain

    Fan

  • Members
  • PipPipPip
  • 399 posts
http://www.dragonage...ile.php?id=1035

Get.

#6
hdhd

hdhd

    Enthusiast

  • Members
  • PipPip
  • 222 posts
@Don_Kain
This mod spawns only merchants but isn't an additem console command.

@Lehcar
I 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");


#7
Kamajii

Kamajii

    Enthusiast

  • Members
  • PipPip
  • 176 posts

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

#8
hdhd

hdhd

    Enthusiast

  • Members
  • PipPip
  • 222 posts
Okay, here's the source http://pastebin.com/sds4hmD7

I also uploaded it on nexus http://www.dragonage...ile.php?id=1131

#9
Kamajii

Kamajii

    Enthusiast

  • Members
  • PipPip
  • 176 posts

Okay, here's the source http://pastebin.com/sds4hmD7

I also uploaded it on nexus http://www.dragonage...ile.php?id=1131


You're right, that is indeed long.

#10
Lehcar

Lehcar

    Faithful poster

  • Members
  • PipPipPipPip
  • 2,068 posts
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?




Page loaded in: 0.987 seconds