Aller au contenu

Photo

Plot Flag Item Addition


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

#1
Odangou

Odangou
  • Members
  • 56 messages
Hello everyone! I'm desperately hoping that I'm posting in the correct forum for this...

I've been trying to add my own items to my inventory upon start-up. I followed this tutorial and at first experienced success, but am now having trouble when I try to add more items in the same script. I was hoping that someone could take a look at what I have written and tell me if they see any errors... 

SCRIPT: 

#include "utility_h"
#include "plt_my_custom_plot"

void main()
{

if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG ) == TRUE )
return;

event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);


switch ( nEventType )
{

case EVENT_TYPE_MODULE_LOAD:
{

UT_AddItemToInventory(R"selietharmor.uti", 1);
UT_AddItemToInventory(R"seliethboots.uti", 1);
UT_AddItemToInventory(R"seliethgloves.uti", 1);
UT_AddItemToInventory(R"devotionshield.uti", 1);
UT_AddItemToInventory(R"devotionsword.uti", 1);
UT_AddItemToInventory(R"dragonsfang.uti", 2);
UT_AddItemToInventory(R"stenarmor.uti", 1);
UT_AddItemToInventory(R"stenboots.uti", 1);
UT_AddItemToInventory(R"stengloves.uti", 1);
UT_AddItemToInventory(R"stenhelm.uti", 1);


WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG, TRUE );


break;
}
default:
break;
}
}

_______________END SCRIPT

The first 6 (selieth set, devotion set, and dragonsfang) items load in older saves but do not appear in newer and most recent saves. The "sten" item series does not appear at all. I have tried working around this, and saving the game without the content enabled and then enabling the content again to no avail. Any help would be appreciated!

Thanks :) 

EDIT: If it makes any difference, in my palette window, all the items have their in-game names appearing next to them in parenthesis, but the "sten" items do not. I've compared everything between the items, and I haven't done anything differently with the new items than I did with the ones that appear in game...

Modifié par Odangou, 16 janvier 2011 - 10:31 .


#2
Karma

Karma
  • Members
  • 391 messages
It's probably suffering from the same "bug" that many of the other item addition mods have. Basically, it works right the first time and then you have to mess around with disabling it, resaving, and then re-enabling it to get it to work in future games.



Is it imperative that you add the items this way? If not, you could do it the simple way and just add the items via the console. The script is a little shorter, it doesn't require any complicated plots, and it works whenever you want.

#3
Odangou

Odangou
  • Members
  • 56 messages
Hey Karma!



Thanks for the reply :) Actually, I've been thinking about adding these items via individual scripts, but can't for the love of me remember the place I saw the tutorial to do it. Is there any chance that you know the link to that portion of the toolset wiki?



Thanks again for the help!

#4
Karma

Karma
  • Members
  • 391 messages
Individual scripts? Like via the console?

You could use the console to run a script like this:
[dascript]
#include "utility_h"
void main()
{
UT_AddItemToInventory(R"selietharmor.uti", 1);
UT_AddItemToInventory(R"seliethboots.uti", 1);
UT_AddItemToInventory(R"seliethgloves.uti", 1);
UT_AddItemToInventory(R"devotionshield.uti", 1);
UT_AddItemToInventory(R"devotionsword.uti", 1);
UT_AddItemToInventory(R"dragonsfang.uti", 2);
UT_AddItemToInventory(R"stenarmor.uti", 1);
UT_AddItemToInventory(R"stenboots.uti", 1);
UT_AddItemToInventory(R"stengloves.uti", 1);
UT_AddItemToInventory(R"stenhelm.uti", 1);
}
[/dascript]

[You could also use the CreateItemOnObject() function instead of UT_AddItemToInventory().]


There's also an additem mod @ http://www.dragonage...ile.php?id=1131
It has a nice script that you could amend to include your items. Take a look at the file additem.nss. That script lets you add items individually without having to write a million different scripts.

You could use the console to initiate a "cheat" dialogue. You could have a different conversation line add the different items by setting a plot flag. (But this way just seems unnecessarily complicated.)

If you don't want to use the console, you could always add your own merchant to camp, so you could buy the items separately. That's what I do for my personal use. I got rid of all my equipment mods, remade the items using the models from those mods, and just added those items to a new merchant in camp. It saves on clogging up my inventory and writing a million different additem scripts.

Modifié par satans_karma, 17 janvier 2011 - 06:07 .


#5
Odangou

Odangou
  • Members
  • 56 messages
Wow! This is most excellent! I think I will try the code first and once I figure out how to do that, I'll step it up and try to add my own merchant :3



Thank you so much for this post!

#6
Odangou

Odangou
  • Members
  • 56 messages
Well, I've tried to open the .nss and .ncs files from the additem modules in toolset, but I keep getting the same error:



"Unrecognized type, this file is corrupted, etc." It also says something about ownership not being mine...



Not sure what I'm doing wrong or how else I can open it.

#7
Karma

Karma
  • Members
  • 391 messages
Try opening the .nss file with a program like Notepad (or Notepad++). Copy-and-paste the contents into a new script in the toolset. Use the toolset to amend it with your items.

(Obviously if you are planning to use this script for more than personal use, you should ask the additem modder for permission to use it.)

Modifié par satans_karma, 17 janvier 2011 - 02:51 .


#8
Proleric

Proleric
  • Members
  • 2 346 messages

satans_karma wrote...
Obviously if you are planning to use this script for more than personal use, you should ask the additem modder for permission to use it.

As it happens, that's controversial.

Since it's a sensitive issue, it might be best to acknowledge that there is more than one point of view, and leave it at that.

#9
Karma

Karma
  • Members
  • 391 messages
You are correct. Allow me to rephrase:

"If you are planning to use this script for more than personal use, it would be polite (though technically unnecessary) to ask the additem modder for permission to use it (if no terms of use are explicitly stated) and to credit the author's work where appropriate."

Then again, does the BSN terms of use apply to mods found on the Nexus?

Modifié par satans_karma, 20 janvier 2011 - 01:36 .


#10
TellurianSky

TellurianSky
  • Members
  • 1 messages
First off let me start off by saying Im a completely new to this and have no knowledge. I was wondering if someone could tell me how to create a console script for: http://www.dragonage...ile.php?id=1330 Ive tried to find the oringinal creator but its been unsuccesful. Thank you for your time.

#11
Karma

Karma
  • Members
  • 391 messages
You need the name of the resource (xxx.uti). Then you just substitute that into the script I posted above. Compile and save the script with the toolset.