Script help plz

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Timieh!
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: May 7th, 2008, 12:32 pm

Script help plz

Post by Timieh! » May 7th, 2008, 12:40 pm

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 :(

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Script help plz

Post by Drofder2004 » May 7th, 2008, 5:23 pm

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);
}
}
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Script help plz

Post by Nightmare » May 8th, 2008, 1:23 am

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Timieh!
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: May 7th, 2008, 12:32 pm

Re: Script help plz

Post by Timieh! » May 8th, 2008, 1:38 pm

beeep error the map loads but when i shoot @ the tree script compile error

Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Script help plz

Post by Drofder2004 » May 8th, 2008, 5:02 pm

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));
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Script help plz

Post by Nightmare » May 9th, 2008, 1:05 am

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);
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Timieh!
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: May 7th, 2008, 12:32 pm

Re: Script help plz

Post by Timieh! » May 9th, 2008, 6:03 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests