English Play sound when moving over tile

14 replies
Goto Page
To the start Previous 1 Next To the start
Up
Spy-eR
User
Offline Off
Hello everyone,

I am making my own map and i have some problems there, but i know that its will solve for using a script there, i'm Sure...

I'm not defining my map problem, k?
I'm directly gotta ask and request.

I want play sound on a tile, when we move those tiles so when a play a sound, but its happen with Counter-Terrorist force.tiles position: i have 2 tiles there i want play sound, and when counter-terrorists move those tiles so play another sound.

Tiles Positions:121|88,122|88

Please help me for this script

Thanks
FRiendly boYy.

Admin/mod comment:

"Script needed" is a bad title. Please describe what you want next time. Fixed. /DC
13.01.18 10:01:08 pm
Up
DC
Admin
Offline Off
This can also be done with the map editor only. Without script.s

• Put cs2d entity trigger_move entities on the tiles you want to trigger sounds with, you can enable "CTs only" if you only want CTs to trigger sounds
• Create cs2d entity env_sound entities and cofigure them for the sounds
• Give your env_sound entities names
• Link the env_sound entities to your trigger_move entities by entering the names of the env_sound entities in the trigger field of the corresponding trigger_move entity
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
13.01.18 10:23:33 pm
Up
Mora_rus
User
Offline Off
idk if it would work. Just the simple and quick thing:
Idk which sound type you exactly want, so i made two
Code:
1
2
3
4
5
6
7
addhook("movetile","_movetile")
function _movetile(id,x,y)
     if (x==121 or x==122) and y==88 then
          -- parse('sv_soundpos '..(x*32)..' '..(y*32)..' "soundfile'..player(id,"team")..'.ogg" '..id)
          -- parse('sv_sound2 '..id..' "soundfile'..player(id,"team")..'.ogg"')
     end
end


You can name your files like:
path/sound1.ogg
and
path/sound2.ogg
and if player team is 1 (tt) will be played sound1.ogg and if player team is 2 (ct) will be player sound 2.ogg

Didnt test it and wont do that.
14.01.18 07:15:18 am
Up
Spy-eR
User
Offline Off
@user DC: ,

But its not possible, We can put 2 (Others) Trigger_Move over one tile, i want when (T) Move Those tiles so play other sound and (CT) move those tiles so play other sound.
Not only for Cts, here mainly use a script.
________________

@user Mora_rus: I really didn't understand what really you said, Read My thread for asking script again please.

Thnaks
FRiendly boYy.
14.01.18 10:00:25 am
Up
Mora_rus
User
Offline Off
@user Spy-eR: i did exactly what you want. You're never fucking concrete with your questions!
There is tested version.

Code:
1
2
3
4
5
6
7
addhook("movetile","_movetile")
function _movetile(id,x,y)
     if (x==2 or x==3) and y==2 then
          -- parse('sv_soundpos '..(x*32)..' '..(y*32)..' "soundfile'..player(id,"team")..'.ogg" '..id)
          parse('sv_sound2 '..id..' "soundfile'..player(id,"team")..'.ogg"')
     end
end


Change x and y and decide which sound type you want and then make a path with your sounds. Name them like:
sound1.ogg (or wav, so you'd need to change ogg to wav in lua), it will be TT sound
and sound2.ogg (or wav, you'd again need to change ogg to wav in this lua), it will be CT sound.
14.01.18 03:18:19 pm
Up
Spy-eR
User
Offline Off
Compulsory question are below,

@user Mora_rus:, where i will be write Tiles Position?
________________________________

And you means, i change x,y to my Sound path folder name ?, can you give me example, i'm confuse.

Mora_rus has written:
function _movetile(id,x,y)



Our sounds when cts and tt are move so play sounds are:

For Cts: sfx/!jail sounds/Weapons_OFF.wav
For tt: sfx/!jail sounds/Weapons_OFF.wav

Tile Position, there i wants to play both sound:

121|88

@user Mora_rus: Don't Rage, i'm nab anyways

Please help a nab, but read my compulsory question plz
FRiendly boYy.
14.01.18 11:00:37 pm
Up
Mora_rus
User
Offline Off
Version for people with low iq:
Code:
1
2
3
4
5
6
7
8
9
10
addhook("movetile","_movetile")
function _movetile(id,x,y)
     if (x==121 or x==122) and y==88 then
          if player(id,"team")==1 then
               parse('sv_sound2 '..id..' "sfx/!jail sounds/Weapons_OFF.wav"')
          else
               parse('sv_sound2 '..id..' "sfx/!jail sounds/Weapons_OFF.wav"')
          end
     end
end


change the path, after
if player(id,"team")==1 then
you see path for TT (5 line), after
else
you see path for CT (7 line)
15.01.18 07:11:24 pm
Up
Spy-eR
User
Offline Off
@user Mora_rus: Listen, There no playing sound after moving ct and tt. However, there unbelievable silence, what you said about changing some line, in your below quote?

Mora_rus has written:
change the path, after if player(id,"team")==1 then you see path for TT (5 line), after else you see path for CT (7 line)
FRiendly boYy.
15.01.18 07:16:16 pm
Up
Mora_rus
User
Offline Off
Can i say fuck you, please?

IMG:https://i.imgur.com/NYkAjYV.png


your path is incorrect, there should be no "sfx/!jail sounds/Weapons_OFF.wav" but "!jail sounds/Weapons_OFF.wav"

Code:
1
2
3
4
5
6
7
8
9
10
addhook("movetile","_movetile")
function _movetile(id,x,y)
     if (x==121 or x==122) and y==88 then
          if player(id,"team")==1 then
               parse('sv_sound2 '..id..' "!jail sounds/Weapons_OFF.wav"')
          else
               parse('sv_sound2 '..id..' "!jail sounds/Weapons_OFF.wav"')
          end
     end
end
17.01.18 07:36:51 pm
Up
Spy-eR
User
Offline Off
Mr.@user Mora_rus: , Can i say Fuck you too?

You mistake again,
I said you: when Terrorist Move those Tiles so Play "weapons On" sound and Counter-Terrorist Move so play "Weapon off" sound, dude

please change this your mistake///

By the i wants to change Tile Position who i was gave you.

Please Change (x,y)Tile Set Position to 154|102,

If you do that, so over Work is successfully done it.
FRiendly boYy.
17.01.18 07:45:29 pm
Up
Masea
Super User
Offline Off
@user Spy-eR: Stop using translate. I don't understand, nor people do.
Create and design your GUI easy and fast: file cs2d GUI Framework (v2) (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
17.01.18 08:35:28 pm
Up
Mora_rus
User
Offline Off
user Spy-eR has written:
Mr.@user Mora_rus: , Can i say Fuck you too?

You mistake again,
I said you: when Terrorist Move those Tiles so Play "weapons On" sound and Counter-Terrorist Move so play "Weapon off" sound, dude

please change this your mistake///

By the i wants to change Tile Position who i was gave you.

Please Change (x,y)Tile Set Position to 154|102,

If you do that, so over Work is successfully done it.


No! Is all over. I'd never watch your threads again. Bye
17.01.18 10:18:40 pm
Up
script favor
User
Offline Off
This should work

Code:
1
2
3
4
5
6
addhook('movetile','movetile_hook')
function movetile_hook(id,x,y)
     local s1 = Yourpath/sound
     parse("sv_sound2 "..s1)
     return 1
end


Good luck.
Death is My note !
18.01.18 05:10:08 am
Up
Rainoth
Moderator
Offline Off
If you want to achieve that in map, all you have to do is make trigger_move trigger 2 trigger_if entities both checking different teams. You don't need scripts if its only for that one map.
18.01.18 05:32:16 pm
Up
Spy-eR
User
Offline Off
@user Mora_rus: Okay fine,

@user Masea: : By the way i'm not Using Translator, my English is sucks anyways.

Okay Guys no problem i'm try to solve this problem myself.

Thanks for your works.
FRiendly boYy.
To the start Previous 1 Next To the start