I want a dynamic light to always be at the player's position, for a flashlight effect.
But no matter how I try, it's not working.
ACS:
Code: Select all
#include "zcommon.acs"
int player_x;
int player_y;
int player_z;
script 1 ENTER // sets player's initial properties
{
Thing_ChangeTID(0, 1000 + PlayerNumber()); //give player a TID
}
script 2 OPEN // main loop script
{
thing_activate(1);
//record player's coords
player_x=GetActorX(1000);
player_y=GetActorY(1000);
player_z=GetActorZ(1000);
//position flashlight
// TID 1 is the dynamic light object
// TID 999 is the teleporter
spawn("TeleportDest3",player_x,player_y,player_z+2*65536,999);
TeleportOther(1,999,0);
delay(1);
Thing_Remove(999);
restart;
}
Code: Select all
ACTOR Flashlight 20001
{
radius 8
height 8
renderstyle none
+noblockmap
+noclip
States
{
Spawn:
FLIT A 1
Loop
}
}
Code: Select all
pointlight FLASHLIGHT
{
color 1.0 1.0 1.0
size 128
offset 0 0 0
}
object Flashlight
{
frame FLIT { light FLASHLIGHT }
}
I haven't even gotten to the trigonometry stuff yet! (I want the dynamic light to always sit in front of the player, oriented to the player's view angle, rather than dead center of the player's position)
Please help me make this work. I've had it up to here with ACS and its illogical oddities!!!