AGS 2.71 Final 2 - Politically Correct Edition

Started by Pumaman, Sun 05/06/2005 23:32:14

Previous topic - Next topic

monkey0506

Quote from: SSH on Fri 16/09/2005 09:23:29
Quote from: monkey_05_06 on Fri 16/09/2005 00:00:03
This next beta sounds good.  How long (abouts) until we get to see it? :=

betas automatically get delayed if anyone asks when the next one will be  >:(. But CJ usually releases them at a weekend.   :=

Oh...oops. :-[

I suppose that would make sense. :=

Pumaman

Quote from: monkey_05_06 on Fri 16/09/2005 00:00:03
This next beta sounds good. How long (abouts) until we get to see it?

Surely you've been here long enough to know not to ask that question :P


Anyway, beta 6 is now up. This adds support for pointers in structs, among other things.
The pointers in structs feature has been rather a nightmare to implement and involved some significant changes to the script compiler, so please can you make sure that your existing scripts still work, and please report immediately if you get any crashes or strange behaviour with this version.

HeirOfNorton

#162
Quote from: Pumaman on Sun 05/06/2005 23:32:14
* Added support for having pointer variables in structs.

Edit:

Does this include struct-within-struct, or just builtin types?

Nevermind, tried it out. Only builtin types, still no struct within-a-struct.  :(
Still pretty neat though, being able to put a Character* (or whatever) in a struct.

Quote
* Added DynamicSprite.Crop

Cooool. I'll get on improving the Ags3d+plus+ module to take advantage of this.

HoN

Kweepa

#163
Quote from: Pumaman on Sun 05/06/2005 23:32:14
* Fixed pamela voice lip-sync not always processing last phenome correctly.

Wow, Pamela does a complete biological breakdown of the speaker? :=
Great beta as usual!

[EDIT] Script compilation is much faster here. And no obvious problems yet.
Still waiting for Purity of the Surf II

GarageGothic

Wohoo, CJ you da man. I'll try it out right away. First, one more suggestion though:

Could we please have a DynamicSprite.Save(string filename) function? Having background-to-sprite and cropping functions would make this a very interesting option (such as having the player paint his own logo/portrait with RawDraw and then export it to a pcx file).

Gregjazz

* Fixed walk-to point getting randomly moved if you alt+tabbed back into AGS from another application.

So that's what it was!! I always had that problem but never quite identified it...

And in agreement with GarageGothic, DynamicSprite.Save(string filename) would be sweet.

monkey0506

#166
Quote from: Pumaman on Sat 17/09/2005 11:49:22
Quote from: monkey_05_06 on Fri 16/09/2005 00:00:03
This next beta sounds good. How long (abouts) until we get to see it?

Surely you've been here long enough to know not to ask that question :P

Actually at the time, it never occurred to me... :o

And I like the use of Strings within structs.  Finally :D.  Unfortunately, I've now uncovered some more bugs (in my own script, not the engine).  Back to work! :=

[EDIT:] I've noticed that using an enumeration as an array size works outside of a struct, but not inside of one.  I.E.:

Code: ags
enum myenum {
  eMyenum1 = 1,
  eMyenum2 = 2
  };

int stuff[eMyenum1];

struct mystruct {
  int somestuff[eMyenum1];
  int somemorestuff[eMyenum2];
  };


I typed that into the global script of a new game, pressed Ctrl+S, and then it gave me the error:

Quote---------------------------
Compile Error
---------------------------
There was an error compiling your script. The problem was:

In: 'Global script'



Error (line 11): Array size must be constant value



Do you want to fix the script now? (Your game has not been saved).
---------------------------
Yes   No   
---------------------------

Lines 3-6:  enum declaration
Line 7: whitespace
Line 8: array declaration
Line 9: whitespace
Lines 10 - 13: struct declaration

In short, line 11 is "int somestuff[eMyenum1];".  It doesn't have a problem with line 8, "int stuff[eMyenum1];", it just doesn't like me trying to use an enumeration as an array size within a struct... :-\  I was hoping to get rid of some of these #defines in place of something that works with autocomplete...

strazer

Quote from: monkey_05_06 on Tue 20/09/2005 01:06:01I was hoping to get rid of some of these #defines in place of something that works with autocomplete...

You can use this trick to activate auto-complete for #defines:

Code: ags

// header

#define MYENUM1 34 // import int MYENUM1;


It's sort of a bug and, if I remember correctly, something CJ won't fix for a while. :)

Scorpiorus

#168
Quote from: monkey_05_06 on Tue 20/09/2005 01:06:01
Code: ags
enum myenum {
Ã,  eMyenum1 = 1,
Ã,  eMyenum2 = 2
Ã,  };[

int stuff[eMyenum1];

I was also hopping use that kind of trick to make it extend an array on its own.
Code: ags

enum MyItems {
eItem1=0,
eItem2,
eItem3,
eMaxItems
};


Nice that it works with those out of struct, at least :)

[edit to fix eItem1]

monkey0506

Quote from: strazer on Tue 20/09/2005 01:42:50
Quote from: monkey_05_06 on Tue 20/09/2005 01:06:01I was hoping to get rid of some of these #defines in place of something that works with autocomplete...

You can use this trick to activate auto-complete for #defines:

Code: ags

// header

#define MYENUM1 34 // import int MYENUM1;


It's sort of a bug and, if I remember correctly, something CJ won't fix for a while. :)

Thanks for the tip... :=

SSH

#170
I've been trying to do this:

Code: ags

struct slowmove_t extends slowmove {
  int x0, y0, x1, y1;
  int dx, dy;
  int stepx, stepy;
  int delay;
  int timer;
  int fraction;
  Object *o;
  Character *c;
  
  import static function find_free();
  import function setup(Object *o, Character *c, int x, int y, int delay);
  import function move();
  import function update();
};

slowmove_t slowmove_i[MAX_SLOWMOVES];

function slowmove_t::setup(Object *o, Character *c, int x, int y, int delay) {
  this.o = o; /// AGS BARFS HERE!
 // etc....
} 


And AGS says: "Error (line 31): Nested non-property pointers not supported".

I'm not nesting anything, I just want to assign, say, slowmove_i[0].o = o; by doing slowmove_i.setup(o, ...);

EDIT:
Well, OK, this is a pointer, as is this.o Ah well, I worked around it, albeit a little inelegantly. Maybe there could be a bit more explanation in the error message.

While we're on dodgy error messages, if I accidentally refer to the type of a struct array instead of the array itself, I get the unhelpful message:

Code: ags

slowmove_t[i]....

"Variable '[' already defined"

when it should say:

"I pity da fool that thinks slowmove_t is an array"


EDIT 2:

Actually, if you have a String inside a struct, say called s, you can never do this.s, because this and s are both pointers and you get that error I mentioned earlier. This rather restricts the "strings in structs" feature! It also means that although you cn declare protected Strings in a struct, you cannot actually access them!

Edit by strazer

AGS v2.71 RC 1:
* The "this" pointer can now access pointer members in its struct.
12

Snarky

I haven't tried this, but couldn't you just write s instead of this.s? That's how it works in Java, at least.

strazer

Quote from: Pumaman on Tue 07/06/2005 19:50:34
Quote from: strazer on Tue 07/06/2005 08:23:21
And now that we are able to flip dynamic sprites, I think it would be essential to be able to determine if a view frame is flipped or not (via GetGameParameter or whatever).

Those are reasonable enough requests, if anyone else would find them useful?

Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=536

A�rendyll (formerly Yurina)

Hmm... this sure looks promising!

If I may do a suggestion for the future, I'd say it would be nice to have better speechview options. I'm currently looking fo different expressions, but I'm finding it hard to code. It would be nice to have more simple options to do so.
Yuna: Give me a Y!
Rikku: Give me an R!
Paine: Give me a break...
~Final Fantasy X-2

I've been

Rui 'Trovatore' Pires

I know I already addressed the issue of not being a way to get a character's name in a string (it currently returns a [200] char), but I'd like to bring it up again. It's relevant because it's probably the only thing not "Stringasized", and it is one that is preventing me from updating my script. Well, I can update most of it, but I'd like to update all of it...
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SSH

Quote from: Rui "Brisby" Pires (a Furry) on Thu 22/09/2005 12:13:31
I know I already addressed the issue of not being a way to get a character's name in a string (it currently returns a [200] char), but I'd like to bring it up again. It's relevant because it's probably the only thing not "Stringasized", and it is one that is preventing me from updating my script. Well, I can update most of it, but I'd like to update all of it...

Actually, there's quite a few builtin functions that don't work with Strings when they could.

Quote from: Snarky on Wed 21/09/2005 14:46:36
I haven't tried this, but couldn't you just write s instead of this.s? That's how it works in Java, at least.
No, you just get an error. AGS script isn't Java!
12

GarageGothic

Are the coordinates for DynamicSprite.CreateFromBackground room or screen coordinates? I can't seem to grab RawDrawn background art from outside the (0-320, 0-200) area? Also, will it ever be possible to RawDraw to background frames other than the one shown?

SSH

I just got this error after moving my mouse off the windowed game:

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x7C93426D ; program pointer is +1099, ACI version 2.71.884, gtags (1,1)
12

Pumaman

QuoteCould we please have a DynamicSprite.Save(string filename) function? Having background-to-sprite and cropping functions would make this a very interesting option (such as having the player paint his own logo/portrait with RawDraw and then export it to a pcx file).

Ok, I can see how that would relate to these changes, I'll think about it.

QuoteI've noticed that using an enumeration as an array size works outside of a struct, but not inside of one.

Fair point, I'll get it fixed.

QuoteAnd AGS says: "Error (line 31): Nested non-property pointers not supported".

Good point, I didn't bother implementing support for pointer.pointer because I thought it could never happen. But, of course, with the "this" pointer I've been proven wrong! I'll look into it.

QuoteWhile we're on dodgy error messages, if I accidentally refer to the type of a struct array instead of the array itself, I get the unhelpful message:

Yeah, there are various situations like this. But if I start to fix things like this it could turn into a never-ending torrent of "if I do this then this, the error message isn't intuitive"; at the end of the day, the compiler can't really provide a full explanation of every possible mistake you can make (though it would be nice if it did). I'll leave it for now.

QuoteI know I already addressed the issue of not being a way to get a character's name in a string (it currently returns a [200] char), but I'd like to bring it up again.

Heh yes, I keep forgetting about this ... Character.Name will come soon, honest!

QuoteActually, there's quite a few builtin functions that don't work with Strings when they could.

Such as? As far as I'm aware, character.name is the only remaining example of this.

QuoteAre the coordinates for DynamicSprite.CreateFromBackground room or screen coordinates? I can't seem to grab RawDrawn background art from outside the (0-320, 0-200) area? Also, will it ever be possible to RawDraw to background frames other than the one shown?

Hmm you're right, it's not quite working properly. It seemed ok when I originally tested it but now taking another look there's something wrong with CreateFromBackground. I'll look into it, and get it fixed.

QuoteI just got this error after moving my mouse off the windowed game:

Did it happen when the mouse moved out of the window, or when you clicked somewhere else?

Kweepa

Quote from: Pumaman on Sat 24/09/2005 13:05:18
QuoteWhile we're on dodgy error messages, if I accidentally refer to the type of a struct array instead of the array itself, I get the unhelpful message:
...at the end of the day, the compiler can't really provide a full explanation of every possible mistake you can make (though it would be nice if it did). I'll leave it for now.

Perhaps it would be better to just say "Syntax error" rather than an error message that is inaccurate or misleading.
Then users won't think there's something wrong with the compiler.
Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk