I created a "spawnthing" scriptlet in lua.
Everything works cool, except the PlaySound(e,0) part (see code below);
I right-clicked on my object to spawn (in this case, the stack of cinderblocks
) and in the object inspector, I set:
Main = spawnthing.lua
Spawn At Start? = No
Sound0 and Sound1 are set.
I tried PlaySound(e,0) and PlaySound(e,1) to no avail.
Am I missing something dumb?
function spawnthing_main(e)
PlayerDX = g_Entity[e]['x'] - g_PlayerPosX; PlayerDY = g_Entity[e]['y'] - g_PlayerPosY; PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;
PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ));
if PlayerDist < 600 then
Show(e);
CollisionOn(e);
PlaySound(e,0); -- tried both 0 and 1 ...
end
end
Brook's Law ..."adding manpower to a late software project makes it later"