Author Topic: AGS 3.4.0.5 (Alpha) - June Patch  (Read 14991 times)  Share 

Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #280 on: 17 Jul 2015, 17:19 »
v3.5.0.5 gives a pretty confusing error message on;

import int[] testfunction();

//---

int[] testfunction(){
  int Array[];
  Array=new int[2];
  return Array;
}

and the message is that it can not convert a dynamic array in a dynamic array of the same type.


-----

i have not figured out if there is any fast way to get the length of a dynamic array.
so far i always add ine integer, always being set to the array length of another dynamic array of the same struct. this i not too efficient.

-----

i have not figured out if there is any way to give any type of dynamic aray to any type of function as a function parameter. i assume there is none, except for having a dynamic array in the struct to directly paste to and have the function read this.DynamicArrayParameter from

-----


and i really want dynamic arrays to be able to be put inside of managed structs.
« Last Edit: 17 Jul 2015, 17:25 by ollj »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #281 on: 17 Jul 2015, 17:34 »
v3.5.0.5 gives a pretty confusing error message on;

import int[] testfunction();

//---

int[] testfunction(){
  int Array[];
  Array=new int[2];
  return Array;
}

and the message is that it can not convert a dynamic array in a dynamic array of the same type.

I do not get any errors from this script. Does the error message reference the line inside this function?
Could you show how you use this function? (and copy the actual error message text?)

-----

i have not figured out if there is any fast way to get the length of a dynamic array.
There is no way to do this in AGS script now, except for storing additional variable with length value.

i have not figured out if there is any way to give any type of dynamic aray to any type of function as a function parameter.

Like this:
Code: Adventure Game Studio
  1. import void try_this(int a[]);
  2. ------------------------------
  3. void try_this(int a[])
  4. {
  5.   a[0] = 1;
  6. }
  7. ------------------------------
  8. void test()
  9. {
  10.   int a[] = new int[10];
  11.   try_this(a);
  12.   Display("%d", a[0]);
  13. }
  14.  


and i really want dynamic arrays to be able to be put inside of managed structs.
This is in development plans for the future version.
« Last Edit: 17 Jul 2015, 17:37 by Crimson Wizard »

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
  • Khris worked on a game that was nominated for an AGS Award!
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #282 on: 21 Jul 2015, 13:54 »
I just tried to run a game on Linux and got this:
Quote
AGS: Requested engine version: 3.4.0.5
This game requires a newer version of AGS (3.4.0.5). It cannot be run.Invalid file format. The file may be corrupt, or from a different version of AGS.
This engine can only run games made with AGS 2.5 or later.

(I also had to set the execute permissions manually.)

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #283 on: 21 Jul 2015, 14:08 »
I just tried to run a game on Linux and got this:
Quote
AGS: Requested engine version: 3.4.0.5
This game requires a newer version of AGS (3.4.0.5). It cannot be run.Invalid file format. The file may be corrupt, or from a different version of AGS.
This engine can only run games made with AGS 2.5 or later.

(I also had to set the execute permissions manually.)

I forgot to update linux binaries again. :(
Try the ones made by monkey0506: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51050.msg636517051#msg636517051

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
  • Khris worked on a game that was nominated for an AGS Award!
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #284 on: 21 Jul 2015, 14:37 »
Thanks, that did it!

Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #285 on: Yesterday at 17:04 »
Code: Adventure Game Studio
  1. //this is mostly resolved, and only about a confusing compiler error message...
  2. //...on returning an array of a managed struct from a (static) function:...
  3. //"Can not convert 'DynamicSprite[]' to 'DynamicSprite[]'  "
  4. //...and like many compiler errors, this is not only confusingly fuzzy, ...
  5. //...but this one is a straight out nonsensical logic response to throw at anyone.
  6.  
  7. //this requires AGS version 3.4.0.3 (alpha 3) or higher (due to dynamc arrays)
  8.  
  9. //as an example i have this function that produces the error...
  10. //...this static function wants to merge 2 arrays of DynamicSprite[] (as part of a struct for such functions):
  11.  
  12. struct ArrDyn{};// a struct-set to group static array-functions for DynamicSprite*[] into.
  13.  
  14. ///Returns DynamicSprite*[0..LengthLeft+LengthRight] of LeftSmall[0..LengthLeft] having RightLarge[0..LengthRight] merged to its right, changing all #indizies of RightLarge[#] to #+=LengthLeft.
  15. import DynamicSprite*[] Merge2Dyn(static ArrDyn, DynamicSprite *LeftSmall[], DynamicSprite* RightLarge[], int LengthLeft=1,  int LengthRight=1);
  16.  
  17. //end of header // start of body//
  18. //end of header // start of body//
  19.  
  20.  
  21. DynamicSprite[] Merge2Dyn(static ArrDyn, DynamicSprite *LeftSmall[], DynamicSprite *RightLarge[],
  22.                                               int LengthLeft,             int LengthRight){
  23.   DynamicSprite *r[];//set merged array for return value.
  24.   r=new DynamicSprite[LengthLeft+LengthRight];
  25.   while(LengthRight){//copy LeftSmall[] to r[]
  26.     LengthRight--;
  27.     r[LengthLeft+LengthRight]=LeftSmall[LengthRight];
  28.   }
  29.   while(LengthLeft){//copy RightLarge[] to r[]
  30.     LengthLeft--;
  31.     r[LengthLeft]=LeftSmall[LengthLeft];
  32.   }
  33. return r;}//on the return call the compiler cries:
  34. //Can not convert 'DynamicSprite[]' to 'DynamicSprite[]'  //--tehehe
  35.  
  36. //i reported this before. but my example was flawed, possibly by not using a MANAGED struct array in my previous example.
  37. //i think it makes a difference if its a managed struct, like DynamicSprite, or a (non-managd) struct.
  38. //the compiler is however fine with this correct example, only replacing:...
  39. //DynamicSprite[] Merge2Dyn
  40. //...with...
  41. //DynamicSprite*[] Merge2Dyn
  42. //...which is possibly unneccessarily confusing in your script syntax to even make an explicit  difference here.
  43.  
  44. DynamicSprite*[] Merge2Dyn(static ArrDyn, DynamicSprite *LeftSmall[], DynamicSprite *RightLarge[],
  45.                                               int LengthLeft,             int LengthRight){
  46.   DynamicSprite *r[];//set merged array for return value.
  47.   r=new DynamicSprite[LengthLeft+LengthRight];
  48.   while(LengthRight){//copy LeftSmall[] to r[]
  49.     LengthRight--;
  50.     r[LengthLeft+LengthRight]=LeftSmall[LengthRight];
  51.   }
  52.   while(LengthLeft){//copy RightLarge[] to r[]
  53.     LengthLeft--;
  54.     r[LengthLeft]=LeftSmall[LengthLeft];
  55.   }
  56. return r;}
  57.  
« Last Edit: Yesterday at 17:11 by Crimson Wizard »

Gurok

  • Rottwheelers
  • Losing hair.
    • I can help with AGS tutoring
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #286 on: Yesterday at 17:13 »
It seems like you worked out that the return type had to be DynamicSprite *[]. Was that entire post just to say that the error message was confusing or did I miss the point? I'm confused by your post, to be honest.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #287 on: Yesterday at 17:16 »
Ollj, I took a responsibility and added code formatting to your post, because you posted both comments and script as a plain text, making it pretty difficult to read.

Please, when you post code samples, use [ code=ags ] [ /code ] tags to make them stand-out.


From what you say I understood that:
1. You actually solved the problem you were having(?).

2. AGS compiler produces confusing error message on trying to return DynamicSprite *r[] as DynamicSprite[] (it names both types as "DynamicSprite[]".
This is indeed a mistake, which I will add to our bug tracker.

3. AGS syntax on declaring array of managed pointers is confusing. Possibly that is because you create the array as
Code: Adventure Game Studio
  1. new DynamicSprite[N]
  2.  
and not as
Code: Adventure Game Studio
  1. new DynamicSprite*[N]
  2.  
Which I have to agree. But that is a legacy issue that is many years old, and I doubt it will change in nearest future (not to break compatibility with existing scripts).
« Last Edit: Yesterday at 17:23 by Crimson Wizard »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
Re: AGS 3.4.0.6 (Alpha) - Builder Patch
« Reply #288 on: Today at 07:49 »
NOTE: I want to split this thread to make it easier for forum users to see new alpha releases.
Will try to do this later today.
NOTE2: this package does not have "Linux" binaries at the moment. I will update the package with them included a bit later.


AGS 3.4.0.6 (Alpha) - Builder Patch

ZIP-archive:
http://www.mediafire.com/download/8xw5wv5bs95jrie/AGS_3.4.0.6-Alpha-BuilderPatch.zip

Debug symbols (for developers):
http://www.mediafire.com/download/jwu9jg3hm0bwlmo/PDB_3_4_0_6.zip


This update is mainly dedicated to fixing most annoying bugs and oversights related to new game compilation, as well as custom resolutions.
Includes all content from 3.3.4.


Changes since 3.4.0.5:

Editor
Improvements
* Better descriptions of Resolution property values for Sprite and Room.

Bug Fixes
* Fixed sprite, font and room background size issues occuring if the game native resolution had one parameter higher and another smaller than 320x240 (e.g. 400x200).
* Fixed graphics renderer selection in config was reset to default game's property every time the game was recompiled.
* Fixed game configs were not updated with the new game builder when game native resolution, color depth and title were modified.
* Fixed Debugging game did not use proper configuration with the new game builder.
* Fixed custom icon was not integrated into the compiled game.


Scripting
Improvements
* Added support for "switch" statement. Strings and other variable types are allowed to be checked in switch condition.
Standard case statement features like fallthrough and break are also supported.

Example:
Code: Adventure Game Studio
  1. String x = "a";
  2.  
  3. switch(x)
  4. {
  5. case "a":
  6.     Display("X is A");
  7. case "b": // fall-through
  8.     Display("X is B");
  9.     break;
  10. case "c":
  11.     Display("X is C");
  12. case "d": // fall-through
  13. default: // fall-through
  14.     Display("X is D");
  15. }
  16.  

Bug Fixes
* Fixed compiler crash related to using global variables in "for" loop header.
* Fixed incorrect compiler parsing of a static function call inside array index brackets.
E.g:
Code: Adventure Game Studio
  1. int i = array[Game.GetColorFromRGB(0, 0, 0)]; // there was parse error after '['
  2.  


Engine
Improvements
* Engine ignores "match_device_ratio" config parameter and never tries to match device aspect ratio when initializing display mode, if the latter is defined explicitly ("screen_def=explicit" in the config file).


WinSetup
Improvements
* Added an option to choose full-screen resolution based on scaling filter.



"Bind to game scaling" means that engine should try choosing display mode equal to scaled game's size.
"Bind to game scaling (force desktop ratio" means that engine will look into first display mode equal or higher than scaled game's size, that has same aspect ratio as your current desktop resolution.

« Last Edit: Today at 08:03 by Crimson Wizard »

cat

  • Mittens Baronet
  • AGS Baker
  • Wagahai wa Neko de aru
  • cat worked on a game that was nominated for an AGS Award!
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #289 on: Today at 09:02 »
* Fixed custom icon was not integrated into the compiled game.
Awesome, thanks!

"Bind to game scaling" means that engine should try choosing display mode equal to scaled game's size.
"Bind to game scaling (force desktop ratio" means that engine will look into first display mode equal or higher than scaled game's size, that has same aspect ratio as your current desktop resolution.
I don't really understand what this means and I don't think the average player will know. The setup is much smaller and less complicated now compared to previous versions. However, I think it's still too difficult to understand for most players.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #290 on: Today at 09:11 »
"Bind to game scaling" means that engine should try choosing display mode equal to scaled game's size.
"Bind to game scaling (force desktop ratio" means that engine will look into first display mode equal or higher than scaled game's size, that has same aspect ratio as your current desktop resolution.
I don't really understand what this means and I don't think the average player will know. The setup is much smaller and less complicated now compared to previous versions. However, I think it's still too difficult to understand for most players.
This means that display resolution will be equal to (game size X scaling), and you do not have to choose precise resolution, just choose filter and scaling value.
I am open for suggestions to how improve this or name it in a more clear way. I felt I had to add this in last minute to provide all variety of choices in setup dialog.

E: Actually, I think I will have to change the setup window again on later stages.
« Last Edit: Today at 12:01 by Crimson Wizard »

Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #291 on: Today at 15:58 »
I think i got it :

Bind to game scaling : if desktop res. is 1920*1080 and scaled game size is 1440*900, the engine set the resolution to 1440*900, as it is already available resolution for the graphic card.
Bind to game scaling (force desktop ratio) : if desktop ratio is 16:9 and the scaled game ratio is 16:10, the engine set the ratio to 16:9.

Do i understand correctly ? :)
Proximity Entertainment

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
Re: AGS 3.4.0.5 (Alpha) - June Patch
« Reply #292 on: Today at 16:24 »
I think i got it :

Bind to game scaling : if desktop res. is 1920*1080 and scaled game size is 1440*900, the engine set the resolution to 1440*900, as it is already available resolution for the graphic card.
Bind to game scaling (force desktop ratio) : if desktop ratio is 16:9 and the scaled game ratio is 16:10, the engine set the ratio to 16:9.

Do i understand correctly ? :)

Yes, this works like that.
Actually, this is a return of old way to select resolution we still have in 3.3, just with tad more variety.

I am seriously considering on overhauling the setup once again when the 3.4 will be closer to final stage, because I realized user have to set too many things there. It might be done easier.