AGS 2.71 Final 2 - Politically Correct Edition

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

Previous topic - Next topic

Pumaman

QuoteI found that noloopcheck doesn't appear in the function import if you import the function to a struct.  It only appears in the definition or else it tries to make noloopcheck the function name, which causes an error.  And it's not documented that it shouldn't appear in the import...

Fair point, I'll mention that in the manual.


Now, I've discovered that the character.Room property doesn't work in this beta (you'll get a "dot operator must be followed by member function or property" error), and I'm working on a fix.

monkey0506

#121
Okay.  Nevermind.  I was going to post a bit about the old-style strings not seeming to have been changed.  They are apparently now part of the Game struct.

I was also going to post an error I got when trying to return a String from a function, then I realized that Chris told me that it will be looked into and somehow got the idea in my head he said it could be done.

But this bit still puzzles me a little.  When the error popped up, it said "(ACI version 2.71.878)", and when I checked the Version tab in the properties pane (of the editor in Windows) the version read "2.71.614.0".  Is there a difference between these two values (other than the integral difference)?

Now if only I could get rid of MY buffer parameters. :=

[EDIT:] Yay!  I found a way to do it by putting a global String in the SM's main script and returning that from the function.

Fekix

#122
Two suggestions:

If i have a String 'mystring' i can call every String Function with this String except of String.Format.
mystring.Append, mystring.LowerCase, mystring.Length and so on work just fine but to Format the String i can't type mystring.Format("any String in here") even if the editor Popup have this option in the Dropdown menu i have to use mystring = String.Format("any String in here"). When i use mystring.Format the Game compiles but it doesn't work like it should ;)

The second suggestion is that when declarating a String it should be initialized with the value "".
For Example:
String mystring;
int length = mystring.Length;

doesn't work
but

String mystring;
mystring = "";
int length = mystring.Length;

works fine.
And

String mystring = "";

doesn't work, tooÃ,  :-[

Not really a problem but it would be much more comfortable.

Great work so far,
thanks Felix
Currently working on: My Little Real Life Adventure

Pumaman

QuoteBut this bit still puzzles me a little.  When the error popped up, it said "(ACI version 2.71.878)", and when I checked the Version tab in the properties pane (of the editor in Windows) the version read "2.71.614.0".  Is there a difference between these two values (other than the integral difference)?

Yes, the editor and the engine have different build numbers.

QuoteIf i have a String 'mystring' i can call every String Function with this String except of String.Format.
mystring.Append, mystring.LowerCase, mystring.Length and so on work just fine but to Format the String i can't type mystring.Format("any String in here") even if the editor Popup have this option in the Dropdown menu i have to use mystring = String.Format("any String in here"). When i use mystring.Format the Game compiles but it doesn't work like it should

Well, it does work, you'd just have to do this:

mystring = mystring.Format("any String in here");

But yeah, I'll remove it from the drop-down list for strings, since it's confusing having it there.

QuoteString mystring = "";

doesn't work, too 

What error do you get?

String mystring = "";

works fine for me.

Fekix

I declarated the String outside a Function at the top of the mainscript and String mystring = ""; doesn't work for me it says 'cannot assign initial value to global pointer'
Currently working on: My Little Real Life Adventure

monkey0506

Yes, initialization of Strings would be nice so I don't get that silly "NULL pointer passed to CheckForTranslations" error. :=

I'm using an array of them BTW, so I can't do it. ;)

strazer

#126
I always wait for the next beta and its features before adding anything to the tracker so I totally forgot about these:

Quote from: Pumaman on Thu 16/06/2005 20:07:24
Quote2.) Is there currently a way to determine if an object has "Use walkable area scaling" enabled or not? If not, may I suggest Object.IgnoreScaling.

Not currently, but it would make sense to add that property so that it's consistent with characters.

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

Quote from: Pumaman on Sun 17/07/2005 13:20:23
QuoteSo, I was wondering, would it be possible to add an option to remove the alpha channel when creating the dynamic sprite (thus downgrading it from 32 to 24 bit)?

Sounds reasonable to me.

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

Quote from: Pumaman on Thu 21/07/2005 20:06:12
Quote from: monkey_05_06 on Tue 19/07/2005 06:08:14I love the new String functionality...but...I think while you're working on it you should make them capable of being implemented in structs.

I'd like to allow pointers in structs, we'll have to see what else comes up.

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

Pumaman

Quote from: Fekix on Wed 31/08/2005 23:32:04
I declarated the String outside a Function at the top of the mainscript and String mystring = ""; doesn't work for me it says 'cannot assign initial value to global pointer'

Ah yes, you can't initialize it if it's a global variable. It may be possible to add support for this, but it's relatively complicated to do so I can't promise anything.

QuoteI always wait for the next beta and its features before adding anything to the tracker so I totally forgot about these:

Thanks for keeping the tracker up to date, strazer :)

SSH

#128
If you import the same single GUI twice (from a gue file), it renames one of them to "" the empty string. What script name will this have? g?

It also doesn't rename the object names of the things in the GUI. I expect that this could seriously screw up the OOP stuff. Maybe they should all be renamed with "_Copy" on the end or something?

Actually, it seems that doing a double import fo the same GUE really screws up everything: sprites, GUIs, etc. Fior example, I managed to end up with sprites with the same sprite number in more than one sprite folder! Maybe there needs to be some more checking on this?

EDIT:

In fact, the whole GUE import seems a little wierd. I've been importing two GUEs into default games and fidnign that the sprites display all wrongly: the wrong sprites are shown in gui buttons and backgrounds. However, if I take the 80x50 gray sprite, for example, copy it to clipboard, paste as a new sprite and change one of the references to that sprite to the new copied sprite, it works. If I then change back to the original it then works again. It looks maybe like some kind of "dirty" bit isn't being set somewhere???

Here's a RAR with the problem shown. http://www.lumpcity.co.uk/~ssh/sgs_gue_prob.rar

The sgstest2 directory works, the sgstest4 directory doesn't. To get the sgstest4 game, here's what I do:

Start new game with default template
Change to 16 bit colour
Import YesNo script module
Import SGS script module
Import YesNo GUE
Import SGS GUE
Change all global script references to SaveGameDialog and restoreGameDialog etc. to sgs.Save and sgs.Load
Copy in the room1 room
Compile

The Save dialog is all screwed up: sprites for buttons displayed are pretty random

Then if I go to sprite manager, SAVELOAD folder, copy the grey box to clipbaord and paste as new sprite, then go to SAVELAOD GUI, click on the button name go_Saveload_one chnage sprite to the new sprite, compiel, run, all works again...

Any ideas?
12

Pumaman

Well spotted, thanks for the info.

As for duplicate GUI control names -- I'll just have it automatically remove the name from the control if this happens, like it does with the GUI.

QuoteIf you import the same single GUI twice (from a gue file), it renames one of them to "" the empty string. What script name will this have? g?

In this case the GUI has no script name, but it can be accessed via the gui[] array if necessary.

In terms of the images messing up, it is indeed not marking the GUI images as dirty, so when it comes to draw the GUI it's still using the old sprite slot numbers of before it was imported. I'll get it fixed.

The quickest workaround is just to double-click the Image option in the button's properties window and then just select the image that's already there, and it should refresh the GUI.

SSH

Reselecting the sprite didnt seem to work when I tried it, but obviously I'll try my scenario again with beta 5 when its out.
12

Pumaman

Ok, beta 5 is now up, which should fix that.

It also adds some other stuff, including lazy evaluation and you can now return a local String from a function. See the change list in the first post for more details.

monkey0506

#132
Huzzah for lazy eval!!! :=

And for local String returnination.

Great work Chris.

[EDIT:]

There's a problem with the new return-type checking.  Let me first type up a bit of example code:

Code: ags
void myfunc(int param) {
  if (param < 0) return;
  /* else do stuff */
  }


Well...prior to the return-type checking, this would work (and it should IMO).  The problem is "return;" is not registered as returning a "void" value, so it's creating an error.  Instead I have to type:

Code: ags
void myfunc(int param) {
  if (param < 0) {
    void ret;
    return ret;
    }
  /* else do stuff */
  }


Now that's just a bit annoying... ::)

Kweepa

"Added "New Run Script Action" to the right-click menu in the interaction editor, to allow you to quickly create a Run Script interaction without having to go through the interaction dialog."

Awesome! Cheers!
Still waiting for Purity of the Surf II

Pumaman

Quote from: monkey_05_06 on Sun 04/09/2005 19:52:30
There's a problem with the new return-type checking. Let me first type up a bit of example code:

Hmm yes, "void" in general isn't supported properly. Just use "function" instead for the return type and then it will allow you to just do:
return;

monkey0506

Quote from: Pumaman on Sun 04/09/2005 23:33:19
Quote from: monkey_05_06 on Sun 04/09/2005 19:52:30
There's a problem with the new return-type checking. Let me first type up a bit of example code:

Hmm yes, "void" in general isn't supported properly. Just use "function" instead for the return type and then it will allow you to just do:
return;

Meh.


Okay.  But I'd still like to see this fixed if at all possible...

SSH

Thanks for the fix CJ

Now I realise that my module looks REALLY untidy without pointers in structs. I have to leave the strings and dynamc sprites out of the struct that holds everythung else
12

Kweepa

Using "String"s I get these flooding ac.log:

Code: ags

String 019CBF40 allocated: 'FILTER:'
String 019F5FF0 allocated: 'FILTER: VISIBLE'
String 019CBF40 deleted: 'FILTER:'
String 01AE2FE0 allocated: 'FILTER: VISIBLE SOLID'
String 019F5FF0 deleted: 'FILTER: VISIBLE'
String 01A1FFC8 allocated: 'FILTER: VISIBLE SOLID FALLTHRU'
String 01AE2FE0 deleted: 'FILTER: VISIBLE SOLID'
Still waiting for Purity of the Surf II

monkey0506

Quote from: SteveMcCrea on Mon 05/09/2005 21:35:40
Using "String"s I get these flooding ac.log:

Code: ags

String 019CBF40 allocated: 'FILTER:'
String 019F5FF0 allocated: 'FILTER: VISIBLE'
String 019CBF40 deleted: 'FILTER:'
String 01AE2FE0 allocated: 'FILTER: VISIBLE SOLID'
String 019F5FF0 deleted: 'FILTER: VISIBLE'
String 01A1FFC8 allocated: 'FILTER: VISIBLE SOLID FALLTHRU'
String 01AE2FE0 deleted: 'FILTER: VISIBLE SOLID'


Egads I get a lot of those too!

SSH

There's an interesting issue with the whole object oriented stuff: if you have a script module that uses a struct to OO-ify its things, great, but then if you have any functions like repeatedly_execute, etc.  in the module then you either have to make them have full access to the struct (and thus everything else, too) or you have to make them just call a struct version of the function. Is there a way to have two versions of the struct, one visible inside the module, and one outside? Can the extends functionality do this?

12

SMF spam blocked by CleanTalk