UGX-Mods

Call of Duty: Black Ops 1 => Tutorial Desk => Scripting => Topic started by: shippuden1592 on August 03, 2022, 05:56:33 pm

Title: FX Tutorial
Post by: shippuden1592 on August 03, 2022, 05:56:33 pm
1.-Open your map and create script_structs where you want the fx to appear.
Now add these kvps:
Code Snippet
Plaintext
targetname        fx_struct
script_noteworthy    NAME_CACHE_FX
NAME_CACHE_FX: It is the name of your loaded FX.
 
2.-Open your zombie_mapname.gsc and below
under of:
Code Snippet
Plaintext
main ()
{
Add your fx like this:
Code Snippet
Plaintext
level._effect["NAME_CACHE_FX"]            = loadfx( "LOCATION_FX" );
Examples:
Code Snippet
Plaintext
level._effect["fx_mp_smoke_thick_indoor"] = loadfx("maps/zombie/fx_mp_smoke_thick_indoor");
level._effect["fx_mp_smoke_amb_indoor_misty"] = loadfx("maps/zombie/fx_zombie_theater_smoke_amb_indoor");
   
In your zombie_mapname_fx.gsc file there are some fx loaded, if you want to use one of them it is no longer necessary to add it.
you have to look for this line:
Code Snippet
Plaintext
maps\_zombiemode::main();
under it add this:
Code Snippet
Plaintext
fx_struct = getstructarray( "fx_struct", "targetname" );
    array_thread(fx_struct_think, ::fx_struct_think);
at the end of the .gsc add this:
Code Snippet
Plaintext
fx_struct_think()
{
    self.tag_origin = spawn("script_model", self.origin);
    self.tag_origin setmodel("tag_origin");
    self.tag_origin.angles = self.angles;
   
    playfxontag(level._effect[self.script_noteworthy], self.tag_origin, "tag_origin");
}
3.-In your mod.csv add the fx you used:
Example:
Code Snippet
Plaintext
fx,maps\zombie\fx_mp_smoke_thick_indoor
fx,maps\zombie\fx_zombie_theater_smoke_amb_indoor

Title: Re: FX Tutorial
Post by: Klaudeh on September 27, 2023, 01:04:45 pm
Hi Shippuden! i was trying to use this code in a map and it worked! Thanks for the help with the fx's, but there was a little error in the array_thread part, is something simple but i leave it here if someone else want to try this (Btw i tried the code in World at War and works just fine ;))
 
In this part of the code:
Code Snippet
Plaintext
fx_struct = getstructarray( "fx_struct", "targetname" );
    array_thread(killhouse_struct, ::fx_struct_think);

 It should be:
 
Code Snippet
Plaintext
fx_struct = getstructarray( "fx_struct", "targetname" );
    array_thread(fx_struct, ::fx_struct_think);

And that is!
Title: Re: FX Tutorial
Post by: Box Map ELITE #1 on December 01, 2023, 01:44:08 am
this does not work for bo1