Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: how to change sound walking ?  (Read 5133 times)

0 Members and 1 Guest are viewing this topic.

Chris

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
    • View Profile
how to change sound walking ?
« on: February 19, 2009, 03:10:40 AM »

how to change sound walking in which surface

for ex:




sound 1 in carpet

sound 2 in wood
or more
« Last Edit: February 21, 2009, 07:18:35 PM by abcdamir »
Logged

Net

  • Gripped Software Programmer
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • View Profile
    • Čurina
Logged

Chris

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
    • View Profile
Re: how to change sound walking ?
« Reply #2 on: February 19, 2009, 11:47:17 PM »

what is name surface in 3d file ?

and other infomation in .geometry ?

Logged

Net

  • Gripped Software Programmer
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • View Profile
    • Čurina
Re: how to change sound walking ?
« Reply #3 on: February 20, 2009, 09:14:21 AM »

Don't know exactly, but from head i think, there should be "walk-planes"
Logged

HelLRaiseR

  • I don't want to make a Monkey Island clone :(
  • Wiki editor
  • Frequent poster
  • ****
  • Karma: 4
  • Offline Offline
  • Posts: 270
    • View Profile
    • Adventure Box Studios
Re: how to change sound walking ?
« Reply #4 on: February 20, 2009, 11:57:20 AM »

No, you don't need to do nothing with the walk planes. You need to make a region in the SceneEdit, for example, a region called "carpet". Then you must add a custom property when the region "carpet" is selected. A dialog window will be appear. In this dialog you can create a variable and value for this variable, for example variable:surface value;carpet

In the sprite editor (if its a 2D character) or in the act3d file (if it's a 3d character) you need to indicate in that frame WME will be send the "footstep" event.

For example:

In the act3d file

ANIMATION
  {
    NAME="walk"
    LOOPING=TRUE

    EVENT
    {
      FRAME = 10
      NAME = "footstep"
    }
}

In the 10th frame of the animation walk, WME send the "footstep" event

Now, in the actor script, you need to write the code for play the sound of the footstep in the carpet:

on "footstep"  // This is the event, this code will be execute when WME play the 10th frame of the animation,
               // this frame will bi corresponded when the foot of the actor is in teh floor, of course.
{
 // get a region the actor is standing in
 var Reg = Scene.GetRegionAt(this.X, this.Y);
 if (Reg!=null)
 {
   // play a sound depenging on a surface
   // "surface" is a custom property we defined in SceneEdit
   switch(Reg.surface)
   {
     case "carpet":
       this.PlaySound("carpet_footstep.ogg");  // If the actor is wlking on the carpet then play carpet foot step sound
     break;
     default:
       this.PlaySound("normal_footstep.ogg"); // In other case, play the normal footstep sound (floor).
     break;
   }
 }
}


If you've several surfaces, you need to define several regions, one for every surface, and create the variable "surface" and his value for every surface.

In the code, you can add several pieces of code case .... break; with the check of the surface type and play the corresponfing surface sound.

Logged
Regards,

    Fernando

Chris

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
    • View Profile
Re: how to change sound walking ?
« Reply #5 on: February 21, 2009, 07:19:45 PM »

thanks  HelLRaiseR   ::rock
Logged

HelLRaiseR

  • I don't want to make a Monkey Island clone :(
  • Wiki editor
  • Frequent poster
  • ****
  • Karma: 4
  • Offline Offline
  • Posts: 270
    • View Profile
    • Adventure Box Studios
Re: how to change sound walking ?
« Reply #6 on: February 23, 2009, 11:49:40 AM »

You're welcome.
 ::thumbup
Logged
Regards,

    Fernando
 

Page created in 0.02 seconds with 24 queries.