Darth InSidious
03-20-2007, 04:44 PM
I've written two scripts using Local Variables, one to set the variable from the OnOpen script slot on a door, one to fire after checking the variable from a trigger. The variable is set on the trigger itself, "hlc". But whenever I load the module and set the trigger, the second script doesn't fire. They compile fine though. I'm guessing there's something wrong with the trigger, but it seems fine. So could someone look over the scripts and ensure I'm not making a major mistake? Thanks.
The first, to set the local:
#include "k_inc_debug"
#include "k_inc_utility"
void main()
{
object oObject = GetObjectByTag("hlc");
SetLocalNumber(oObject, 1, 1);
}
The second, to check the local and, if set, spawn the item:
#include "k_inc_debug"
#include "k_inc_utility"
void main()
{
object oObject = GetObjectByTag("hlc");
if ( GetLocalNumber(oObject, 1))
{
float x= 112.71f;
float y= -20.09f;
float z= 9.87913f;
float r= 0.0f;
vector MyVec = Vector(x,y,z);
location MyLoc = Location(MyVec, r);
object oLocker=CreateObject( OBJECT_TYPE_PLACEABLE, "plc1", MyLoc);
ActionStartConversation(GetFirstPC(),"plc1");
}
else
{}
}
Thanks.
The first, to set the local:
#include "k_inc_debug"
#include "k_inc_utility"
void main()
{
object oObject = GetObjectByTag("hlc");
SetLocalNumber(oObject, 1, 1);
}
The second, to check the local and, if set, spawn the item:
#include "k_inc_debug"
#include "k_inc_utility"
void main()
{
object oObject = GetObjectByTag("hlc");
if ( GetLocalNumber(oObject, 1))
{
float x= 112.71f;
float y= -20.09f;
float z= 9.87913f;
float r= 0.0f;
vector MyVec = Vector(x,y,z);
location MyLoc = Location(MyVec, r);
object oLocker=CreateObject( OBJECT_TYPE_PLACEABLE, "plc1", MyLoc);
ActionStartConversation(GetFirstPC(),"plc1");
}
else
{}
}
Thanks.