Aller au contenu

Photo

Create Item Script


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Arthyn

Arthyn
  • Members
  • 7 messages
Because the wonderful script that was given to us refers to some table that doesn't exist, I've tried to make my own version however it doesn't work.

void main()
{
    object oCreature = GetMainControlled();  
    resource rItem   = GetLocalResource(GetModule(),"RUNSCRIPT_VAR");
  
    CreateItemOnObject(rItem,oCreature,1);
}


I saved it to the _Debug folder and associated it with the core game resources.

Any thoughts?

Modifié par Arthyn, 15 novembre 2009 - 07:05 .


#2
Mutant Dwarf

Mutant Dwarf
  • Members
  • 48 messages
The problem is GetLocalResource. It returns a resource variable named after the second argument that's inside the first argument. RUNSCRIPT_VAR is not a resource variable, though - it's a string variable. What you need is a way to go from a string variable to a resource variable.



I haven't the faintest idea how to go about doing that, though. I only know how to turn a string constant into a resource - just shove an R in front of the constant, like:



resource rItem = R"gen_im_qck_book_attribute2.uti";

#3
weriKK

weriKK
  • Members
  • 106 messages
You can use the supplied createitem script through the developer console, all you need to to is create your 2da override of treasures.xls and put the items you wish to add to your character into it.

#4
Arthyn

Arthyn
  • Members
  • 7 messages
So I'd have to create my own Excel file called treasures.xls, put it in the

Dragon Age\\tools\\Source\\2DA directory, and then list all the items I want to put in game in the table under a column called "Weapons". Then, when I wanted to call it in game I would have to call it like



runscript createitem 125



125 being the row that the item's file name is listed. Because when they go to call the resource in the script, it looks like this:



resource r = GetM2DAResource(TABLE_TREASURES,"Weapon",nId);



TABLE_TREASURES is referring to treasures.xls in the 2DA directory I assume. "Weapon" is the column, and nId is the row. At least, this is what I gather from the dascript.chm file that gives an explanation of all the scripts and functions used.



Is there no way to generate a table like this or will it have to be done manually?