BlackSheep42 wrote...
Now I have another question.
When I added another #include plot script to the core module script, it refused to compile even before I'd added any events. Simply removing the #include line again made it compile correctly. I therefore assume that the module script doesn't like having more than one plot included.
You can have as many includes as you want (though you should minimize the number because, as the name implies, the entirety of the included script is included in your main script). I *believe* that you do not need to include scripts that were already included in an include (if that makes any sense). The only time I've gotten errors in compiling on the include line was because I didn't format it correctly or I accidentally duplicated the include. You should post the part of the script kicking up the errors.
BlackSheep42 wrote...
...what's the best way to include CAMPAIGN_ITEM_ACQUIRED events for multiple plots?
If you have tons and tons of campaign items, then you may want to consider doing it in another script like the official campaign does. However, if there are only a few, you could do it in your module script (that's what I do).
I'm copying and pasting my CAMPAIGN_ITEM_ACQUIRED event down below.
_________________________________________________________________
case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:
{
object oAcquirer = GetEventCreator(ev);
object oItemAcquired = GetEventObject(ev, 0);
if (GetTag(oItemAcquired) == "kc_dragonspeak_breastplate")
{
DisplayFloatyMessage(oAcquirer, "Breastplate of Found", FLOATY_MESSAGE, 16777215, 1.5);
WR_SetPlotFlag(PLT_GENPT_QUEST_CULLEN, CULLEN_QUEST_ARMOR_FOUND, TRUE);
}
if (GetTag(oItemAcquired) == "kc_aeonar_key_jail1")
{
DisplayFloatyMessage(oAcquirer, "Key 1 Found", FLOATY_MESSAGE, 16777215, 1.5);
WR_SetPlotFlag(PLT_GENPT_QUEST_JOWAN, JOWAN_QUEST_KEY1_FOUND, TRUE);
}
if (GetTag(oItemAcquired) == "kc_aeonar_key_jail2")
{
DisplayFloatyMessage(oAcquirer, "Key 2 Found", FLOATY_MESSAGE, 16777215, 1.5);
WR_SetPlotFlag(PLT_GENPT_QUEST_JOWAN, JOWAN_QUEST_KEY2_FOUND, TRUE);
}
break;
}
_________________________________________________________________
The "if(GetTag() == " ")" part will tell the game how to handle the event for that specific item only and will pass the event on for all other items. (I probably should have used if-else instead of just if, but you get the idea.) If this is a standalone mod, you'll have to ask someone else if there is anything else that you'd need to do.
BlackSheep42 wrote...
What would be the correct command line to use in this case? If it's the same line as used in the official script, how will the game know which custom script to point to?
If you do decide that you want to use a separate script (which I would recommend against unless you have very many campaign items), you would write a new script in the same format as sp_module_item_acq and use the same HandleEvent() function in your module script, but you would change "RESOURCE_SCRIPT_MODULE_ITEM_ACQUIRED" to "R"insert_script_name_here.ncs"." (The .ncs *may* be a .nss instead. I'm fairly certain you would use the compiled script, but I could be mistaken.) Just make sure that you handle just your own events and don't inadvertantly override ALL CAMPAIGN_ITEM_ACQUIRED events.
Alternatively, if you wanted to keep your module script tidy and didn't want to deal with the hassle of making sure you don't override the wrong events, you could write a custom function in a separate script that you would list as an include in your module script. (If this is going to be a fairly complex mod, you'll probably need several custom functions at some point anyway, and they can all be put into the same script.)
Modifié par satans_karma, 10 août 2012 - 03:52 .