AGS 3.1.2 SP1 now released!

Started by Pumaman, Tue 03/02/2009 20:07:56

Previous topic - Next topic

InCreator

I'm getting this:

Quote
Error: Object reference not set to an instance of an object.
Version: AGS 3.1.2.79

System.NullReferenceException: Object reference not set to an instance of an object.
   at AGS.Editor.frmMain.FindPropertyGridItemForType(String fullTypeName)
   at AGS.Editor.frmMain.tabbedDocumentContainer1_ActiveDocumentChanged(ContentDocument newActiveDocument)
   at AGS.Editor.TabbedDocumentContainer.SetActiveDocument(ContentDocument pane, Boolean updatePaneOrder)
   at AGS.Editor.TabbedDocumentContainer.tabsPanel_MouseUp(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

It's really strange, I imported a sprite and assigned to a view, after switching sprite and view tabs, AGS tried to replace the sprite with cup and failed at that too somehow.

Now, whenever I look at sprite editor, this message pops up first always. I deleted problematic sprite, it's not used in any views neither, but message keeps occuring.

I have no clue why. There's also nothing but few sprites, original 2 views and a room in my game.

Pumaman

Quote from: InCreator on Sat 07/02/2009 21:34:32
I'm getting this:
Error: Object reference not set to an instance of an object.
Version: AGS 3.1.2.79

Yep, this has already been reported here:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36804.0

Once I get some feedback from rvampire (or anyone else) to confirm whether there is indeed a problem with Theora aspect ratios or not, I'll release an update to fix it.

rvampire

Here's the image from 3.1.1 (correct aspect ratio):



And here's the same video on 3.1.2:



The script line that plays the video:

PlayVideo("pool.ogv",eVideoSkipEscKey, 0);

And for testing the video can be found at:

http://students.osao.fi/~b7kujo01/pool.ogv (Its about 6 Mb)

I hope this is helpful!

Pumaman

Thanks for posting the details.

Looking at this further, it actually seems like it was a bug in 3.1.1, and 3.1.2 is now behaving correctly.

The video file is 720x576 -- so if you pass the FLAGS in as 0 it should play in a 720x576-sized box in the middle of the screen. This is what is happening in your second screenshot.

If you pass the FLAGS in as 1, it should stretch to full-screen with letterbox borders.

It looks like there was a bug in 3.1.1 where it was stretching the video even when you didn't ask it to. Change the 0 to 1 and it should play correctly for you. Please let me know if this sorts out the problem.

Pumaman

Quote from: InCreator on Sat 07/02/2009 21:34:32
I'm getting this:
Error: Object reference not set to an instance of an object.
Version: AGS 3.1.2.79

Ok, a new build has been uploaded (this is now version 3.1.2.80). Hopefully this is the final, final release of 3.1.2 and I'm not intending to make any further changes unless a very serious problem is found.

Shane 'ProgZmax' Stevens

Backwards compatibility for games made with 3.1 (before the dialog scripting change) still has some problems.

If the return/stop command is called inside a dialog script that has one or more calls to the dialog_request function it generates a warning that the return/stop will be ignored (which isn't desirable):
QuoteThe command 'return' will be ignored since the script for this option has already finished
QuoteThe command 'stop' will be ignored since the script for this option has already finished

If a dialog_request call is made it generates the following error:

QuoteError (line 2497): Variable 'dialog_request' is already defined

While I understand that the new method of making dialogs is superior, I think backwards compatibility for importing purposes should still hold, right?

Pumaman

Quote from: ProgZmax on Sun 08/02/2009 16:34:52
If the return/stop command is called inside a dialog script that has one or more calls to the dialog_request function it generates a warning that the return/stop will be ignored (which isn't desirable):

I'm not sure what you mean. I tried a run-script followed by a return, but it didn't generate any warnings for me.

QuoteIf a dialog_request call is made it generates the following error:
Error (line 2497): Variable 'dialog_request' is already defined

Again, I'm not sure what you mean here. Can you post a sample script that causes these problems?

rvampire

Quote from: Pumaman on Sun 08/02/2009 14:01:00
The video file is 720x576 -- so if you pass the FLAGS in as 0 it should play in a 720x576-sized box in the middle of the screen. This is what is happening in your second screenshot.

If you pass the FLAGS in as 1, it should stretch to full-screen with letterbox borders.

It looks like there was a bug in 3.1.1 where it was stretching the video even when you didn't ask it to. Change the 0 to 1 and it should play correctly for you. Please let me know if this sorts out the problem.


Yes, it works correctly now. Thank you! Though shouldn't the engine play the video at right shape regardless of flags? The pixel aspect ratio on that file is not 1:1 (they're not square pixels like the rest of the graphics) but rather closer to 1:1.78 (like in wide-screen DVD). So even with no resizing it still should be stretched to 1024x576, or have I understood something wrong?

Shane 'ProgZmax' Stevens

#28
It's the function call itself that generated that Variable 'dialog_request' error.  The game I imported was built in ags 3.0 without warnings or errors, and when I imported it into this version that error (and the warnings) occurred.  

I think the problem is as follows:

Earlier versions of ags (including 3.0) allowed you to create the dialog_request function yourself (along with the name of the integer you were passing) so my call looked like this in 3.0:

Code: ags

int dialog_request(int value)
{

}


However, it seems that the newer ags doesn't recognize this call and insists it has already been created.  Oddly enough, I sort of confirmed this by commenting out my dialog_request and recompiling, which creates the following at the bottom of my Globalscript.asc (you can only see it if you close and reopen the script):

Code: ags

int dialog_request(int param){
}


If I delete this auto-generated version and un-comment mine I get the same error.  I must stress that this happens every time.  It simply refuses to recognize my dialog_request function even if I change 'int value' to 'int param' so they are identical.  The solution seems to be (for now) to comment out any pre-existing dialog_request function, compile, then move all data to the one generated at the bottom of the globalscript (though I think we'll agree this should be changed?).  I've quadruple checked my code (which compiles fine under ags 3.0) and sure enough, if I have a pre-existing dialog_request call it will generate this error every time.  If I comment it out, for some reason ags generates a dialog_request function at the bottom of globalscript which can be used.


As for the warnings, I found the source of that problem.  In earlier releases, AGS did not generate a warning if you used a goto command before return or stop (I use return and stop just to bracket out lines in dialogs for safety and to be consistent) and now it generates warnings.  Commenting them out seems to take care of that particular issue.




Edit:  I've also confirmed that this issue does not occur with games made with 3.1.  I commented out the empty dialog_request call at the bottom of one of my new games, compiled, and re-added it to the top with some random junk in it and it compiled fine.  I'm sending you my imported game (the one with the problem) so you can see what's going on.


mikosworld

>>I'm not really sure what you're asking ... are you asking for the Media Manager to be built into AGS itself?
Yes Pumaman, Media Manager Module like, to better manage the resources ...

Pumaman

Quote from: rvampire on Mon 09/02/2009 06:42:32
Yes, it works correctly now. Thank you! Though shouldn't the engine play the video at right shape regardless of flags? The pixel aspect ratio on that file is not 1:1 (they're not square pixels like the rest of the graphics) but rather closer to 1:1.78 (like in wide-screen DVD). So even with no resizing it still should be stretched to 1024x576, or have I understood something wrong?

AGS doesn't really deal in aspect ratios, just in pixels. So because the video is 720x576, it will just treat them as square pixels, because it currently doesn't have any concept of non-square pixels.

QuoteEarlier versions of ags (including 3.0) allowed you to create the dialog_request function yourself (along with the name of the integer you were passing) so my call looked like this in 3.0:

int dialog_request(int value)
{

}

Ah, this is because you've used "int". It should be "function", like this:

function dialog_request(int value)
{
}

The 3.1.1 editor checks if there is a "function dialog_request" in the script, and if not adds an empty one automatically. Because you used "int", this check fails and it adds a duplicate, empty function leading to the error.

Just change "int" to "function" and that will fix it.

Shane 'ProgZmax' Stevens

You're right, obviously.  Don't know why I didn't see that before!

I still think this is bound to cause trouble for people importing from earlier versions, though (as it did for me).

Gilbert

Well, CJ, this reminds us of one thing, that we should be more careful when answering people's problems.

Often times, when people asked about how to handle return types different from 'int' we will answer like this:

When you want to have a function return a, say, 'float' variable, we just need to substitute the word 'function' by 'float', so it will read "float blah(){ ..." and this function blah() will have return type 'float'.
As the default return type for a function is 'int', defining a function with "function bla(){ ..." is actually the same thing as writing "int blah(){...", blah bla bla

I thought this will be easier for people to understand (as otherwise they can easily be misled to writing something like "float function(){ ..." that some language structures adopt) and writing "int blah(){ ..." should be safe for functions that are only handled by the script interpreter (i.e. all user custom-defined functions)
Sometimes, when there are many functions with different return types involved we may want to change all instances of 'function' to 'int' so that we can see more clearly what return type each function uses. We see now that abusing the interchangeability of 'int' and 'function' in this way may cause troubles, that if we carelessly change 'function' to 'int' for events that are handled by the editor we may get an error that is hard to track.

SSH

Well, the non-urgent fix is that perhaps the compiler should check for function dialog_request OR int dialog_request in the next version of AGS, but I think its not necessary for there to be a 3.1.2R4, really.
12

Electroshokker

Just a (minor) bug I found, the StopMusic() command is no longer working. (The music continues to play happily)

Using the StopChannel(0); command as a workaround does function, though.

Using AGS 3.1.2 (R3), dunno if the bug was introduced earlier.

Pumaman

QuoteI still think this is bound to cause trouble for people importing from earlier versions, though (as it did for me).

It might do, but I think 99% of people will have copy & pasted the "function dialog_request" out of the demo game or manual, it's unlikely many will have manually changed it to "int".

Still, at least we know what the cause is if anyone else reports this problem.

QuoteWell, CJ, this reminds us of one thing, that we should be more careful when answering people's problems.

Well yeah -- really, it's just laziness on my part for the 3.1.1 editor not recognising the "int" possibility. I might go back and fix it later, but it's not a high priority since it's very unlikely to occur and the workaround is so simple.

QuoteJust a (minor) bug I found, the StopMusic() command is no longer working. (The music continues to play happily)

Using the StopChannel(0); command as a workaround does function, though.

StopMusic works fine for me, can you provide more details? What type of music (OGG/MP3/MIDI/etc) are you using? Is crossfading enabled? Does it never work, or is it only one particular music file that won't stop?

Electroshokker

Quote from: Pumaman on Tue 10/02/2009 22:23:29
QuoteJust a (minor) bug I found, the StopMusic() command is no longer working. (The music continues to play happily)

Using the StopChannel(0); command as a workaround does function, though.

StopMusic works fine for me, can you provide more details? What type of music (OGG/MP3/MIDI/etc) are you using? Is crossfading enabled? Does it never work, or is it only one particular music file that won't stop?


type: OGG
crossfading: fastfade

And upon further inspection, it is indeed only one particular music file that won't stop. (music1.ogg, I start it upon entry of room 1, when leaving room 1 I try to stop it.)

SSH

I've noticed that if you import a cha file and it has footsteps assigned, but you have no sounds in your sound folder it will sometimes use ANY sound in your sound folder even with a different number. Also, if you remove the sounds from the folder (up a dir to the game folder) and re-test the game, it still manages to play the sounds!

It would be nice to have a global ability to disable footstep sounds temporarily
12

Pumaman

Quotetype: OGG
crossfading: fastfade

And upon further inspection, it is indeed only one particular music file that won't stop. (music1.ogg, I start it upon entry of room 1, when leaving room 1 I try to stop it.)

Can you use the debugger or a Display command just to check that the bit of script with the StopMusic in it is actually being run?

QuoteI've noticed that if you import a cha file and it has footsteps assigned, but you have no sounds in your sound folder it will sometimes use ANY sound in your sound folder even with a different number.

Do you mean that the Sound numbers on the view frames are being imported wrongly, or that the sound numbers in the views are correct but they are not playing the right sound in the game? I can't reproduce any problems with this, can you provide a sample game or CHA file that demonstrates the problem?

QuoteAlso, if you remove the sounds from the folder (up a dir to the game folder) and re-test the game, it still manages to play the sounds!

Hmm yeah, when testing the game I suppose it should check the Compiled folder rather than the game folder for these files. I'll have a think about whether to change this.

Electroshokker

Quote from: Pumaman on Wed 11/02/2009 18:42:13
Quotetype: OGG
crossfading: fastfade

And upon further inspection, it is indeed only one particular music file that won't stop. (music1.ogg, I start it upon entry of room 1, when leaving room 1 I try to stop it.)

Can you use the debugger or a Display command just to check that the bit of script with the StopMusic in it is actually being run?

It's being run alright. (it's in an on_click of a hotspot, all the other actions run just fine)

---------------------------------

Another bug I've noticed (dunno if this one is known or not):

When using the following commands in a row:

Code: ags


object[3].Animate(5, 0, eOnce, eBlock, eForwards);
gInventory.Visible = true;
gInvUnderlay.Visible = true;
Display("This is your inventory. Right-click or press TAB to access it.");



The display message gets shown, but the gui does NOT pop up!

I've replicated this error countless times to eventually break it down to these 4 lines.
Upon further examination, it appears that if you only make 1 gui visible, it will show up, but AFTER the display message. If you make both visible, neither will show up. (Though placing the same code in other places seems to trigger the initial problem, that of the gui showing up AFTER the display message)

If I remove the animate line everything works as it should.

SMF spam blocked by CleanTalk