Suggestions for AGS

Started by Gregjazz, Sun 11/04/2004 02:58:18

Previous topic - Next topic

Gregjazz

I've been doing some scripting and here are a few little things I ran into. It would be nice to have...

1. A few more sound channels. (not really THAT necessary, but all the same cool)
2. Non-looping ambient sounds (not sure if there's a practical way of scripting this)
3. RawDrawImageTransparent (like the normal RawDrawImage function, except you can specify the transparency level -- now this would be useful)

Anyways, I hope this is not too much to ask for, but I would be extremely grateful if these were implemented in AGS.

Thanks,

Geoffkhan

strazer

1. I'd rather like to see more ambient sound channels. I know they're planned, so I hope we'll see them in the not too distant future.

Regarding 2, what would a non-looping ambient sound do that PlaySound doesn't?

Gregjazz

Basically that way you'd be able to assign sounds to a location on the screen, and if the character is closer to those coordinates, the sound is louder and appropriately panned. I've needed that ability in several of my projects.

Scorpiorus

#3
Quote2. Non-looping ambient sounds (not sure if there's a practical way of scripting this)
You could use SetChannelVolume() to set a channel volume depending on the distance between the player and the sound origin then PlaySoundEx().

Quote3. RawDrawImageTransparent (like the normal RawDrawImage function, except you can specify the transparency level -- now this would be useful)
Already implemented in the current beta :)

Pumaman

1. It's on my list - I'll try and get round to it at some point.

2. I think for this, Scorpiorus' workaround of doing it manually is the best solution. Ambient sounds are designed to repeat.
Remember that with the new repeatedly_execute_always you can adjust the volume even within blocking cutscenes.

3. As Scorp says, it's already in 2.61 beta 4

Gregjazz

It's implemented in the latest beta! Rejoice! I thought it might have been... silly me!

I find that the SetChannelVolume doesn't always work. It's weird, I found that only channel 3's volume would change.

Gregjazz

It always happens. I just download the current beta version of AGS and the next day a new version is released. Whatever. :)

I have one more suggestion:

I think it's been requested before, but I really need diagonal walkbehind baselines. I figured out a way to kinda script it, but it didn't support more than one character. For example, imagine a diagonal fence (from an isometric viewpoint). I need it so you can walk behind the fence and in front of it -- in fact I need it so that I could have one character behind it and another in front of it similtaneously.

Do you think you could make it so walkbehind baselines could be rotated? Or even better, they could be free-hand drawn?

It would be so helpful, thank you!

Pumaman

This has been requested occasionally, but hasn't yet been implemented because it makes the baseline calculations significantly more complicated - at the moment, it'sjust a simple Y-coordinate check.

Gregjazz

Hmmm. Sounds like a difficult programming problem.

Maybe what you could do is just forget about the whole "angle" of a baseline thing and just have a line or freehand? Really all I care about now is a custom baseline for walkbehinds.

I don't know. I've thought up a way around that which might work, I'll just have to experiment.

..

My suggestion would be that when you choose things like character start positions and walk to points you could do this visually like have a temporary version fo the character that you move around the room to where you want it and then press enter or whatevera nd it calculate the co-ordinates, cos im confused doing it manually. This is similar to the way you choose where objects are by moving them.

Only if you can though ;) Don't want to be a nuisance.

Gregjazz

#10
Well here's a handy trick for you:

Did you know you can right-click on the background and then click "copy coordinates into clipboard"? You can then hit shift+insert and paste it into whereever. Handy, no?

EDIT: By the way, the reason I needed that walkbehind baseline thing is because I have a diagonal fence (from Isometric view). There are more than one characters, so they must be able to go on both sides of the fence at a time. Any suggestions?

Rui 'Trovatore' Pires

#11
Geoffkhan  - About the fence, you could do a trick with regions. Have a region in front of the fence, another on the other side. Then, on rpeatedly_execute_always, check for character[X] being on the region behind the fence, and if it is store the character's number in, say, int charbehind. Then run something like

if (charbehind>=0) SetCharacterBaseline(charbehind,(and enter here the baseline for walking behind the fence).

Repeat the process for walking in front of it, making the baseline 0, of course.

Fiddle with this awhile, let me know if it works.

EDIT - I just figured out that the first check,
Quotecheck for character[X] being on the region behind the fence,
may not be easy to accomplish... I'll think about that.

EDIT 2 - I just decided that I have a tendency to complicate everything. I'll let someone else answer this. I doubt mu sugestion would have worked properly, anyway. Sorry about that, Geof.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

strazer

#12
Works for me, redruM.
Here's what I did:



Player walks onto region:
SetWalkBehindBase(1, 240); // Player always behind walkbehind

Player walks off region:
SetWalkBehindBase(1, 0); // Player always in front of walkbehind

EDIT: Oh, for two characters?

Well, then. How about the setup above and

Code: ags

// room script

#define WALKBEHINDBASE 170 // Y-coordinate of diagonal walkbehind baseline

function repeatedly_execute_always () {

  int charid = 0; // start with character 0
  while (charid <= GetGameParameter(GP_NUMCHARACTERS, 0, 0, 0)) { // loop for each character
    if (character[charid].room == character[GetPlayerCharacter()].room) { // if character is in the current room
      if (GetRegionAt(character[charid].x, character[charid].y) == 1) // if character stands on region 1
        SetCharacterBaseline(charid, 0); // reset character's baseline, i.e. behind walkbehind
      else // if character does NOT stand on region 1
        SetCharacterBaseline(charid, WALKBEHINDBASE + character[charid].y);
          // set character's baseline in front of walkbehind, but behind other characters
      charid++; // loop to next character
    }
  }

}


instead?
It's a bit clumsy, but I don't know how else to do it.

The manual states the maximum value of SetCharacterBaseline as the room height. Seems to work ok though.

Edit 2:

Updated code, still haven't tested it.

Kweepa

I did something like this in IIISpy in the jail cell.
Dog character on one side, bars object in middle, player on the other side.
Worked fine.
Still waiting for Purity of the Surf II

Gregjazz

Oh, never mind, I got the diagonal fences working!

strazer

So what's your solution to the problem?

Rui 'Trovatore' Pires

(not that the fact that Geof has found a way around it, and so can we all, means that it wouldn't be REAL useful to have diagonal walkbehind baselines... ::) ::) ::)
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gregjazz

By manipulating the character baselines when they are in a certain area. What you do is put the baseline for the walkbehind to like 2, and then when a character is not behind the walkbehind, it sets the character baseline to 0 (0 sets the baseline to the default). When a character goes behind the baseline, it sets his baseline to 1, therefore putting him behind the walkbehind.

strazer

Ah, ok. Mine is just reversed with characters overlapping correctly when they're both in front (or behind in your case).

SMF spam blocked by CleanTalk