E.g., the scripts I've added to the Mage Origin seem to work perfectly OK, whereas none I have added in the prelude appears to work (so far; I've one chance left as I'm writing this).
I need to ask one - nay, two - questions; some might consider them silly. But I'm quite stuck now.
1) GetObjectByTag REALLY means get the TAG of the object, right? I've noticed that some objects have different tags and resource names (and in some cases the resource names are specific, like pre200ar_wolf_chest; whereas the tags are "generic", like genip_wooden_chest.Yes, this can be on one and the same object).
2) Can we be absolutely certain that the resources provided with the toolset match with the in-game resources? I.e., if I add an item by using a script, can I be certain that my script actually tries to add to something that exists in-game?
Here is a script that I use to try to add something to the korcari wilds. Neither the necklace nor the helmet do spawn as they should:
[nwscript]
#include "utility_h"
#include "plt_0fk_plot"
void main()
{
PrintToLog("fk_prcscr: BEGIN");
string areaTag = GetTag(GetArea(GetMainControlled()));
PrintToLog(" area: " + areaTag);
object oCreature = OBJECT_INVALID;
object oPlaceable = OBJECT_INVALID;
if ( WR_GetPlotFlag( PLT_0FK_PLOT, FK_CHECK_PRE200AR ) == TRUE ) return;
if (areaTag == "pre200ar_korcari_wilds")
{
oCreature = GetObjectByTag("pre200cr_hurlock_emissary_t16");
oPlaceable = GetObjectByTag("pre200ip_iron_chest2");
}
if (!IsObjectValid(oPlaceable)) return;
if (UT_CountItemInInventory(R"gen_im_arm_hel_lgt_rlr.uti", oPlaceable) < 1)
{
PrintToLog("stocking items");
CreateItemOnObject(R"gen_im_arm_hel_lgt_rlr.uti", oPlaceable, 1, "", TRUE);
WR_SetPlotFlag( PLT_0FK_PLOT, FK_CHECK_PRE200AR, TRUE );
}
if (!IsObjectValid(oCreature)) return;
if (UT_CountItemInInventory(R"fk_silver_necklace.uti", oCreature) < 1)
{
PrintToLog("stocking items");
CreateItemOnObject(R"fk_silver_necklace.uti", oCreature, 1, "", TRUE, TRUE);
WR_SetPlotFlag( PLT_0FK_PLOT, FK_CHECK_PRE200AR, TRUE );
}
else
{
PrintToLog("no items!");
}
}
[/nwscript]
So, returning to my questions:
1) Is it the tag of the Hurlock Emissary I should call, or the Resource Name? I'd go for the tag, as I've done, of course... But that doesn't work.
2) Can I be certain that I call the correct chest object - or does it in fact have another tag in the game file (another tag than the one I find in the toolset database)?
I realize of course that question 2) may be impossible to answer. But if anyone knows, I'd be glad if they told me.
I really have no clue how to solve this.
Modifié par fkirenicus, 12 mars 2011 - 04:27 .





Retour en haut






