Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,128 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Grass-sound sounds good to me #205294
05/05/08 17:20
05/05/08 17:20
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
Hello,

I tried to find something about SCAN_TEXTURE and different walk-sounds depending of different textures under the player but had no luck so far…

Only thing I found is topic on Ask Conitecforum...

http://www.coniserver.net/ubb7/ubbthread...true#Post201471

...and answer form JCL that refers to manual

http://manual.conitec.net/aent_trace.htm

It leads to very unspecific information about c_trace modes and nothing further.

I ‘m sure there is something more informative somewhere so if anyone knows of a tutorial, AUM article or maybe open-script game that has this thing implemented please, please, tell me or send link.

It’s impossible that there is nothing about important topic like this… my player sounds the same on wood, gravel, grass or metal \:\)


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Grass-sound sounds good to me [Re: Ganderoleg] #205298
05/05/08 17:31
05/05/08 17:31
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Use SCAN_TEXTURE with c_trace, it can return texture name.


3333333333
Re: Grass-sound sounds good to me [Re: Quad] #205300
05/05/08 17:45
05/05/08 17:45
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
Thanx for your reply Quadraxas,

I was really hopping that there is some tutorial out there that can be used…

I can add +SCAN_TEXTURE to c_trace but I don’t understand how the
texture-name-thing works… Do I need event or action or function or some sort of sound-material attached to the texture…

I could look in to that water-splash-sound-code but I was hopping I get the real thing, real code solution for this somewhere…


Last edited by Ganderoleg; 05/05/08 17:46.

>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Grass-sound sounds good to me [Re: Ganderoleg] #205332
05/05/08 21:36
05/05/08 21:36
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
O.k. so I tried some things:

First I have default walk sound thud and different sound I call thudB.

Then I have variable that controls playing of these sounds called korak_zvuk.

I have special function called under_tex and it’s started in action player_walk_fight before player_move2 function and other things…

This is function under_tex()

vec_set(temp, my.x);
temp.z -= 500;
c_trace(my.x,temp,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS|IGNORE_SPRITES|SCAN_TEXTURE);
if( str_cmpni(tex_name,"BZid_04_tga") == 1){korak_zvuk=1;}
if(str_cmpni(tex_name,"Josef_054_bmp") == 1){korak_zvuk=2;}

...it works in a way because it changes the sound but it’s always the one who is last…
…so it doesn’t work

I guess I’m using the wrong comparing code but this is the one that is used in lflare.wdl…

Can anyone help in any way please… \:\/


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Grass-sound sounds good to me [Re: Ganderoleg] #205347
05/05/08 23:55
05/05/08 23:55
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
Sooo… everything worked out

I replaced my "Josef_054_bmp" comparison texture name from…

if(str_cmpni(tex_name,"Josef_054_bmp") == 1)

…with tex_a that I wrote as…

string tex_a = "Josef_054.bmp";

…and now it’s like this…

if( str_cmpni(tex_name,tex_a) == 1)

…and it all works happily ever after \:D

Just kidding- it has waaaaay tooooooo many bugs \:\(

I’m gona do it another way with sonar. Already tried it and it’s much, much, much better then this SCAN_TEXTURE sh*ty system…


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Grass-sound sounds good to me [Re: Ganderoleg] #205759
05/08/08 16:12
05/08/08 16:12
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
but sonar scans texture too, :S

But you say, if string... then play the sound 1
but you don't exclude others..
you should do this..
if( str_cmpni(tex_name,tex_a) == 1){play sound a}
if( str_cmpni(tex_name,tex_b) == 1){play sound b}
etc.. so if there is no =1 then no sound defined for texture.

Re: Grass-sound sounds good to me [Re: MMike] #206312
05/12/08 22:04
05/12/08 22:04
Joined: Jul 2005
Posts: 366
eleroux Offline
Senior Member
eleroux  Offline
Senior Member

Joined: Jul 2005
Posts: 366
You need to organize your code.

Have you already got to play a single, fixed footstep sound? That's the first step (no pun intended) because it's not as simple as playing the sound on every loop. You have to play the sound at certain points of the animation cycle.

In the same loop with the c_trace, for instance, you could define a skill for the actor that stores the kind of floor he is standing or walking on:
c_trace(my.x,temp,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS|IGNORE_SPRITES|SCAN_TEXTURE);
if( str_cmpni(tex_name,"BZid_04_tga") == 1){my._skillFloorType = 1;}
if(str_cmpni(tex_name,"Josef_054_bmp") == 1){my._skillFloorType=2;}

In my code, I used another skill as a 'sound trigger'. For instance, 0 means NO SOUND, 1 means FOOT STEP, 2 means ATTACK SOUND, etc.

Then in the animation part, you have to make sure the sound isn't played repeatedly, but only twice per walk loop. So I use the skill everytime I need a sound, for instance:
my._skillSoundTrigger = 1;

then I have a permament loop for every actor that has sound, parallel to the other loops. Kinda:

Code:
function actorSound ()
{
while (me)
{
  if (my._skillSoundTrigger ==1)
  {  
      if (my.skillFloorType ==1) {play sound 1}
      if (my.skillFloorType ==2) {play sound 2}
      my._skillSoundTrigger =0 ; (WARRANTS sound will played just once)
   }
   wait(1)
}


And if you get tidy, you can have all your floor types and sound names organized by enumerating them, putting their pointers in arrays, etc. And, in the future, will be very easy to make the characters play attack screams and jump/fall sounds. You will only need to 'if player hit the attack button: {my._skillSoundTrigger = SOUNDATTACK}.' - fire and forget, sound will play just once.

Please note these code snippets are still from C-script, and it's not a plug and play code. I'm just trying to help with some ideas that work.

Emilio



Last edited by eleroux; 05/12/08 22:07.
Re: Grass-sound sounds good to me [Re: eleroux] #207281
05/18/08 22:00
05/18/08 22:00
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
Thanx for suggestions smile

I made a function that starts in player_walk_fight action and it didn’t work very well frown

It worked but it was not really precise I will try to start it from in the loop with the c_trace (That’s move template from A5 Template scripts right?) and see how it goes.

Thanx for help to both of you.


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<


Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1