Is there any Tutorials out there for Moving FX Lights?
Thanks

Moderator: Core Staff
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Code: Select all
Light
{
life 1000 //Length of time the light is on in milliseconds, 1000 = 1 second
rgb //Color of the light can be changed here, with Red Green Blue (2.55 2.55 2.55 = White)
{
start 2.55 2.55 2.55 //Color of the light at the beginning of its life
end 2.55 2.55 2.55 //Color of the light at the end of its life
flags linear
}
size
{
start 250 //Intensity of the light at the beginning of its life
end 250 //Intensity of the light at the end of its life
flags linear
}
}
Code: Select all
main()
{
maps\mp\_load::main(); //Load main functions
lightOrigin = getent ("fxOrigin","targetname"); //Assign the fxOrigin entity to lightOrigin
level._effect["light"] = loadfx ("fx/myFxFolder/myLight.efx"); //Load myLight effect from myFxFolder
maps\mp\_fx::loopfx("light",lightOrigin.origin, 1); //Play loaded light effect at lightOrigin's origin every sec.
lightOrigin thread lightsMove(); //Run moving light thread while sending assigned lightOrigin
}
lightsMove(){ //Move lightOrigin back and forth along the X axis 64 units while looping continuously.
while(1){
self moveX (64,1,0.5,0.5);
self waittill ("movedone");
self moveX (-64,1,0.5,0.5);
self waittill ("movedone");
}
}
I don't see why it shouldn'tRez|l wrote:Wow awesome tut nm, do you think this will work in cod2 aswell?
Are you sure? What kind of flames is it?Scorpion wrote:Thanks for the Tutorial![]()
Instead of lights , there is flames
Code: Select all
main()
{
maps\mp\_load::main(); //Load main functions
lightOrigin = getent ("fxOrigin","targetname"); //Assign the fxOrigin entity to lightOrigin
trigger = getent ("lighttrigger","targetname");
level._effect["light"] = loadfx ("fx/light/light.efx"); //Load myLight effect from myFxFolder
maps\mp\_fx::loopfx("light",lightOrigin.origin, 1); //Play loaded light effect at lightOrigin's origin every sec.
lightOrigin thread lightsMove(); //Run moving light thread while sending assigned lightOrigin
}
lightsMove(){ //Move lightOrigin back and forth along the X axis 64 units while looping continuously.
while(1)
{
trigger waittill ("trigger");
wait(1);
lightOrigin moveZ (-1000,1,0.5,0.5);
lightOrigin waittill ("movedone");
wait(10);
lightOrigin moveZ (1000,1,0.5,0.5);
lightOrigin waittill ("movedone");
}
}
main()
{
maps\mp\_load::main(); //Load main functions
lightOrigin = getent ("fxOrigin","targetname"); //Assign the fxOrigin entity to lightOrigin
trigger = getent ("lighttrigger","targetname");
level._effect["light"] = loadfx ("fx/light/light.efx"); //Load myLight effect from myFxFolder
maps\mp\_fx::loopfx("light",lightOrigin.origin, 1); //Play loaded light effect at lightOrigin's origin every sec.
lightOrigin thread lightsMove(); //Run moving light thread while sending assigned lightOrigin
}
lightsMove(){ //Move lightOrigin back and forth along the X axis 64 units while looping continuously.
while(1)
{
trigger waittill ("trigger");
wait(1);
self moveZ (-1000,1,0.5,0.5);
self waittill ("movedone");
wait(10);
self moveZ (1000,1,0.5,0.5);
self waittill ("movedone");
}
}
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Obvious problem is very obvious, you are defining what trigger is all the way in the main, but for the game, by the time it gets to that thread, it has forgotten about it. (Lev made the same mistake.Scorpion wrote:Hi , Finally Works(I was using the compile MP folder and it didnt like it, so i placed into a pk3 and it worked
)
Iv tried to add a trigger to it
CODE
The light shows up but it doesnt move up or down with the trigger or without the trigger.
Any ideas?
Thanks
Code: Select all
main()
{
maps\mp\_load::main(); //Load main functions
lightOrigin = getent ("fxOrigin","targetname"); //Assign the fxOrigin entity to lightOrigin
level._effect["light"] = loadfx ("fx/light/light.efx"); //Load myLight effect from myFxFolder
maps\mp\_fx::loopfx("light",lightOrigin.origin, 1); //Play loaded light effect at lightOrigin's origin every sec.
lightOrigin thread lightsMove(); //Run moving light thread while sending assigned lightOrigin
}
lightsMove(){ //Move lightOrigin back and forth along the X axis 64 units while looping continuously.
while(1)
{
trigger = getent ("lighttrigger","targetname");
trigger waittill ("trigger");
wait(1);
self moveZ (-1000,1,0.5,0.5);
self waittill ("movedone");
wait(10);
self moveZ (1000,1,0.5,0.5);
self waittill ("movedone");
}
}
Code: Select all
main()
{
maps\mp\_load::main(); //Load main functions
lightOrigin = getent ("fxOrigin","targetname"); //Assign the fxOrigin entity to lightOrigin
level._effect["light"] = loadfx ("fx/light/light.efx"); //Load myLight effect from myFxFolder
lightOrigin thread lightsMove(); //Run moving light thread while sending assigned lightOrigin
}
lightsMove(){ //Move lightOrigin back and forth along the X axis 64 units while looping continuously.
while(1)
{
trigger = getent ("lighttrigger","targetname");
trigger waittill ("trigger");
maps\mp\_fx::loopfx("light",lightOrigin.origin, 1); //Play loaded light effect at lightOrigin's origin every sec.
wait(1);
self moveZ (-1000,1,0.5,0.5);
self waittill ("movedone");
wait(10);
self moveZ (1000,1,0.5,0.5);
self waittill ("movedone");
}
}
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Code: Select all
lightsMove(){ //Move lightOrigin back and forth along the X axis 64 units while looping continuously.
trigger = getent ("lighttrigger","targetname");
maps\mp\_fx::loopfx("light",lightOrigin.origin, 1); //Play loaded light effect at lightOrigin's origin every sec.
while(1)
{
trigger waittill ("trigger");
wait(1);
self moveZ (-1000,1,0.5,0.5);
self waittill ("movedone");
wait(10);
self moveZ (1000,1,0.5,0.5);
self waittill ("movedone");
}
}
Users browsing this forum: No registered users and 1 guest