Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Canister

#1
It works! :D Thank you very much! Well, I hope that I won't have any problems with modifying this function later.

Edit:
Well I have some problems, I want "a" to be random number between 6 and 9, but when I change int a=6; to int a=6 + Random(3); error "audio clip aSound9 not found" is displayed. Of course, I have files named Sound9, Sound 10 and so...

Edit no.2:
Oooh, its this new object-oriented audio, nevermind.
#2
Thanks, I've changed the code, now I have something like this:
Code: ags


function repeatedly_execute() {
  if (Region.GetAtRoomXY(cSeba.x, cSeba.y) == region[1]) 
  {
  SetFrameSound(1, 0, 1, 10);
  SetFrameSound(1, 0, 4, 11);
  SetFrameSound(1, 1, 3, 10);
  SetFrameSound(1, 1, 6, 11);
  SetFrameSound(1, 2, 3, 10);
  SetFrameSound(1, 2, 6, 11);
  SetFrameSound(1, 3, 1, 10);
  SetFrameSound(1, 3, 4, 11);
 }
 else {
    SetFrameSound(1, 0, 1, 6);
    SetFrameSound(1, 0, 4, 7);
    SetFrameSound(1, 1, 3, 6);
    SetFrameSound(1, 1, 6, 7);
    SetFrameSound(1, 2, 3, 6);
    SetFrameSound(1, 2, 6, 7);
    SetFrameSound(1, 3, 1, 6);
    SetFrameSound(1, 3, 4, 7);
 }

Well, there's no random different sounds for now, but I still have the problem with changing sounds while doing something different than "Walk to...". For example: I have the bush in the middle of lawn. Player is standing on the sand, and clicks "Walk to..." on grass and it works perfectly. Then, the same situation - player is sanding on sand, and clicks "Interact" on bush, so character is moving to the WalkToPoint, and when he's on the grass it still sounds like sand. What should I do?
#3
Well, I have a problem with different footstep sounds for different regions. Well, basically I have 4 different sounds for each region like grass or sand, etc.
I put in the room script something like this:
Code: ags

function region1_Standing() // I use this function for each region
{
  int grass = Random (3);
   if (grass == 0) {
     SetFrameSound(1, 0, 1, 6);
     SetFrameSound(1, 0, 4, 6);
     SetFrameSound(1, 1, 3, 6);
     SetFrameSound(1, 1, 6, 6);
     SetFrameSound(1, 2, 3, 6);
     SetFrameSound(1, 2, 6, 6);
     SetFrameSound(1, 3, 1, 6);
     SetFrameSound(1, 3, 4, 6);
   }
   if (grass == 1) {
    SetFrameSound(1, 0, 1, 7);
    SetFrameSound(1, 0, 4, 7);
    (...)

And, well, it kinda... works. But there's a problem when player do something which includes moving from region to region. When player just clicks "walk to..." its ok, but when he click, for example "interact" its not (character walks to thing he want to interact, however sound doesn't change, while he is changing the region).
Also, I know its not the best way of doing this, and I should use repeatedly_execute() but I don't really know how to. How do I retrieve information about region that player is standing on?
Ah, I tried using CharacterRegionSounds v0.80b module, but it didn't work (bunch of errors).

Anyway, hi ;), this is my first post on this forum. Sorry for my bad English.
SMF spam blocked by CleanTalk