Page 1 of 1

Script help plz

Posted: May 7th, 2008, 12:40 pm
by Timieh!
I have an tree with an fx model with a trigger damage
but i have the script


main()
{
thread boom();
}
boomblaadjes()
{
trig = getent("leaves","targetname");
while (1)
{
trig waittill ("damage", idamage);
{
level._effect["tree"] = loadfx ("fx/impacts/leafs.efx");
maps\mp\_fx::loopfx("leafs", (912, -16, 600), 0.6);
}
}



It say's it has an loop i think so but it don't loop and i tryed
also to do trigger>multiple but doesn't respond on damge :(

Re: Script help plz

Posted: May 7th, 2008, 5:23 pm
by Drofder2004
Trigger_multiple responds to touch
trigger_damage responds to damage

main()
{
thread boom();
}

boomblaadjes() <-- This should be the same as above: boom()
{
trig = getent("leaves","targetname");

while (1)
{
trig waittill ("damage", idamage);
{ <-- This doesn't do anything

level._effect["tree"] = loadfx ("fx/impacts/leafs.efx"); <-- This should be loaded before the script is loaded
maps\mp\_fx::loopfx("leafs", (912, -16, 600), 0.6); <-- The effect must be the same as the effect you load ("tree")
}
}

New Script:

Code: Select all

main()
{
level._effect["tree"] = loadfx ("fx/impacts/leafs.efx");
thread boom();
}

boom()
{
trig = getent("leaves","targetname");

while(1)
{
trig waittill ("damage", idamage);
maps\mp\_fx::loopfx("tree", (912, -16, 600), 0.6);
}
}

Re: Script help plz

Posted: May 8th, 2008, 1:23 am
by Nightmare
Why not use playfx instead of loopfx, with that script it will constantly play that effect until the map ends once it is hit.
Also, I can't say this enough, please have your map name in front of the targetname. This helps avoid conflicting with other maps.

Re: Script help plz

Posted: May 8th, 2008, 1:38 pm
by Timieh!
beeep error the map loads but when i shoot @ the tree script compile error

Image

Re: Script help plz

Posted: May 8th, 2008, 5:02 pm
by Drofder2004
Nightmare wrote:Why not use playfx instead of loopfx, with that script it will constantly play that effect until the map ends once it is hit.
Also, I can't say this enough, please have your map name in front of the targetname. This helps avoid conflicting with other maps.
I didnt change it because I just accepted the possibility one bullet of damage would loop an FX forever, but if it is a one-off effect, then yes playFx is better.

change:

Code: Select all

maps\mp\_fx::loopfx("tree", (912, -16, 600), 0.6);
to:

Code: Select all

maps\mp\_fx::playfx("tree", (912, -16, 600));

Re: Script help plz

Posted: May 9th, 2008, 1:05 am
by Nightmare
or you could do this

Code: Select all

origin= getent("origin","targetname");
trig = getent("trigger","targetname");
effect = loadfx("fx/impacts/leafs.efx");
trig waittill ("trigger");
playfx(effect,origin.origin);

Re: Script help plz

Posted: May 9th, 2008, 6:03 pm
by Timieh!
It doesn't work with playfx it says unknown what i must do something like that
and when i do like nightm. it crashes script compile error

Can anyone make al ittle .map and a .gsc with _fx and the script


Sorry but i can't get it working plz with

level._effect["tree"] = loadfx ("fx/impacts/leafs.efx");

whit that fx plz


Thanks

Bye gun.