Ironworks Gaming Forum

Ironworks Gaming Forum (http://www.ironworksforum.com/forum/index.php)
-   Neverwinter Nights 1 & 2 Also SoU & HotU Forum (http://www.ironworksforum.com/forum/forumdisplay.php?f=16)
-   -   What do I add to make this make an item useable? (http://www.ironworksforum.com/forum/showthread.php?t=36435)

robertthebard 03-11-2004 04:30 AM

void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);

object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("DG_HermePoint_01");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "dg_hermes_01", lTarget);

}

This spawns the creature once for the pc, but if multiple pc's go in, I get multiple creatures, which is ok, as he's not hostile, but I am using a Frost giant for the creature, and it's a small room, plus I'd like the dialog that this creature has to make an item useable, once per pc who talks to him. I just have one question: How??????

philip 03-11-2004 05:16 AM

Right now you're storing the check variable on the PC. This is why it spawns for every PC. I'd make a new variable and don't store it on a PC but for example on the area.

For the second question with making the item usable I would store the variable on the PC and check against that.

Quote:

int StartingConditional()
{
if (GetLocalInt(GetPCSpeaker(), "(int name)") != int_for_done)
return TRUE;
return FALSE;
}
Put something alike this on the Appears When tab in the conversation.

robertthebard 03-11-2004 06:14 PM

OK, I tried to use the script but do I need to use the item's res ref, or do I use the tag? It wouldn't compile.

philip 03-12-2004 02:19 AM

The tag seems OK. I think you only need the resref when you're getting something out of the blueprints.

What error are you getting and where? Could you post that code?


All times are GMT -4. The time now is 12:38 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved