Page 1 of 1

Posted: August 10th, 2007, 6:53 pm
by Nightmare
Did you call all the sciprt_origin lamps? or do you mean lamps1, lamps2, etc.
If you give all the script_origins the same name, it will not work.
Also, the script doesn't look right to me.

Posted: August 10th, 2007, 10:48 pm
by Nightmare
well you would have to give them a different name each: lamps1, lamps2, lamps3
you can't have more than one origin have the same name.

Posted: August 11th, 2007, 2:28 am
by Drofder2004
No, the method is fine, you are using an array and therefore you do NOT have to have different names...

The problem is your coding...

Code: Select all

lamp_effects()
{
   lamps = getentarray("lamps","targetname");
   for(i=0;i<lamps.size;i++)
   lamps[i] thread lamps_fx ();
}
Ok, so above, we no have an array of lamps and every lamp now is threaded to a function.

Code: Select all

lamps_fx()
{
lamps = getent("lamps","targetname");
level._effect["fire"] = loadfx ("fx/fire/flame_small_em.efx");
maps\mp\_fx::loopfx("fire", ("lamps"), 0.6);
}
Now, for some reason, you have chosen to detect the lamp again, you do not need to, you threaded the lamp above...
Also, the "level._effect" should be put in your main, not your function.
And another thing, is your "loopfx" function is wrong... This is what it should be referring to...

loopfx(fxId, fxPos, waittime, fxPos2, fxStart, fxStop, timeout)
fxId = Name of FX
fxPos = Origin
waittime = how many times a second should the fx be played
fxPos2 = direction origin
The last 3, you can ignore...

So, change this code to the following...

Code: Select all

lamps_fx()
{
   maps\mp\_fx::loopfx("fire", self.origin, 0.6, (self.origin + (0,0,1));
}
Or you can rewrite the entire thing to..

Code: Select all

lamp_effects()
{
   lamps = getentarray("lamps","targetname");
   for(i=0;i<lamps.size;i++)
      maps\mp\_fx::loopfx("fire", lamps[i].origin, 0.6, (lamps[i].origin + (0,0,1));
}

Although, this entire script would be more map efficient if you did not use the script_origins and just used numbered origins ;)

Posted: August 11th, 2007, 2:53 am
by Drofder2004
Also, another thing to note, if you are using the normal lantern (like you see around CoD2 maps) you can do so very easily...

Just load the prefab
"prefabs\lamps\lantern_lit.map"

Place it where you want...

In your GSC file make sure the following is present:
maps\mp\_load::main();

and compile and play.