i fear that the nwnx boards aren't as frequented here, so i'm reposting my question to them to this audience, to see if i can pick up additional answers here:
i had a question about ActionUseItem(). from the .nss file:
void ActionUseItem (object oItem, object oTarget, location lTarget, int nProp) {
object oArea = GetAreaFromLocation(lTarget);
vector vVec = GetPositionFromLocation(lTarget);
if (!GetIsObjectValid(oArea))
return;
SetLocalString(OBJECT_SELF, "NWNX!FUNCS!ACTIONUSEITEM",
ObjectToString(oItem) + "¬" + ObjectToString(oTarget) + "¬" +
ObjectToString(oArea) + "¬" + FloatToString(vVec.x) + "¬" +
FloatToString(vVec.y) + "¬" + FloatToString(vVec.z) + "¬" +
IntToString(nProp));
}
void ActionUseItemAtLocation (object oItem, location lTarget, int nProp=0) {
ActionUseItem(oItem, OBJECT_INVALID, lTarget, nProp);
}
void ActionUseItemOnObject (object oItem, object oTarget, int nProp=0) {
ActionUseItem(oItem, OBJECT_INVALID, GetLocation(oTarget), nProp);
}
the ActionUseItemOnObject() just seems wrong. it doesn't actually use the item on the object, it obviously just uses the item at the location of the object. i have to think that this was intentional because i don't think virusman would make a mistake like this. is it a limitation of the function/engine to not allow for it?
when i get a chance, i want to check what would happen if the function were instead:
void ActionUseItemOnObject (object oItem, object oTarget, int nProp=0) {
ActionUseItem(oItem, oTarget, GetLocation(oTarget), nProp);
}
i'm also curious about what it's doing behind the scenes. like if it will still default to the location and ignore the object altogether. i guess i have the source code for the plugin to answer that question for me.
Modifié par acomputerdood, 26 septembre 2012 - 05:00 .