UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Mapping => Topic started by: Scobalula on July 02, 2015, 03:00:16 pm

Title: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 02, 2015, 03:00:16 pm
Note: When I say root, I mean your CoD WaW Folder.

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Ff4zLhep.jpg&hash=d93e4a6fb62dc14d233d102455db6896424adb50)

Download this RAR:

mega.nz

Place the raw folder in your Call of Duty Root folder.

Open your mapname.gsc (You should know where it is) and find this:

Code Snippet
Plaintext
maps\_zombiemode::main();

Add this under it:

Code Snippet
Plaintext
	wall_weaps = GetEntArray("weapon_upgrade","targetname");
for(i=0;i<wall_weaps.size;i++)
playFx(level._effect["wall_weapon_light"], wall_weaps[i].origin);


So it will look something like this:

Code Snippet
Plaintext
        maps\_zombiemode::main();
wall_weaps = GetEntArray("weapon_upgrade","targetname");
for(i=0;i<wall_weaps.size;i++)
playFx(level._effect["wall_weapon_light"], wall_weaps[i].origin);

In preCacheMyFX function add this:

Code Snippet
Plaintext
level._effect["wall_weapon_light"] = loadfx("weapon/fx_wallweapon_light");

Then go to zone_source and open your mapname.csv and add this into it:

Code Snippet
Plaintext
fx,weapon/fx_wallweapon_light

After that you're done, the game will automatically add this FX to the trigger of wall weapons.

Since this uses your weapon's trigger make sure to place it accordingly in Radiant.

Thanks to:

Code Snippet
Plaintext
HitmanVere - Script
MakeCents - Suggesting this 1000 times easier method and extensive help.
Harry Bo21 - Extensive help also.
CreeperFace - Suggesting the tutorial in whole.

Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: KDXDARK on July 02, 2015, 03:53:50 pm
it can be done with Easy FX? or you dont try it?
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 02, 2015, 03:57:29 pm
it can be done with Easy FX? or you dont try it?

The reason I done the tutorial via client scripts is so that it covers everyone, I stated at the bottom if people want to use Easy FX they can, just follow treminaor's tutorial on the wiki for it. :)
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: MakeCents on July 02, 2015, 04:32:52 pm
Think about using, by YaPh1l:
http://www.zombiemodding.com/index.php?topic=5913.5;wap2 (http://www.zombiemodding.com/index.php?topic=5913.5;wap2)

For you csc. I makes it easier to get the positiion and move things around and doesn't hurt to put a script_struct in the prefab.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 02, 2015, 04:49:46 pm
tbh I really don't mind what way people go about putting the FX in their map, they can use Phil's or they can use Trem's Easy FX, don't really mind, once again the reason I done the client script way in this tutorial is to cover everyone, I could put Easy FX Tutorial here but then not everyone is using Easy FX, but I know for a fact this method will work for everyone.

My end goal is that for people that who want that Black Ops 2 wall weapon FX in their map, can do so using this, and if they want to use another method to put it in their map, then that's ok.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: MakeCents on July 02, 2015, 05:12:03 pm
tbh I really don't mind what way people go about putting the FX in their map, they can use Phil's or they can use Trem's Easy FX, don't really mind, once again the reason I done the client script way in this tutorial is to cover everyone, I could put Easy FX Tutorial here but then not everyone is using Easy FX, but I know for a fact this method will work for everyone.

My end goal is that for people that who want that Black Ops 2 wall weapon FX in their map, can do so using this, and if they want to use another method to put it in their map, then that's ok.

Alright, just trying help. I didn't see you deleting the origin after adding it, so figured I'd make a suggestion that doesn't contribute to gspawn, and makes your life a bit easier, is all. But really, you should be able to incorporate this into the weapon prob. Without doing easy fx or csc. Just by adding like one line to _zombiemode_weapons, for the play fx part.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 02, 2015, 05:57:32 pm
Alright, just trying help. I didn't see you deleting the origin after adding it, so figured I'd make a suggestion that doesn't contribute to gspawn, and makes your life a bit easier, is all. But really, you should be able to incorporate this into the weapon prob. Without doing easy fx or csc. Just by adding like one line to _zombiemode_weapons, for the play fx part.

I'll look into that, I was not aware also leaving the script_origin could contribute to a g_spawn error. lol I added to the tut to tell people to delete it.

Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: MakeCents on July 02, 2015, 06:01:42 pm
I'll look into that, I was not aware also leaving the script_origin could contribute to a g_spawn error. lol I added to the tut to tell people to delete it.

Cool. Origins are ents so... I once added 30+ in a map and was already close to 1000 ents, and I had a field day. Swapped out for structs, modified script, all worries done, lol.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: steviewonder87 on July 02, 2015, 07:07:50 pm
How is this different/better to this?

http://ugx-mods.com/forum/index.php?topic=2011.0 (http://ugx-mods.com/forum/index.php?topic=2011.0)

This one by Bam seems a lot easier to implement also, no need to mess around with coordinates in Radiant.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: MakeCents on July 02, 2015, 07:10:33 pm
How is this different/better to this?

http://ugx-mods.com/forum/index.php?topic=2011.0 (http://ugx-mods.com/forum/index.php?topic=2011.0)

This one by Bam seems a lot easier to implement also, no need to mess around with coordinates in Radiant.

Well this tut is dif cause bam spawns an ent. This tut doesn't. But really, you can just play fx on the weapon, it is an ent too. Or even play fx at the origin of the trig, unless the angle matters.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 02, 2015, 07:26:17 pm
Well this tut is dif cause bam spawns an ent. This tut doesn't. But really, you can just play fx on the weapon, it is an ent too. Or even play fx at the origin of the trig, unless the angle matters.

Angle's don't matter so I could do that.

How is this different/better to this?

http://ugx-mods.com/forum/index.php?topic=2011.0 (http://ugx-mods.com/forum/index.php?topic=2011.0)

This one by Bam seems a lot easier to implement also, no need to mess around with coordinates in Radiant.

Never said mine was better or different, wasn't aware of his tutorial also, tried searching for something similar, so did CreeperFace, couldn't find anything, but tbh never had much luck with the search on here.. If people want to use that and find it easy then go for it. :D
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Harry Bo21 on July 02, 2015, 08:23:02 pm
Well this tut is dif cause bam spawns an ent. This tut doesn't. But really, you can just play fx on the weapon, it is an ent too. Or even play fx at the origin of the trig, unless the angle matters.
Yea I just did playFX on the weapon model, but ive always been curious about csc scripting, so still a good read lol
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 02, 2015, 09:39:11 pm
Well I tried doing it but I am new to scripting so it's all trial and error for me and obviosuly this is error.

My #1 attemt was via just adding playfx to the original funtion in _zombiemode_weapons.gsc like so:

Code Snippet
Plaintext
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
playfx("wall_weapon_light", weapon_spawns.origin);

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );

weapon_spawns[i] SetHintString( hint_string );
weapon_spawns[i] setCursorHint( "HINT_NOICON" );
weapon_spawns[i] UseTriggerRequireLookAt();

weapon_spawns[i] thread weapon_spawn_think();
model = getent( weapon_spawns[i].target, "targetname" );
model hide();
}
}


When that didn't work I just made a new GSC and called it in my maps GSC:

Code Snippet
Plaintext
wall_weapon_light_fx()
{
weap_light = getEntArray("weapon_upgrade","targetname");
loadfx("weapon/fx_wallweapon_light");

while(1)

{
playFX("wall_weapon_light", weap_light.origin);
                wait 0.5;
}



}

But didn't work either, if I could get this to work it would make the whole process 100 times easier. :P
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: MakeCents on July 02, 2015, 10:15:57 pm
Well I tried doing it but I am new to scripting so it's all trial and error for me and obviosuly this is error.

My #1 attemt was via just adding playfx to the original funtion in _zombiemode_weapons.gsc like so:

Code Snippet
Plaintext
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
playfx("wall_weapon_light", weapon_spawns.origin);

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );

weapon_spawns[i] SetHintString( hint_string );
weapon_spawns[i] setCursorHint( "HINT_NOICON" );
weapon_spawns[i] UseTriggerRequireLookAt();

weapon_spawns[i] thread weapon_spawn_think();
model = getent( weapon_spawns[i].target, "targetname" );
model hide();
}
}


When that didn't work I just made a new GSC and called it in my maps GSC:

Code Snippet
Plaintext
wall_weapon_light_fx()
{
weap_light = getEntArray("weapon_upgrade","targetname");
loadfx("weapon/fx_wallweapon_light");

while(1)

{
playFX("wall_weapon_light", weap_light.origin);
                wait 0.5;
}



}

But didn't work either, if I could get this to work it would make the whole process 100 times easier. :P
The first way you tried, you tried to play an fx on an array. Try it above the hint string instead, and don't forget the

The second, I don't think you loaded the fx right and again tried to play it on an array.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Harry Bo21 on July 02, 2015, 10:31:50 pm
Code Snippet
Plaintext
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
// playfx("wall_weapon_light", weapon_spawns.origin); // not here

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );

weapon_spawns[i] SetHintString( hint_string );
weapon_spawns[i] setCursorHint( "HINT_NOICON" );
weapon_spawns[i] UseTriggerRequireLookAt();

weapon_spawns[i] thread weapon_spawn_think();
model = getent( weapon_spawns[i].target, "targetname" );
               
                playfx("wall_weapon_light", weapon_spawns[ i ].origin); // here instead, so it plays per member of the array, using the member as a point of origin

model hide();
}
}

could also use

weapon_spawns.target

to grab the model from the prefab and use that instead of the trigger itself

Quote
The second, I don't think you loaded the fx right and again tried to play it on an array.

I think hes right, need to load it before zombiemode::main() i think, I always load fx in my init functions, which are called prior to that
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 02, 2015, 10:53:26 pm
Code Snippet
Plaintext
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
// playfx("wall_weapon_light", weapon_spawns.origin); // not here

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );

weapon_spawns[i] SetHintString( hint_string );
weapon_spawns[i] setCursorHint( "HINT_NOICON" );
weapon_spawns[i] UseTriggerRequireLookAt();

weapon_spawns[i] thread weapon_spawn_think();
model = getent( weapon_spawns[i].target, "targetname" );
               
                playfx("wall_weapon_light", weapon_spawns[ i ].origin); // here instead, so it plays per member of the array, using the member as a point of origin

model hide();
}
}

could also use

weapon_spawns.target

to grab the model from the prefab and use that instead of the trigger itself

I think hes right, need to load it before zombiemode::main() i think, I always load fx in my init functions, which are called prior to that

Surprisingly that didn't work either, I'll look into it in more dept tomorrow, it's late here haha, thanks for the help though, really appreciate it.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: MakeCents on July 02, 2015, 11:07:49 pm
Code Snippet
Plaintext
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
// playfx("wall_weapon_light", weapon_spawns.origin); // not here

for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns[i].zombie_weapon_upgrade );

weapon_spawns[i] SetHintString( hint_string );
weapon_spawns[i] setCursorHint( "HINT_NOICON" );
weapon_spawns[i] UseTriggerRequireLookAt();

weapon_spawns[i] thread weapon_spawn_think();
model = getent( weapon_spawns[i].target, "targetname" );
               
                playfx("wall_weapon_light", weapon_spawns[ i ].origin); // here instead, so it plays per member of the array, using the member as a point of origin

model hide();
}
}

could also use

weapon_spawns.target

to grab the model from the prefab and use that instead of the trigger itself

I think hes right, need to load it before zombiemode::main() i think, I always load fx in my init functions, which are called prior to that

You mean model.origin I think.


I meant he was missing the level._effect["wall_weapon_light"] = part. He just has the load fx part, without establishing the key. Yours is also missing that, of course, when you try to play it.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Harry Bo21 on July 03, 2015, 12:09:07 am
Quote
level._effect["wall_weapon_light"] = part

that was what i meant ;)

Quote
model.origin
well yea you would use the origin, i just meant that .target is referring to the model in question. so yea .target.origin would be used for playing the fx :)
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on July 03, 2015, 03:05:53 pm
Updated tutorial, thanks to Hitman for the script and to everyone else for helping. :D
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: Scobalula on May 30, 2016, 09:51:21 pm
Updated with better FX rather than just a light, it actually has a little "flare" that shows, and will disappear as you get close.

Updated script part of the tutorial with less steps.
Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: thezombieproject on July 18, 2016, 02:02:36 pm


could also use

weapon_spawns.target

to grab the model from the prefab and use that instead of the trigger itself



if you use weapon_spawns.target and play fx on model
most prefabs have half of the gun is in the wall and the origin of the weapon model is in wall?
also some  weapon origins are not centered on the model  so fx will  play few units away from the center of the prefab?
Just wondering :)

Title: Re: [Tutorial] Black Ops 2 Style Wall Weapon FX
Post by: alaurenc9 on July 23, 2016, 04:00:30 pm
if you use weapon_spawns.target and play fx on model
most prefabs have half of the gun is in the wall and the origin of the weapon model is in wall?
also some  weapon origins are not centered on the model  so fx will  play few units away from the center of the prefab?
Just wondering :)
In BO2 the blue light fx around the chalk shows because all of the weapon chalk in BO2 is done by FX, and so they added that as just a little feature to make it stand out more, idk. But in BO2 they play the fx at the model origin is it should be fine because the model isn't 'in' the wall, its 'on' the wall.
Or even play fx at the origin of the trig, unless the angle matters.
Two things I want to say.
#1: I noticed in BO2 FX that there is a billboard sprite flare and an oriented sprite flare. So if you want to, you could make both, but that would mean angles would matter.
#2: You can use angles in PlayFX, like this:
Code Snippet
Plaintext
PlayFX( fx, origin, AnglesToForward( angles ), AnglesToUp( angles ) );