UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Creating FX without using the script placer

broken avatar :(
Created 7 years ago
by mini0013xx
0 Members and 1 Guest are viewing this topic.
1,764 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 August 2013
Last active: 3 years ago
Posts
25
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
mini0013xx's Groups
mini0013xx's Contact & Social Links
As simple as it sounds. I have tried the Easy fx and csc method before, both of which have not given me results. Clearly there is something wrong with what I am doing, but I am not entirely sure what.

Here is the code for my map:

Testmap.gsc
Code Snippet
Plaintext
#include maps\_utility;  
#include maps\tokyo_util;
#include common_scripts\utility;
#using_animtree( "generic_human" );

main()
{
// Don't give the player the default loadout, we want to specify it for our custom made map
level.dodgeloadout = true;
// Sets up all of the FX in the level
maps\Testmap_fx::main();
// _load, sets up all of the basic entity behaviors
maps\_load::main();
// Sets the player's weapon loadout... This line should be right after _load::main(), and no waits/delays before it.
set_loadout();
// Sets up ambient sounds
maps\Testmap_amb::main();
// Sets up "canned" animations
maps\Testmap_anim::main();



spawner();

}
// Sets the custom weapon loadout
set_loadout()
{
// Precache's / sets the list of weapons to give to the player when he spawns in
maps\_loadout::add_weapon( "colt");
maps\_loadout::add_weapon( "m1garand" );
maps\_loadout::add_weapon( "fraggrenade" );
maps\_loadout::add_weapon( "m8_white_smoke" );
// Sets the player's offhand throw weapon (aka smoke/flash)
maps\_loadout::set_secondary_offhand( "smoke" );
// Sets the player's default (if he does not have a pistol) laststand pistol.
maps\_loadout::set_laststand_pistol( "colt" );

// Sets the player's viewarms
maps\_loadout::set_player_viewmodel( "viewmodel_usa_marine_arms");
// Sets the player's viewarms when attacked by an enemy in a melee sequence or if a canned animation calls for them
maps\_loadout::set_player_interactive_hands( "viewmodel_usa_marine_player" );
// Switches the player's weapon once he spawns in
maps\_loadout::set_switch_weapon( "m1garand_bayonet" );
// Sets the campaign, which is used for battlechatter and other various scripts
level.campaign = "american";
// Precaches the 3rd person model (for when playing coop)
mptype\player_usa_marine::precache();
}

spawner()
{
trig = getent( "spawner", "targetname" );
spawner = getentarray("enemy", "targetname");
trig waittill ("trigger");
simple_floodspawn("enemy");
}

Testmap_fx.gsc
Code Snippet
Plaintext
#include maps\_utility; 
main()
{
// Example FX
// level._effect["cigarette"] = LoadFx( "maps/mak/fx_cigarette_smoke" );

precachefx();
spawnfx();
}

precachefx()
{
level._effect["fire1"] =LoadFx( "env/fire/fx_fire_barrel_pm");
}

spawnfx()
{
if(( getdvar( "createfx" ) != "" ))
{
maps\createfx\Testmap_fx::main();
}
}

Testmap_fx.gsc in createfx
Code Snippet
Plaintext
//_createfx generated. Do not touch!!

main()
{
// EXAMPLE
// ent = maps\_utility::createOneshotEffect("fx_fire_barrel_pm");
// ent.v[ "origin" ] = ( X, Y, Z );
// ent.v[ "andles" ] = ( 270, 0, 0 );
// ent.v[ "fxid" ] = "fx_fire_barrel_pm";
// ent.v[ "delay" ] = -15;

ent = maps\_utility::createOneshotEffect("fx_fire_barrel_pm");
ent.v[ "origin" ] = ( -640, 1464, -632 );
ent.v[ "andles" ] = ( 270, 0, 0 );
ent.v[ "fxid" ] = "fx_fire_barrel_pm";
ent.v[ "delay" ] = -15;
}


The result? Nothing is showing up onscreen. Let me know what you think. The reason why I am using a testmap is because the actual map I'm working on has well over 1000 lines of code, and I doubt you want to read through all of that. Thanks for your help.

Any suggestions? Let me know what you think. I know I am doing something wrong.
Marked as best answer by mini0013xx 7 years ago
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
Sp and zombiemode are nearly identical except most zombiemode tutorials say
Paste above or below maps/_zombiemode::main();
For single player its
Above or below
Maps/_load::main();
//
Try this
https://www.mediafire.com/download/71mkj366j1tegm2
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 August 2013
Last active: 3 years ago
Posts
25
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
mini0013xx's Groups
mini0013xx's Contact & Social Links
Sp and zombiemode are nearly identical except most zombiemode tutorials say
Paste above or below maps/_zombiemode::main();
For single player its
Above or below
Maps/_load::main();
//
Try this
https://www.mediafire.com/download/71mkj366j1tegm2

Well, I have to say I feel a little stupid. I started mapping in late 2012 and I've never been able to figure out the issue with scripting my fx. Perhaps I should handle them all in the main .gsc from now on, and forget about using the _fx.gsc

Thank you so much for your help!
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
Glad its working.

My suggestion if your looking to make it easier and keep everything in 1 file.
Make a function and call it above load and put all your fx loadfx stuff in it.
Make another for precache models and shaders.
And another for anims precache.

The only time it ever was a problem was a few sp anims that needed to go after load because they had a type of notetracks. And i think thats where the mapname_anim gets called just after notetracks are cleared. It wont ever come up but if it does now you know.
//
Most zombiemode tutorials work in sp without much modification if you keep everything precache above load and all the threaded stuff after load.

 
Loading ...