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

how do i make audio play when looking at target lookat?

HOT
broken avatar :(
Created 12 years ago
by NaviLlusShore
0 Members and 1 Guest are viewing this topic.
10,895 views
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
when you say your function do you mean a specific spot in the script? i have this at the bottom of my mapname.gsc


setup() is your function.
Code Snippet
Plaintext
setup()
{
trigger = getEnt("test","targetname");
trigger setHintString("&&1 hintstring");
}
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
Signature
NaviLlicious
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
alright that took the syntax error away but the trigger doesnt have the use button option and it doesnt play the sound when i look at it is there something else i need to do?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
alright that took the syntax error away but the trigger doesnt have the use button option and it doesnt play the sound when i look at it is there something else i need to do?
Are you calling the function? Functions have to be called or they won't run. paste:
Code Snippet
Plaintext
thread setup();
before the line:
Code Snippet
Plaintext
maps\_zombiemode::main();
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
i put that line in and it doesnt give me an option to hold F or do anything when i look at it
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
i put that line in and it doesnt give me an option to hold F or do anything when i look at it
Then most likely your KVP in radiant doesn't match your script.
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
alright so if i have this function

   setup()
{
   trigger = getEnt("test","targetname");

   self setHintString("&&1 hintstring");
}

what would the KVP be on the trigger?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
alright so if i have this function

   setup()
{
   trigger = getEnt("test","targetname");

   self setHintString("&&1 hintstring");
}

what would the KVP be on the trigger?
K: "targetname" V: "test"
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
alright so i changed it to

   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");
}

the trigger_use has "targetname" "zk_eggtrig" and the trigger doesnt do anything
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
alright so i changed it to

   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");
}

the trigger_use has "targetname" "zk_eggtrig" and the trigger doesnt do anything
That code doesn't do anything but gets the variable for the ent of the trigger and set the hintstring. You should see a hintstring when near it now. next you would add the line "trigger waittill("trigger");" and then add the code you want when the player triggers the trigger_use.
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
so for example it would be like this?

   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");

   "trigger waittill("trigger");"
}
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
so for example it would be like this?

   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");

   "trigger waittill("trigger");"
}
no quotes around a whole line of code.
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");

   trigger waittill("trigger");
}

and the "trigger" would be the sound file?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
   setup()
{
   trigger = getEnt("zk_eggtrig","targetname");

   self setHintString("&&1 hintstring");

   trigger waittill("trigger");
}

and the "trigger" would be the sound file?
no, all that line of code does is it stops the game from reading the next line until a player presses the use button in the radius of the trigger. Once its pressed the code will continue.
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 11 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
so what would i put to replace "trigger"?
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 6 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
so what would i put to replace "trigger"?
You don't replace it
all that line of code does is it stops the game from reading the next line until a player presses the use button in the radius of the trigger. Once its pressed the code will continue.

 
Loading ...