Code: Select all
script "LightCheck" enter
{
while (true)
{
if (GetActorLightLevel(0) <= 96)
{
GiveInventory("Stl", 1);
SetActorProperty(0, APROP_RENDERSTYLE, STYLE_ADD);
print(f: CheckInventory("Stl")); //Gives 1.52...
}
else
{
TakeInventory("Stl", 1);
SetActorProperty(0, APROP_RENDERSTYLE, STYLE_NORMAL);
print(f: CheckInventory("Stl")); //Gives 0
}
delay(1);
}
}
//Seems to work fine
Code: Select all
States
{
Spawn:
POSS AB 0 A_GiveInventory("StKill", 1) //Not important in this case
Goto Idle
Idle:
POSS AB 0 A_JumpIfInTargetInventory("Stl", 1, "DarkIdle")
POSS AB 10 A_Look
Loop
DarkIdle:
POSS AB 0 A_JumpIfInTargetInventory("Stl", 0, "Death")
POSS AB 10 A_LookEx(0, 0, 192)
Loop
See:
POSS AABBCCDD 0 A_TakeInventory("StKill", 1) //Also not important
POSS AABBCCDD 0 A_JumpIfInTargetInventory("Stl", 1, "DarkSee")
POSS AABBCCDD 3 A_Chase
Loop
DarkSee:
POSS AABBCCDD 0 A_JumpIfInTargetInventory("Stl", 0, "See") //It automatically goes to "See" state, even though "Stl" = 1
POSS AABBCCDD 3 A_Chase
POSS AABBCCDD 0 A_JumpIfTargetInLOS("Search", 0, 0, 0, 768)
Loop
Search:
POSS AABBCCDD 0 A_ClearTarget
POSS AABBCCDD 0 A_JumpIfInTargetInventory("Stl", 1, "DarkSearch")
POSS AABBCCDD 3 A_Wander
POSS AB 10 A_Look
Loop
DarkSearch:
POSS AABBCCDD 0 A_JumpIfInTargetInventory("Stl", 0, "Search")
POSS AABBCCDD 3 A_Wander
POSS AB 10 A_LookEx(0, 0, 192)
Loop
What could be the cause of the problem?