AGS 2.61 Pre-final Edition

Started by Pumaman, Sat 28/02/2004 23:04:11

Previous topic - Next topic

Vel

Net, it's just something top-notch that isn't very important in my opinion.

SSH

#61
Quote from: Radiant on Mon 29/03/2004 16:49:43
Oh and one more detail I noticed. When I set a character's speed to zero, the game crashes. I figured it would have been a nice way of stopping that character from moving, and am now using another workaround.

Shame that CJ didn't implement a function called StopMoving()... oh hang on...  :P

Spoiler

Since no-one seems to get irony these days, there IS a function called StopMoving
[close]

EDIT:
I hope I don't come across as agressive to Radiant, btw... I'm just trying to solve his problems... albeit in a sardonic way.

And Vel... that just doesn't make any sense, sorry. It's not important: so why ask, eh? And disabling the mouse is top-notch? Anyway, I'm sure you can check for the cursor being off at the start of on_mouse_click...
12

Kweepa

I think it's a Segway for hamsters.
But it could be a hamster powered Segway.
Still waiting for Purity of the Surf II

Pumaman

Quote from: Radiant on Mon 29/03/2004 16:49:43
320x200. My point is that AGS seems to put a certain border between any two instances of the background image. So you get (cup)(space)(cup) instead of (cup)(cup)

My apologies - it is indeed a bug, that affects 320x200 only. I'll get it fixed.

Quote
Oh and one more detail I noticed. When I set a character's speed to zero, the game crashes. I figured it would have been a nice way of stopping that character from moving, and am now using another workaround.

Interesting idea - so by setting the speed to 0, any future MoveCharacter calls would simply do nothing. That's quite a good feature request, I'll add it to my list.

QuoteAnd CJ, what's a Hamway?

ABOUT TWO AND A HALF POUNDS!!!!!


Sorry.


http://www.public.iastate.edu/~dnguyen/henway.htm

rtf

Awww, man!

Another version of AGS!
This time, no way am I downloading it.  I must resist the urge to download.
.....
.....
aaaarrrghh!

The Hen triumphs over frog (well, stork.)
I fail at art.

Bernie

There's a small layering quirk (z-buffer I think it's called) when a few characters stand on the same y coordinate and the main character walks past them (up/down). The layering order seems to change and a different character suddenly is at the front. It happens when the main character passes the y position of the other characters.

and... thank you for the new beta! :D

Pumaman

Well, if two characters have the same Y co-ordinate then no guarantees are made about their order.

If you're relying on a specific order, you can change the baselines (or use FollowCharacterEx with FOLLOW_EXACTLY, depending on what you're trying to do).

Radiant

Okay, more small bugs with varying (but generally low) degrees of importance. Thanks for your support!

- while it is true that two characters cannot directly walk through one another, this collision check doesn't seem to take the width of the characters into account. I.e. if both characters are 20 pixels wide, and they pass within ten pixels of each other, they will still appear to be walking through each other.

- nasty trick with operator precedence...
 in C and C++,    6 - 3 - 2 = (6 - 3) - 2  = 3 - 2 = 1
 In AGS, however, 6 - 3 - 2 =  6 - (3 - 2) = 6 - 1 = 5
And the same principle applies to division. You probably don't want to change this because of backwards compatibility, but maybe a compiler warning is in order.

- why isn't there a setinvproperty() function? I wanted to give each item a score_when_picked_up property, which is set to zero after being used the first time. [note to SSH, I'm using an array now so it's not a problem]

- I'm not sure what the #sectionstart/end lines do, but when selecting a script subsection from the Script menu, the editor still opens the entire script and goes to the first line of that function (rather than the line after #sectionstart); was that your intention?

- when inside a comment, the word completion for function names no longer pops up. However, the function parameter information does still pop up (i.e. if you type 'NewRoom (' a box with 'int' appears)

- would it be possible to keep the (global) script editor window open while testing the game? This would make script debugging a lot easier (as long as the user remembers to save before he tests).

- My middle mouse button is not detected as such by AGS, it instead triggers a left click. This may be a windows problem, however, I recall having the same problem with a game I wrote in Visual Studio.

- on_key_press and most other functions on that function's help page do not appear in the manual's index

- it isn't stated in the manual, but am I correct to assume that StrFormat (buf, format_string, buf, var1, var2) works correctly? (the point is using the same string 'buf' in both input and output)

- the debug box for 'teleport' should list the current room number, and should be cancelled if the user presses escape.

- question: if I put 'if (game.debug_mode)' around a block of code, will this code still be included in the non-debug version of the game? In theory this would allow a simple memory or exe patch to give access to the debug mode.

- if Display() is called with a single argument, the argument should be printed as it is, rather than treated as a format string. Reason I'm saying it is that if the string happens to contain a %s or %d, the game will crash with an unclear error message about unprintable characters.

- this is kind of obscure, but sometimes an active gui text box prevents the escape key from reaching on_key_press; it seems to occur when music initialization fails at the game startup

SSH

Quote from: Radiant on Wed 31/03/2004 13:16:23
- nasty trick with operator precedence...
 in C and C++,    6 - 3 - 2 = (6 - 3) - 2  = 3 - 2 = 1
 In AGS, however, 6 - 3 - 2 =  6 - (3 - 2) = 6 - 1 = 5
And the same principle applies to division. You probably don't want to change this because of backwards compatibility, but maybe a compiler warning is in order.

I generally make no assumptions about operator precedence or evaluation order and always use loads of brackets to guarantee things go the way I want.

Quote
- why isn't there a setinvproperty() function? I wanted to give each item a score_when_picked_up property, which is set to zero after being used the first time. [note to SSH, I'm using an array now so it's not a problem]
I would also like to see writeable properties: I think it's on the todo list, though.

Having maybe come across as having a strop at Radiant in the past, I'd like to apologise for being grumpy. Some of these little things he points out are things I've noticed but worked around and forgot to mention, but all would be nice to see fixed. Its good to have someone new come to AGS who obviously knows his way around  programming in general and point out all those little idiosyncracies that we've got used to. If only all "n00bs" were like this... a gentleman and a scholar!

Oh, and Leylines looks like it rocks from what I've had a chance to look at so far, although I wish I could run it windowed...
12

Pumaman

Quote from: Radiant on Wed 31/03/2004 13:16:23
- while it is true that two characters cannot directly walk through one another, this collision check doesn't seem to take the width of the characters into account. I.e. if both characters are 20 pixels wide, and they pass within ten pixels of each other, they will still appear to be walking through each other.

You're right - it effectively creates a walkable area around one character, but the other one's centre point can then walk around it, giving the effect you describe. I'll look into it.

Quote
- nasty trick with operator precedence...
 in C and C++,    6 - 3 - 2 = (6 - 3) - 2  = 3 - 2 = 1
 In AGS, however, 6 - 3 - 2 =  6 - (3 - 2) = 6 - 1 = 5

Yeah, this has been reported quite a few times. I really need to add a note to a prominent place in the manual, I'm just not really sure where the best place would be.

Quote
- why isn't there a setinvproperty() function? I wanted to give each item a score_when_picked_up property, which is set to zero after being used the first time. [note to SSH, I'm using an array now so it's not a problem]

Custom properties are read-only at runtime because of the hassles involved in updating the save game system to cope with saving the properties. It's not impossible, just something I haven't found the time to do yet.

Quote
- I'm not sure what the #sectionstart/end lines do, but when selecting a script subsection from the Script menu, the editor still opens the entire script and goes to the first line of that function (rather than the line after #sectionstart); was that your intention?

Yes, that's how it should work. To the user, it looks the same as before the #sectionstart lines were added.
The purpose of the #sectionstart/end is as follows: previously, the editor parsed the script by counting { and } to determine where the function ended. However, if you made a mistake in your script where you had too many or too few { or }, it would confuse the editor and it could mess up the script.
Therefore, the #sectionstart/end have been added to provide a safe, easy way for the editor to determine where each function starts and ends.

Quote
- when inside a comment, the word completion for function names no longer pops up. However, the function parameter information does still pop up (i.e. if you type 'NewRoom (' a box with 'int' appears)

Well spotted, thanks, I'll get it fixed.

Quote
- would it be possible to keep the (global) script editor window open while testing the game? This would make script debugging a lot easier (as long as the user remembers to save before he tests).

Interesting idea - I'll see what impact it would have.

Quote
- My middle mouse button is not detected as such by AGS, it instead triggers a left click. This may be a windows problem, however, I recall having the same problem with a game I wrote in Visual Studio.

Probably not much I can do about this, I'm afraid - AGS simply asks DirectX for mouse clicks.

Quote
- on_key_press and most other functions on that function's help page do not appear in the manual's index

Good point, I'll fix it.

Quote
- it isn't stated in the manual, but am I correct to assume that StrFormat (buf, format_string, buf, var1, var2) works correctly? (the point is using the same string 'buf' in both input and output)

That's not advisable, and will probably cause some undesirable results. In fact, StrFormat is a pass-through to the C sprintf function, whose documentation says "If the strings overlap, the behavior is undefined."
I'll add a note to the manual.

Quote
- the debug box for 'teleport' should list the current room number, and should be cancelled if the user presses escape.

Fair enough, I can't remember why I never did this, actually.

Quote
- question: if I put 'if (game.debug_mode)' around a block of code, will this code still be included in the non-debug version of the game? In theory this would allow a simple memory or exe patch to give access to the debug mode.

The code will be included, yes. It might be possible to add some form of #if..#endif support to the scripts for conditional compilation; but at the end of the day, if the player is determined to cheat, they will manage it somehow, and the only person they're cheating will be themselves.

Quote
- if Display() is called with a single argument, the argument should be printed as it is, rather than treated as a format string. Reason I'm saying it is that if the string happens to contain a %s or %d, the game will crash with an unclear error message about unprintable characters.

That's a good idea, I'll look into how difficult it would be to implement.

Quote
- this is kind of obscure, but sometimes an active gui text box prevents the escape key from reaching on_key_press; it seems to occur when music initialization fails at the game startup

Strange - I can't see anything in the code that would cause that; and I've never had any other reports of it. Is it just the ESC key, or other keys as well?

Gilbert

Quote from: Pumaman on Wed 31/03/2004 20:50:38
Quote
- it isn't stated in the manual, but am I correct to assume that StrFormat (buf, format_string, buf, var1, var2) works correctly? (the point is using the same string 'buf' in both input and output)

That's not advisable, and will probably cause some undesirable results. In fact, StrFormat is a pass-through to the C sprintf function, whose documentation says "If the strings overlap, the behavior is undefined."
I'll add a note to the manual.

What? Now you tell me it may not work? I had been using this kind of things A LOT and it never failed for me, does thatr mean I have to change all of my codes?

* Gilbot V7000a is having headaches...

Radiant

SSH -> thanks!!

Gilbot -> I've never had problems myself so far. Maybe windows has implemented a safer sprintf?

Pumaman -> as to the obscure music / escape key thingy, it was only the escape key. But since it doesn't seem to reproduce, I'll wager it's actually a windows problem.
As to the middle mouse button, in my experience several windows versions simply don't send the WM_MIDDLEBUTTONDOWN and -UP messages to applications. I've hacked this in the past by setting the middle button to 'double left click' in windows setup, then making double left click behave like middle button in my app. Obviously this is a really ugly hack so I wouldn't recommend it.
By the way kudos on the lovely new webpage design that appeared yesterday!

TerranRich

Quote* Fixed compiler to allow string parameters to be returned by the function.

So...basically I can define a function RandomLetter(int num) to return a random letter in string? I don't have to use a second parameter as a buffer anymore? :)
Status: Trying to come up with some ideas...

Pumaman

QuoteWhat? Now you tell me it may not work? I had been using this kind of things A LOT and it never failed for me, does thatr mean I have to change all of my codes?

Actually I just checked the code and you're ok - StrFormat writes to a temporary buffer, then copies it into the destination string. So in fact, you can get away with it.

QuoteSo...basically I can define a function RandomLetter(int num) to return a random letter in string? I don't have to use a second parameter as a buffer anymore?  

No, this fixes something else - if you had a function like this:

function whatever(string buffer) {
 return buffer;
}

it didn't work. It does now - but only if the string is passed as a parameter. Doing this:

function whatever() {
 string buffer;
 return buffer;
}

will not work, because the string's memory gets destroyed at the end of the function.

Gilbert

Quote from: Pumaman on Sat 03/04/2004 18:50:04
Actually I just checked the code and you're ok - StrFormat writes to a temporary buffer, then copies it into the destination string. So in fact, you can get away with it.

Too bad I'd changed my code already, but as it makes no difference, I won't care about it anymore.

Radiant

Quote
- nasty trick with operator precedence...
in C and C++, 6 - 3 - 2 = (6 - 3) - 2 = 3 - 2 = 1
In AGS, however, 6 - 3 - 2 = 6 - (3 - 2) = 6 - 1 = 5

Yeah, this has been reported quite a few times. I really need to add a note to a prominent place in the manual, I'm just not really sure where the best place would be.

Maybe an error is the best place. People tend not to use this syntax much anyway, but if they do it might not be what they expect either way.

Gilbert

Just use ()'s, the text script engine has been using that syntax for versions, and it's unfriendly to generate an error, all we just need is clarification in CAPS in the manual.

Kweepa

I think the best thing would be radio buttons in the general settings that say

Arithmetic precedence
[ ] AGS historical
[ ] Standard
[ ] Error if ambiguous (default)

The error should say something along the lines of "Ambiguous arithmetic operation. Add brackets or split over several lines to indicate your intention. See the manual [ref] for details."

A note in the manual is never going to be enough - people do not know to look for that sort of thing.
Still waiting for Purity of the Surf II

TerranRich

Programming has taught me never to assume and to always use parentheses, but you're right, at the very least add something to the manual. Steve's idea sounds neat, but might be damn near impossible to implement...that would mean changing the way the entire engine works, fundamentally.
Status: Trying to come up with some ideas...

Scorpiorus

I've just noticed that...

struct STR {
 string text;
};

...is compiled with no errors. Is it a bug or a new unofficial string-within-struct feature we have now? :)

~Cheers

SMF spam blocked by CleanTalk