walking on grass

Game Editor comments and discussion.

walking on grass

Postby wordgames » Wed Oct 10, 2007 11:13 pm

I would like to make an actor walk on the grass, as he does i want to make the sound of grass moving,
i have a sound for file that, but when he walks on it and I jump it still plays the rest of the file, should i make the sound byte extra short or is the a way to make the grass play the sound only when the actor is on the grass
Attachments
grass.jpg.JPG
grass.jpg.JPG (4.56 KiB) Viewed 1958 times
User avatar
wordgames
 
Posts: 35
Joined: Mon Oct 01, 2007 5:32 am
Score: 0 Give a positive score

Re: walking on grass

Postby elite » Wed Oct 10, 2007 11:53 pm

maybe you could try
Player
Collision(any side of grass)->play sound(your grass sound)

plz tell me if you didnt understand that.
Hope it works! :D
twigser
after reading this you have just realized you have wasted 5 seconds of your life.
User avatar
elite
 
Posts: 29
Joined: Wed Oct 03, 2007 12:07 pm
Location: in URECTUM
Score: 0 Give a positive score

Re: walking on grass

Postby Kalladdolf » Thu Oct 11, 2007 7:15 am

here, lemme help ya:
first make a variable called "grasssound" (think u know how to do that :D )
Then for your player goes: Collision -> any side of grass -> (Script Editor)
Code: Select all
grasssound = PlaySound2("C:\\your-grass-sound.wav", 1.000000, 1, 0.000000);// here u can click on the action from the list

Then Collision finish-> grass -> (Script editor)
Code: Select all
stopSound(grasssound);
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: walking on grass

Postby wordgames » Fri Oct 12, 2007 12:32 am

the code was not liked, what do i change in it?

wordy

without bothering u ( step by step would be great) what do i do again?
Attachments
untitled.JPG
User avatar
wordgames
 
Posts: 35
Joined: Mon Oct 01, 2007 5:32 am
Score: 0 Give a positive score

Re: walking on grass

Postby Freddy » Fri Oct 12, 2007 12:45 am

Thats what colision finish is for! :D
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score

Re: walking on grass

Postby wordgames » Fri Oct 12, 2007 1:18 am

:? still confused :cry:

the code grasssound = PlaySound2("C:\\your-grass-sound.wav", 1.000000, 1, 0.000000);// here u can click on the action from the list

Does not work

i guess i take out ... here u can click on the action from the list

and change this ... C:\\your-grass-sound.wav to my sound file location

but still says error

wordy
User avatar
wordgames
 
Posts: 35
Joined: Mon Oct 01, 2007 5:32 am
Score: 0 Give a positive score

Re: walking on grass

Postby DilloDude » Fri Oct 12, 2007 1:55 am

Did you create 'grasssound' as a variable?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: walking on grass

Postby wordgames » Fri Oct 12, 2007 2:17 am

i only put 2 s's in the name silly me 8) :oops:
it worky :D :) :o :P
User avatar
wordgames
 
Posts: 35
Joined: Mon Oct 01, 2007 5:32 am
Score: 0 Give a positive score

Re: walking on grass

Postby wordgames » Fri Oct 12, 2007 2:25 am

but theres more...

as u see in the picture the grass is long, so how i do i get the sound to stop as the sctor stops walking in the grass, but is still in the grass

wordy
User avatar
wordgames
 
Posts: 35
Joined: Mon Oct 01, 2007 5:32 am
Score: 0 Give a positive score

Re: walking on grass

Postby DilloDude » Fri Oct 12, 2007 4:04 am

Here's how I achieved a similar thing for an engine sound:
In the draw actor script, have a variable (soundon) to check wether or not the sound should be playing. Test if you are in the grass and moving. If so, then set it to 1. If not, leave it at 0. Somewhere towards the end of the script, use this:
Code: Select all
if (soundon)
{
    if ( grassound == 0)
    {
        grassound = PlaySound2("C:\\your-grass-sound.wav", 1.000000, 1, 0.000000);// here u can click on the action from the list
    }
}
else if (grassound)
{
    stopSound(grassound);
    grassound = 0;
}
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: walking on grass

Postby wordgames » Fri Oct 12, 2007 5:00 am

confused again :oops: it just turned the sound off completely

so a little more detailed for this newbie

and u needed to put the extra s in grasssound
User avatar
wordgames
 
Posts: 35
Joined: Mon Oct 01, 2007 5:32 am
Score: 0 Give a positive score

Re: walking on grass

Postby Kalladdolf » Fri Oct 12, 2007 7:33 am

Oh, come off it!!!!!!!! :x :x
no, just kiddin' :wink:
here's a ge file, very simple but u need a kinda short sound for that, otherwise add the code that I showed u.
grass.zip
;-)
(51.79 KiB) Downloaded 112 times
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: walking on grass

Postby Freddy » Fri Oct 12, 2007 8:29 pm

I have a couple questions as well. I dont understand the collision event, when grasssound = playsound2. The other question is, when you go like:
if(blablabla)
{
if(blablabla)
{
if(blablabla)
}

is that just the same thing as:
if(blablabla && blablabla && blablabla)

? :D
Hola
User avatar
Freddy
 
Posts: 548
Joined: Sat Jun 02, 2007 3:42 pm
Location: Why do you want to know?
Score: 14 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron