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

staff buildable fx prob

broken avatar :(
Created 10 years ago
by javipotter
0 Members and 1 Guest are viewing this topic.
2,220 views
broken avatar :(
×
broken avatar :(
Location: escastellon
Date Registered: 14 February 2013
Last active: 4 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
javipotter's Groups
javipotter's Contact & Social LinksZombieModdingJavipotterJAVI-POTTERjavi potter
hi, i write this because im making buildables of staff, each piece has an fx but theproblem is that when i take the piece the fx doesnt dissapear, here is the script i hope u know how to solve this little problem
Code Snippet
Plaintext
//================================================================================================
// Notes      : call after zombiemode main in MAPNAME.GSC
// Fire Staff Buildable Script
//================================================================================================
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
flag_init("gas_cantrue");
flag_init("oiltrue");
flag_init("recipetrue");
gas_can = GetEnt("pickup_lightningstaff_1_trigger","targetname");// trigger in radiant that players use to pick up model
gas_can thread gas_can(gas_can);
oil = GetEnt("pickup_lightningstaff_2_trigger","targetname");// // trigger in radiant that players use to pick up model
oil thread oil(oil);
recipe = GetEnt("pickup_lightningstaff_3_trigger","targetname");// // trigger in radiant that players use to pick up model
recipe thread recipe(recipe);
recipetrue = GetEnt("build_lightningstaff","targetname");///trigger in radiant that players use to build model
recipetrue recipetrue(recipetrue);
}

gas_can()
{
self sethintstring( "^4press &&1 to pick up Piece"  );
self setCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookat();
player = undefined;
gas_canpart1 = getent("lightningstaff_1", "targetname");// model that u want to actually pick up
playfx (level._effect["lightning_fx"], self.origin);// add your fx here optional
self waittill("trigger", player);
gas_canpart1 Delete();
flag_set( "gas_cantrue" );
player thread builablehud("I hope there is a gas station on this rock");
playfx (level._effect["powerup_grabbed"], self.origin);
playfx (level._effect["powerup_grabbed_wave"], self.origin);
self Delete();
}

oil()
{
self sethintstring( "^4press &&1 to pick up Piece"  );
self setCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookat();
oilpart1 = getent("lightningstaff_2", "targetname");// model that u want to actually pick up
player = undefined;
playfx (level._effect["lightning_fx"], self.origin);// add your fx here optional
self waittill("trigger", player);
oilpart1 Delete();
flag_set( "oiltrue" );
player thread builablehud("Now maybe that engine wont jam");
playfx (level._effect["powerup_grabbed"], self.origin);
playfx (level._effect["powerup_grabbed_wave"], self.origin);
self Delete();
}

recipe()
{
self sethintstring( "^4press &&1 to pick up Piece"  );
self setCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookat();
recipepart1 = getent("lightningstaff_3", "targetname");// model that u want to actually pick up
player = undefined;
playfx (level._effect["lightning_fx"], self.origin);// add your fx here optional
self waittill("trigger", player);
recipepart1 Delete();
flag_set( "recipetrue" );
player thread builablehud("Now maybe that engine wont jam");
playfx (level._effect["powerup_grabbed"], self.origin);
playfx (level._effect["powerup_grabbed_wave"], self.origin);
self Delete();
}


recipetrue()
{
self sethintstring( "^4Missing Piece"  );
self setCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookat();
recipepart = getent("lightning_staff_view", "targetname");// model that will actually show up once player builds it
recipepart hide();
player = undefined;
flag_wait( "recipetrue" );
flag_wait( "oiltrue" );
flag_wait( "gas_cantrue" );
self sethintstring( "^4press &&1 to Place Pieces"  );
self waittill("trigger", player);
player thread maps\_zombiemode_perks::do_knuckle_crack();
playfx (level._effect["powerup_grabbed"], self.origin);
playfx (level._effect["powerup_grabbed_wave"], self.origin);
self sethintstring( "^4press &&1 to pick up gun"  );
    self waittill("trigger", player);
    player GiveWeapon("staff_lightning");
    player SwitchToWeapon("staff_lightning");
self Delete();
recipepart show();
recipepart solid();
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////
builablehud( text )
{
hint_hud = create_simple_hud( self );
hint_hud.alignX = "center";
hint_hud.alignY = "middle";
hint_hud.horzAlign = "center";
hint_hud.vertAlign = "middle";
hint_hud.fontscale = 8;
hint_hud.color = ( 1, 1, 1 );
hint_hud.x = 0;
hint_hud.y = -4; // -265;
hint_hud.alpha = 0;
hint_hud SetText( text );
hint_hud FadeOverTime( 1 );
hint_hud.alpha = 1;
wait( 1 );
hint_hud FadeOverTime( 2 );
hint_hud.color = ( 0, 0.4, 0 );
wait(2.5);
hint_hud Destroy();
}
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
I'm not a scripter so I haven't looked at the script, but is the fx looping? That could be the problem.
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
also the best way to remove the fx is delete the item its spawned on :) learned that the hard way
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
you're using "playfx" which spawns the fx at given origin but cant be deleted, so the fx must not be a naturally looped fx because. well, it will loop forever and you cant stop that.
thats why people use "playfxontag" which can be spawned at any tag of a model. normally "tag_origin". and theres a model called "tag_origin" with the same tag name which is invisible so you can play fx on that also. and to stop the fx you must delete the model(ent) it is being played on.
broken avatar :(
×
broken avatar :(
Location: escastellon
Date Registered: 14 February 2013
Last active: 4 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
javipotter's Groups
javipotter's Contact & Social LinksZombieModdingJavipotterJAVI-POTTERjavi potter
But can anyone add the scripting lines cause i dont know how to write that
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
Code Snippet
Plaintext
staff = getEnt("box","targetname");
fx = PlayFxOnTag( level._effect["powerup_grabbed"], staff, "tag_origin" );
Last Edit: August 14, 2014, 06:25:24 pm by n123q45
broken avatar :(
×
broken avatar :(
Location: escastellon
Date Registered: 14 February 2013
Last active: 4 years ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
javipotter's Groups
javipotter's Contact & Social LinksZombieModdingJavipotterJAVI-POTTERjavi potter
Where do i have toplaceit and do I have to modify smthing?
broken avatar :(
  • n123q45
  • Deleted Member
×
broken avatar :(
n123q45
This user is deleted :(
modify the variables based on your script. and it goes exactly where the old fx would

 
Loading ...