PDA

View Full Version : Random Explosion script


HdVaderII
07-09-2008, 05:04 PM
I found this script in the Scripting tutorials, yet when I paste it into my KT text editor, save as a .nss file, and compile, I get a syntax error at line four:
Error: Syntax Error at "object"

void main()
{
object oPc=GetFirstPC();
object oRand=GetNearestObject(OBJECT_TYPE_ALL,oPc,1);
location lRand=GetLocation(oRand);
ApplyEffectAtLocation(0,EffectVisualEffect(3003),l Rand,0.0f);
PlayRumblePattern(1);
}
Any help?

Silveredge9
07-09-2008, 07:01 PM
I just tried the script and it compiled fine. And looking at the script, nothing seems out of order either.

HdVaderII
07-09-2008, 07:58 PM
I'm still getting the problem. I'm copying the script correctly. Could it be due to the fact that I'm doing this in TSL? I know that's not likely but you never know...

Silveredge9
07-09-2008, 08:19 PM
I'm still getting the problem. I'm copying the script correctly. Could it be due to the fact that I'm doing this in TSL? I know that's not likely but you never know...
The "PlayRumblePattern(1);" function is used in a number of places in the original K1. I can't remember it being used at all in TSL, so the function might have been removed.

The script should work if you take that function out, it just means the screen won't shake when the explosions trigger.

HdVaderII
07-09-2008, 08:34 PM
I just re-copied it from the tutorial again, and now it works.
Thanks for your help silver. Sorry if I wasted your time. :D