Author Topic: Effect and Lights  (Read 768 times)

How do I set a bricks light and particle via script.

Code: [Select]
BlagaProjectile OnHit LightableBrick SetLightOrange SetParticleFire

%brick.setLight(orangeLight);
%brick.setEmitter(fireAEmitter);
%brick.setEmitterDirection(0); - Up, try other numbers for different directions

(Assuming you have datablocks called orangeLight and fireAEmitter, use forceRequiredAddOn to run Light_Basic and Particle_Basic)

I see.
Yet this doesn't make the brick light on fire.
Code: [Select]
if(%col.hits>=5)
{
%random = getRandom(1,20);
if(%random >= 1 && %random <= 20)
{
%col.hits = 0;
%brick.setLight(orangeLight);
%brick.setEmitter(fireAEmitter);
}
else
{
return;
}
}

Heres a hint:
%brick is undefined

Wow can't belive I missed that...

You'll need the direction line as well, if you set a brick that has e.g. a laser in a different direction on fire with that code it'll emit sideways...