I'm building a quest right now where a character is killed off-screen and the player is rewarded by the conversation owner. I'm handling this by simply disabling the character who is killed, and enabling a corpse placeable, based on the plot flag SMITH_RATTED_OUT, and then depositing gold into the player's inventory. The area where the plot flag is set is different from where the enable/disable function needs to take place, but they are in the same area list.
Unfortunately, I can't figure out how to get this to work. I have very little experience with programming and only a bit more with scripting, and haven't been able to get the script to fire properly. The player receives no gold and neither the corpse appears nor the NPC disappears, so I have to assume it's something more fundamental that I'm getting wrong.
My script currently uses plot_core.nss as a base; aside from the #include plt, the following is what I've added:
switch(nFlag)
{
case SMITH_RATTED_OUT:
{
if (nValue==1)
{
object oBody = GetObjectByTag("mason_dead");
object oSmith = GetObjectByTag("mason");
SetObjectActive(oBody, 0);
SetObjectActive(oSmith, 1);
RewardMoney(0,0,10);
}
}
}
If anyone could give me some help in building a simple and lean script to handle this, I'd appreciate it.
Modifié par sea-, 16 mars 2011 - 09:59 .





Retour en haut






