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

add oneshot fx after use. How? + example

broken avatar :(
Created 8 years ago
by ville88
0 Members and 1 Guest are viewing this topic.
2,212 views
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
///// need add FX in this function. help




secret_item()
{
   assert( IsDefined( self.script_sound ) );

   self PlayLoopSound( self.script_sound );

   brain = getEnt("secret_zombie_brain","targetname");
   trig = getEnt("secret_trigger","targetname");

   trig waittill("trigger");
   trig delete();
   trig SetCursorHint( "HINT_NOICON" );
   trig setHintString("DOOR_UNLOCKED");

   iPrintLnBold("You have found a serect zombie brain");
   
   brain delete();
   wait 0.1;
   self.zombie_brain_num = self.zombie_brain_num + 1;

   thread army_door();

      players = get_players();
      for(i=0;i<players.size;i++)
   {
      players playsound("zombie_head_gib" );
   }
}
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
One thing: you're deleting the trigger before setting its hint, so it won't work.
And for the fx, you can use this function:
Code Snippet
Plaintext
playFx( level._effect[ "REFERENCE_OF_THE_FX" ], <origin_of_fx> );
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
/////// This example does not work

Code Snippet
Plaintext
secret_item()
{
assert( IsDefined( self.script_sound ) );

self PlayLoopSound( self.script_sound );

brain = getEnt("secret_zombie_brain3","targetname");
trig = getEnt("secret_trigger3","targetname");

trig waittill("trigger");
trig delete();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("DOOR_UNLOCKED");

iPrintLnBold("You have found a serect zombie brain");

brain delete();
wait 0.1;
self.zombie_brain_num = self.zombie_brain_num + 1;

thread army_door();

players = get_players();
for(i=0;i<players.size;i++)
{
players[i] playsound("zombie_head_gib" );
PlayFx( level._effect["headshot"], self.origin );
}
}






I'm not a scripter. you can show me the right example?

Double Post Merge: June 14, 2016, 07:55:12 pm
///////////full version but not work FX

Code Snippet
Plaintext
#include maps\_music;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_utility;

main()
{

self.zombie_brain_num = 0;
thread secret_item();
thread secret_item2();
thread secret_item3();

}
//Secret_zombie_brains
secret_item()
{
assert( IsDefined( self.script_sound ) );

self PlayLoopSound( self.script_sound );

brain = getEnt("secret_zombie_brain","targetname");
trig = getEnt("secret_trigger","targetname");

trig waittill("trigger");
trig delete();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("DOOR_UNLOCKED");

iPrintLnBold("You have found a serect zombie brain");

brain delete();
wait 0.1;
self.zombie_brain_num = self.zombie_brain_num + 1;
PlayFx( level._effect["headshot"], self.origin );

thread army_door();

players = get_players();
for(i=0;i<players.size;i++)
{
players[i] playsound("zombie_head_gib" );
}
}

secret_item2()
{
assert( IsDefined( self.script_sound ) );

self PlayLoopSound( self.script_sound );

brain = getEnt("secret_zombie_brain2","targetname");
trig = getEnt("secret_trigger2","targetname");

trig waittill("trigger");
trig delete();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("DOOR_UNLOCKED");

iPrintLnBold("You have found a serect zombie brain");

brain delete();
wait 0.1;
self.zombie_brain_num = self.zombie_brain_num + 1;
PlayFx( level._effect["headshot"], self.origin );

thread army_door();

players = get_players();
for(i=0;i<players.size;i++)
{
players[i] playsound("zombie_head_gib" );
}
}

secret_item3()
{
assert( IsDefined( self.script_sound ) );

self PlayLoopSound( self.script_sound );

brain = getEnt("secret_zombie_brain3","targetname");
trig = getEnt("secret_trigger3","targetname");

trig waittill("trigger");
trig delete();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("DOOR_UNLOCKED");

iPrintLnBold("You have found a serect zombie brain");

brain delete();
wait 0.1;
self.zombie_brain_num = self.zombie_brain_num + 1;
PlayFx( level._effect["headshot"], self.origin );

thread army_door();

players = get_players();
for(i=0;i<players.size;i++)
{
players[i] playsound("zombie_head_gib" );
}
}

army_door()
{

if(self.zombie_brain_num == 3)
{

door1 = getEnt("secret_doors01","targetname");

players = get_players();
for(i=0;i<players.size;i++)
players[i] playsound("bridge_lower");

door1 movez(128, 4); 

self.gate_is_moving = "true";

wait 1;
iPrintLnBold("Well Done, You have opened the Secret Door");
wait 3;
door1 delete();

}
}

Last Edit: June 14, 2016, 07:55:12 pm by ville88
Marked as best answer by ville88 8 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Your script is thread on level it looks like, and would throw an error if testing in devscript with the first assert, I assume.

I would start tweaking your script like this:

Code Snippet
Plaintext
#include maps\_music;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_utility;

main()
{
brainTrigs = GetEntArray( "secret_trigger","targetname" );
level.zombie_brain_num = brainTrigs.size;
array_thread( brainTrigs,::secret_item );
}
//Secret_zombie_brains
secret_item()
{
//put the script_sound kvp on the trigger
assert( IsDefined( self.script_sound ) );

self PlayLoopSound( self.script_sound );
/*
delete the targetname of the brain, and
make each brain the target of the trigger by selecting the trig, then the brain, then pressing w
*/
brain = getEnt(self.target,"targetname");
self SetCursorHint( "HINT_NOICON" );
self setHintString("DOOR LOCKED");
self waittill("trigger");
self setHintString("DOOR_UNLOCKED");
self delete();

iPrintLnBold("You have found a serect zombie brain");


PlayFx( level._effect["headshot"], brain.origin );
players = get_players();
brain playsound("zombie_head_gib" );

brain delete();
level.zombie_brain_num--;
if(level.zombie_brain_num<=0){
thread army_door();

}
}
army_door()
{

door1 = getEnt("secret_doors01","targetname");

players = get_players();
for(i=0;i<players.size;i++)
players[i] playsound("bridge_lower");

door1 movez(128, 4); 

self.gate_is_moving = "true";

wait 1;
iPrintLnBold("Well Done, You have opened the Secret Door");
wait 3;
door1 delete();
}


You'll notice there is only one function for your secret items now. You will need to make radiant changes for this to work, such as giving all the triggers the same targetname kvp of secret_trigger and deleting the targetname of each brain, and then selecting first the trigger and then the brain, and then pressing W. Resulting in a auto numbered link between them as target and targetname. You would add the script_sound kvps to your trigger also.

Once that is done and compiled this method will work better. As far as the fx, you are simply trying to play it after there is no record of the origin, cause the object was deleted in previous steps, or self is level?
Last Edit: June 14, 2016, 09:05:53 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: rueurope
Date Registered: 2 January 2012
Last active: 2 months ago
Posts
303
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
ville88's Groups
Your script is thread on level it looks like, and would throw an error if testing in devscript with the first assert, I assume.

I would start tweaking your script like this:

Code Snippet
Plaintext
#include maps\_music;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_utility;

main()
{
brainTrigs = GetEntArray( "secret_trigger","targetname" );
level.zombie_brain_num = brainTrigs.size;
array_thread( brainTrigs,::secret_item );
}
//Secret_zombie_brains
secret_item()
{
//put the script_sound kvp on the trigger
assert( IsDefined( self.script_sound ) );

self PlayLoopSound( self.script_sound );
/*
delete the targetname of the brain, and
make each brain the target of the trigger by selecting the trig, then the brain, then pressing w
*/
brain = getEnt(self.target,"targetname");
self SetCursorHint( "HINT_NOICON" );
self setHintString("DOOR LOCKED");
self waittill("trigger");
self setHintString("DOOR_UNLOCKED");
self delete();

iPrintLnBold("You have found a serect zombie brain");


PlayFx( level._effect["headshot"], brain.origin );
brain delete();
level.zombie_brain_num--;
if(level.zombie_brain_num<=0){
thread army_door();
players = get_players();
for(i=0;i<players.size;i++)
{
players[i] playlocalsound("zombie_head_gib" );
}
}
}
army_door()
{

door1 = getEnt("secret_doors01","targetname");

players = get_players();
for(i=0;i<players.size;i++)
players[i] playsound("bridge_lower");

door1 movez(128, 4); 

self.gate_is_moving = "true";

wait 1;
iPrintLnBold("Well Done, You have opened the Secret Door");
wait 3;
door1 delete();
}


You'll notice there is only one function for your secret items now. You will need to make radiant changes for this to work, such as giving all the triggers the same targetname kvp of secret_trigger and deleting the targetname of each brain, and then selecting first the trigger and then the brain, and then pressing W. Resulting in a auto numbered link between them as target and targetname. You would add the script_sound kvps to your trigger also.

Once that is done and compiled this method will work better. As far as the fx, you are simply trying to play it after there is no record of the origin, cause the object was deleted in previous steps, or self is level?


////  my test
Last Edit: June 14, 2016, 08:45:56 pm by ville88
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
nice map tho  :gusta:

 
Loading ...