Aller au contenu

Photo

New items: Codex entries - how to do it?


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

#1
fkirenicus

fkirenicus
  • Members
  • 396 messages
I've made custom items, set their ITEM_SEND_ACQUIRED_EVENT to 1 and made plot files for the items.
These are set to plot type "Codex-items".

But I don't see where - or rather how - the EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED comes into the picture. Do I need my own module_item_acquired script? If so, where do I "put it" (I'm an old NWN/NWN2 modder, and thus used to assign a script to a game event in the module properties. In the DA Toolset however, I cannot find such events, only the (module)  "script" in the General properties of the module).

I've looked at the SP resources, and of course there are a lot things I don't need there and also confuses me. E.g. the  HandleEvent(evEvent, RESOURCE_SCRIPT_MODULE_CORE);  - can I use this as is, or do I need to put in my own script instead, like this?
HandleEvent(evEvent, R"0fk_event_handler.ncs");

The core of the message is that I don't get the codex entries I've created in my plot files when I add the items to my inventory.

I've tried a search and read both the Wiki and Crimsoncobra's blog, but I still can't this to work. There's probably a vital part that I'm missing. All help is appreciated. 

#2
Apolyon6k

Apolyon6k
  • Members
  • 175 messages
Have you created a new module for your items?

If so, you can add the event EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED to your module script and set the needed plot flags there.

It could look like this:
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:
{
// the item's owner is the creature who triggered this event
object oOwner = GetEventCreator(ev);

// the item is the first entry in the event's objects list
object oItem = GetEventObject(ev, 0);
string sItemTag = GetTag(oItem);

// check the tag for special cases and raise appropriate plot flag
if(sItemTag == "flower")
{
WR_SetPlotFlag(PLT_TMOI_COOK_INGREDIENTS,FOUND_FLOWER,TRUE);
}
else if(sItemTag == "cake")
{
WR_SetPlotFlag(PLT_TMOI_COOK_INGREDIENTS,FOUND_CAKE,TRUE);
}

nEventHandled = TRUE;
break;
}

#3
fkirenicus

fkirenicus
  • Members
  • 396 messages
You know, this is somewhat embarrassing... Hehe. 
Thing is, my script in itself wasn't 100% (and probably still isn't), but the main problem here was because of my own laziness... Instead of creating unique - new - plots, I duplicated the main plot several times when I needed a new item codex plot. What do you think happened then? Yes, the plot ID for the main plot and all item codexes was one and the same... SILLY. :-)

Modifié par fkirenicus, 10 mars 2011 - 03:18 .


#4
Apolyon6k

Apolyon6k
  • Members
  • 175 messages
Oh yes, I hope they fix that bug in their update, I had that problem once and it had cost about a week frustration to get told never dublicate plots!

Hope it works now :)

#5
fkirenicus

fkirenicus
  • Members
  • 396 messages
Yes, all seems well now. The only thing is that my scripts probably will be considered "uncouth" by real scripters, but who cares - they seem to operate as intended. :-)

Modifié par fkirenicus, 10 mars 2011 - 04:05 .


#6
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
It's been known about for a while unfortunately: http://social.biowar...uneditable_GUID

We really need a way of bringing these showstopper bugs to the forefront, so people don't get frustrated about them as much.

Modifié par FollowTheGourd, 12 mars 2011 - 05:05 .


#7
Proleric

Proleric
  • Members
  • 2 346 messages
Agreed.

I've been adding bug links to the narrarative and tutorial topics on the wiki, to increase awareness, on an ad hoc basis. Maybe we should do that systematically?