AGS v2.62 Final available for testing

Started by Pumaman, Sun 18/07/2004 21:35:34

Previous topic - Next topic

Grundislav

Something got messed up with the new beta.  Here's the deal:

In lieu of messing with SetViewport and all that to make the screen scroll, I had an invisible character called "scroller" who would move and scroll the screen. The script went something like this:

SetCharacterViewEx(BEN,53,4,ALIGN_LEFT);
NewRoomNPC(SCR,13,374,128);
AnimateCharacter(BEN,4,4,1);
SetPlayerCharacter(SCR);
Wait(20);
MoveCharacterBlocking(SCR,90,128,1);
ObjectOn(1);
Wait(1);
DisplayMessage(17);
ReleaseCharacterView(BEN);
NewRoomNPC(BEN,19,155,147);
MoveCharacterBlocking(SCR,332,128,1);
Wait(20);
EndCutscene();
SetPlayerCharacter(BEN);

So, while the animation is playing, the room scrolls, then comes back, etc. It was working fine till I got the latest beta.  I checked in the debug console and it says that SCR starts moving, but then nothing happens. The screen doesn't scroll, the animation keeps playing, and when I hit esc to bypass the cutscene, the game hangs.

Goldmund

#81
The "depending on x" speech option works very fine; indeed, there is a little confusion at the beginning of dialogues, but it quickly comes to order. I understand why it cannot be perfect when there are more than two characters in a room. But is it possible to "make it" so that when there are only two then the x-position sets the portrait position from the start? It's not very relative then.

PLUS:

There's an error in this edition. My game shows close-ups of inventory items when you "look" at them, with such script:
int overlay_id;
overlay_id=CreateGraphicOverlay(110,5,963,1);
wait_mouse();
RemoveOverlay(overlay_id);

And, it worked in previous versions. In this beta it shuts down and announces "Error: Too many events posted."

Pumaman

Quote from: Grundislav on Thu 16/09/2004 04:01:18
Something got messed up with the new beta. Here's the deal:

Which version were you using prior to this?
Also, what is the current room at the start of that script?

The easiest way to resolve this might be if you could upload the game for me to take a look at.

QuoteThe "depending on x" speech option works very fine; indeed, there is a little confusion at the beginning of dialogues, but it quickly comes to order. I understand why it cannot be perfect when there are more than two characters in a room. But is it possible to "make it" so that when there are only two then the x-position sets the portrait position from the start? It's not very relative then.

Good point, well made... I'll do that.

QuoteAnd, it worked in previous versions. In this beta it shuts down and announces "Error: Too many events posted."

Hmm, what does your  wait_mouse  function do?

Goldmund

#83
function wait_mouse() {
while (IsButtonDown(LEFT)==0)
Ã,  {Wait(0);}
}

P.S.
Quote
QuoteThe "depending on x" speech option works very fine; indeed, there is a little confusion at the beginning of dialogues, but it quickly comes to order. I understand why it cannot be perfect when there are more than two characters in a room. But is it possible to "make it" so that when there are only two then the x-position sets the portrait position from the start? It's not very relative then.
Good point, well made... I'll do that.

Now I think of it, maybe it would be even more sensible if just the player character's x was the basis for the positioning? Portraits of characters with x lower than the EGO's appear on the left, portraits of those with higher x on the right? What do others think?

Pumaman

Quotefunction wait_mouse() {
while (IsButtonDown(LEFT)==0)
  {Wait(0);}
}

Does the error occur when you do something (eg. click mouse, press key) or does it just happen in the middle of the cutscene?

QuoteNow I think of it, maybe it would be even more sensible if just the player character's x was the basis for the positioning? Portraits of characters with x lower than the EGO's appear on the left, portraits of those with higher x on the right? What do others think?

That's a possibility, but then would EGO's portrait go on the left or right? I think your previous suggestion of basing it on the other character in the room, if there are two, would probably work better.

Gregjazz

Wow freakin' wow! CJ's on a roll. Thanks!

Rui 'Trovatore' Pires

Well, I haven't tried this new one yet, but it's a safe bet the bug I'm reporting hasn't been fixed - it's happened before...

Some people have told me about an error in my Larry 2 in the dock scene, and the error message let them to line... er, I disremember which, but I believe it was 497. Well, the error made no sense, so I left it. I eventually found out that the problem WAS in that script, but in SOME OTHER LINE.

And now it happened again, backuped for your vieweing pleasure - just ask. The problem is, I was told that there was a problem with line 497 of room 3. But, there's only 41 lines of code in that room! And the problem code was 35.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

If a room script calls a function imported from the global script, and then the error occurs in that function, you'll get the line number from the global script, but it'll say it occured in the Room Script.

This is a known issue and is probably what's happened here.

So, does checking line 497 of the global script give you any clues? What was the error message?

Rui 'Trovatore' Pires

The Global script was only about 250 lines big... ::) and the mistake was in line 35 of room 3. It was because I had done a MoveObject with object 4, which does not exist. And the function was a normal one from the room's interaction editor.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Goldmund

Quote from: Pumaman on Sat 18/09/2004 16:16:34
Quotefunction wait_mouse() {
while (IsButtonDown(LEFT)==0)
Ã,  {Wait(0);}
}
Does the error occur when you do something (eg. click mouse, press key) or does it just happen in the middle of the cutscene?

No, I don't believe that the overlay even shows. In a game compiled with this version I click "look" on inventory item, which has so far displayed an overlay, and immediately I get the error.

Gilbert

#90
But but but Goldmund, why're you using Wait(0); ?

If you want to wait, it should at least be Wait(1);, it's not documented what will happen if it's 0, though most probably it will do nothing (so your code will become an "infinite" loop), you can expect problems with it as it's not in offifially supported range.


Quote from: Pumaman on Sun 18/07/2004 21:35:34
* Added GIF image import, and Quick Import Animated GIF Frames option.

Yay! :D Hope that it won't be as buggy as the old one!

edmundito

Quote* Added GIF image import, and Quick Import Animated GIF Frames option.

Shiver me timbers! How in the name of LeChuck did ye get such a lass feature without Compuserve GIF pirates plundering yar booty?

Goldmund

Quote from: Gilbot V7000a on Mon 20/09/2004 03:22:49
But but but Goldmund, why're you using Wait(0); ?
If you want to wait, it should at least be Wait(1);, it's not documented what will happen if it's 0, though most probably it will do nothing (so your code will become an "infinite" loop), you can expect problems with it as it's not in offifially supported range.

STFU NOOB!!!11!

...

Um, I changed it to 1 and it works now.
I don't even remember why I put a zero there, it was so long ago.  Apparently this edition is more anal about rules and codes...

Tehe, Thanks, Gilborobot!

Pumaman

QuoteShiver me timbers! How in the name of LeChuck did ye get such a lass feature without Compuserve GIF pirates plundering yar booty?

The GIF patent expired in June this year, so it's finally free of all legal hassles.  :D

QuoteUm, I changed it to 1 and it works now.
I don't even remember why I put a zero there, it was so long ago.  Apparently this edition is more anal about rules and codes...

That's strange, I'll fix it to warn you if you use Wait(0) because it's not really a valid thing to do, anyway.

Gilbert

Quote from: Pumaman on Mon 20/09/2004 20:31:00
That's strange, I'll fix it to warn you if you use Wait(0) because it's not really a valid thing to do, anyway.

Hmmm I think you'll put it as a run-time warning for the engine right? If it's just careless mistake like typing Wait(0) in the script a warning is okay, but there're circumstances that the 0 is the evaluated result of an expression, which you really expect it to be 0 sometimes, where you don't want it to wait.
For example,
Wait(SomeFunction());

Of course, you can always do the following, but it's just a bit long:
waitloops=SomeFunction();
if (waitloops>0) Wait(waitloops);

But as 0 is not in officially supported range of Wait() (unless it's changed), I think adding a warning is not a bad idea, either.

Phemar


I know I'm not supposed to post suggestions here, but before you release this version CJ could you please add the option to set the color in dialog bixs, instead of it being the players talking color.

I really need this, thanks.

Pumaman

Quote from: Gilbot V7000a on Tue 21/09/2004 02:26:59
Hmmm I think you'll put it as a run-time warning for the engine right? If it's just careless mistake like typing Wait(0) in the script a warning is okay, but there're circumstances that the 0 is the evaluated result of an expression, which you really expect it to be 0 sometimes, where you don't want it to wait.

Hmm, good point. Should Wait(0) just do nothing, or should it give an error?

Because the current behaviour (where it actually waits 1 loop) is neither of these, I would hope nobody is actually using this deliberately.

monkey0506

Wow... This is awesome. Alt+X now turns on my quit GUI! THANKS! (And sorry for my anality (is that a word?))  :P  But I think I may have a problem. I'm not sure, and don't have time to look too deeply into it, and don't have time to provide an example script, but I think there may be a problem with GetButtonPic. I'm realized that the buttons (for those who have been helping me with cursor control...) are supposed to be highlighted as soon as the cursor is moved over them. I tried:

(ok, so I lied...)
Code: ags
  if ((GetGUIAt(mouse.x, mouse.y)==MAIN) && (GetGUIObjectAt(mouse.x, mouse.y)>=1) && (GetGUIObjectAt(mouse.x, mouse.y)<=9)){
    SetButtonPic(MAIN, GetGUIObjectAt(mouse.x, mouse.y), 1, GetButtonPic(MAIN, GetGUIObjectAt(mouse.x, mouse.y), 1));
    }


but it returned some odd pictures. Not sure if it's a bug or just me... I have to go...

Gilbert

#98
Quote from: Pumaman on Tue 21/09/2004 22:27:43
Hmm, good point. Should Wait(0) just do nothing, or should it give an error?
Because the current behaviour (where it actually waits 1 loop) is neither of these, I would hope nobody is actually using this deliberately.
I think that's not very imoportant as long as the behaviour is documented clearly in the manual. (though I myself expect it to do nothing more).


Quote from: monkey_05_06 on Tue 21/09/2004 22:53:54
...but I think there may be a problem with GetButtonPic. I'm realized that the buttons (for those who have been helping me with cursor control...) are supposed to be highlighted as soon as the cursor is moved over them. I tried:

(ok, so I lied...)
Code: ags
Ã,  if ((GetGUIAt(mouse.x, mouse.y)==MAIN) && (GetGUIObjectAt(mouse.x, mouse.y)>=1) && (GetGUIObjectAt(mouse.x, mouse.y)<=9)){
Ã,  Ã,  SetButtonPic(MAIN, GetGUIObjectAt(mouse.x, mouse.y), 1, GetButtonPic(MAIN, GetGUIObjectAt(mouse.x, mouse.y), 1));
Ã,  Ã,  }


but it returned some odd pictures. Not sure if it's a bug or just me... I have to go...
Monkey, I think it's not the problem of GetButtonPic(), I don't know what you're going to archieve with your codes, as what I see is that it would do nothing (it'll just change the normal button pic to the current normal button pic.).
If you want a button to use different pic when highlighted, just set it in the editor (Mouseover image), the engine will change the button pic automatically without the need of any scripting, you should SetButtonPic() only when you want to do something the engine doesn't handle automatically (like for example you want the button to change to something else after some point in the game).

monkey0506

Oh yes... I knew there was an easier way. I just didn't remember it. But I tried using GetButtonPic(...)+9 and that's what returned wierd pictures, but only on a mouse click (I would click, then the picture would change, and not change back). Thanks for pointing out my stupidity. Man, I wish I had thought that through first... It's so obvious... ARG!

SMF spam blocked by CleanTalk