AGS v2.62 Final available for testing

Started by Pumaman, Sun 18/07/2004 21:35:34

Previous topic - Next topic

Rui 'Trovatore' Pires

Er, sorry for barging in... CJ, I hope you don't think that thingy I mentioned is fixed - it isn't. I can upload it if you like. Recap - the Golbal script doens't have more than 250 lines, and room 3 only has 41, and still entering on room 3 gives out an error message -

---------------------------
Adventure Game Studio
---------------------------
An error has occured. Please contact the game author for support, as this
is likely to be a scripting error and not a bug in AGS.
(ACI version 2.62.766)

(Room 3 script line 479)
Error: MoveObject: invalid object number

---------------------------
OK   
---------------------------


Said problematic line is actually

35 -->  SetObjectPosition(4,350,16);  (object 4 doesn't exist, shouldabeen 0)

This is small beans in a small game, but it actually allowed for a bug in my LSL2 game to go undetected at first, and later (when the emails started coming in) totally undetectable, because I didn't know what to look for.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

monkey0506

I don't know if this has been brought up, but repeatedly_execute_always is very buggy. I have a script:

Code: ags
function KeyControls(){//for keyboard control of the mouse cursor
  if (IsKeyPressed(keyup)==1) SetMousePosition(mouse.x, mouse.y-1);//move cursor up
  if (IsKeyPressed(keydown)==1) SetMousePosition(mouse.x, mouse.y+1);//move cursor down
  if (IsKeyPressed(keyleft)==1) SetMousePosition(mouse.x-1, mouse.y);//move cursor left
  if (IsKeyPressed(keyright)==1) SetMousePosition(mouse.x+1, mouse.y);//move cursor right
  if (IsKeyPressed(keyenter)==1) on_mouse_click(LEFT);//Script for Enter left-clicks
  }


which is called in repeatedly_execute. If I instead use rep_exe_always, the cursor reacts violently to the first key press, then reacts normal afterwords. I also have a script for a status bar:

Code: ags
function Extension(){//used for definition of right-mouse click extensions, and for storing location names
  GetLocationName(mouse.x, mouse.y, ext);
  if (GetInvAt(mouse.x, mouse.y)>0) GetInvName(GetInvAt(mouse.x, mouse.y), ext);
  if (StrContains(ext, ext_char)!=-1) StrSetCharAt(ext, StrContains(ext, ext_char), 0);
  }
  
function UpdateLabelBar(){//updates the status bar with the appropriate text
  if (mode==walk){
    StrCopy(label, "Walk to ");
    StrCat(label, ext);
    }
  else if (mode==give){
    StrCopy(label, "Give ");
    StrCat(label, ext);
    }
  else if (mode==open){
    StrCopy(label, "Open ");
    StrCat(label, ext);
    }
  else if (mode==close){
    StrCopy(label, "Close ");
    StrCat(label, ext);
    }
  else if (mode==pickup){
    StrCopy(label, "Pick up ");
    StrCat(label, ext);
    }
  else if (mode==lookat){
    StrCopy(label, "Look at ");
    StrCat(label, ext);
    }
  else if (mode==talkto){
    StrCopy(label, "Talk to ");
    StrCat(label, ext);
    }
  else if (mode==use){
    StrCopy(label, "Use ");
    StrCat(label, ext);
    }
  else if (mode==push){
    StrCopy(label, "Push ");
    StrCat(label, ext);
    }
  else if (mode==pull){
    StrCopy(label, "Pull ");
    StrCat(label, ext);
    }
  UpdateText(MAIN, 0, label);
  }


which is later called in rep_exe. If I call it in rep_exe_always, it only updates my label when I click on a hotspot/object/etc.  Are either of these blocking? I know you can't call blocking scripts, but I don't see where either of these would be blocking. Please notice that the same errors occur in the current non-beta version of AGS. Any help would be greatly apreciated!  ;D

Pumaman

Quote from: redruM on Thu 23/09/2004 09:28:04
Er, sorry for barging in... CJ, I hope you don't think that thingy I mentioned is fixed - it isn't. I can upload it if you like. Recap - the Golbal script doens't have more than 250 lines, and room 3 only has 41, and still entering on room 3 gives out an error message -

Ah, this is particular to SetObjectPosition, it will always say it failed on line 479. It's due to an implementation issue, I'll fix it for the next version.

QuoteI don't know if this has been brought up, but repeatedly_execute_always is very buggy.

I see.

However, before jumping to conclusions, perhaps we can explore some other options. Does your on_key_press contain any code that also reacts to these keypresses, thus meaning the press is being processed twice?

The best way would be if you uploaded the whole global script for us to check, it's very difficult to spot a problem with snippets.

Radiant

Walkable area #1 reaches from Y=50 to far below.
Region #1 reaches from Y=50 to Y=53.
If you click 'walk' anywhere north of Y=50, EGO should walk up to the end of the walkable area. However, he does not always trigger region #1. This apparently depends on his step size.

If a GUI button has an image size larger than the actual button size, within the editor, the entirety of the image will be displayed (in the game, it displays correctly)

When exporting a sprite to a file, the default file type is 'all files', which is kind of strange. In practice this means TGA; I would believe BMP would be used far more often, and if you change this value it resets itself every time you try to export a sprite.

Pumaman

Quote from: Radiant on Thu 30/09/2004 12:13:21
Walkable area #1 reaches from Y=50 to far below.
Region #1 reaches from Y=50 to Y=53.
If you click 'walk' anywhere north of Y=50, EGO should walk up to the end of the walkable area. However, he does not always trigger region #1. This apparently depends on his step size.

Ah yeah I can see that -- best thing is probably to stretch the region a bit.

Quote
If a GUI button has an image size larger than the actual button size, within the editor, the entirety of the image will be displayed (in the game, it displays correctly)

In theory the GUI buttons are supposed to be resized to match the size of the image so this shouldn't happen; I can see it being possible if you manually adjust the button size though.

Quote
When exporting a sprite to a file, the default file type is 'all files', which is kind of strange. In practice this means TGA; I would believe BMP would be used far more often, and if you change this value it resets itself every time you try to export a sprite.

I see what you mean, but on the other hand the All Files default means that all the current supported files will be displayed so the user can pick one to overwrite. Swings and roundabouts, I guess.

Radiant

Not sure if this is a bug, but if you Animate an object and then turn it off, it still classifies as animating (for IsObjectAnimating).

Minor detail: when importing a character, its sprites appear in a folder somewhere in the middle of the sprite manager; one would expect to find them at the end.

Maybe you should make 16-bit mode the default for new games? 256 color tends to confuse the n00bs.

You have a point about the 'all files' option, but I just want to point out that every other Windows application does it differently. Anyway, maybe that save-menu could remember the user's previous selection for file type? That's not particularly difficult to code, iirc.

edmundito

Glitch: I noticed on BJC3 that when Ben walks off the screen/lighting region his darkness/tint goes back to normal, and it looks kind of sucky!
The Tween Module now supports AGS 3.6.0!

Pumaman

Quote from: Radiant on Wed 06/10/2004 15:53:17
Not sure if this is a bug, but if you Animate an object and then turn it off, it still classifies as animating (for IsObjectAnimating).

I'm not sure whether this is a bug either; the fact is that it still is animating if you were to turn it back on again, so I guess this behaviour makes sense.

Quote
Minor detail: when importing a character, its sprites appear in a folder somewhere in the middle of the sprite manager; one would expect to find them at the end.

If a folder already exists with the new character's script name, the sprites are added to that; otherwise, a new folder is inserted as the second sub-folder of the root. A bit arbitrary perhaps, but consistent at least :P

Quote
Maybe you should make 16-bit mode the default for new games? 256 color tends to confuse the n00bs.

The issue with this is that then if it the user wants to convert it down to 256-col, it can cause problems with the sprites. Perhaps the New Game option should bring up the Colour Depth dialog as well as the Resolution one.

Quote
You have a point about the 'all files' option, but I just want to point out that every other Windows application does it differently. Anyway, maybe that save-menu could remember the user's previous selection for file type? That's not particularly difficult to code, iirc.

Perhaps; does anyone else see this as a problem? Personally I think it's too minor to bother fixing.

QuoteGlitch: I noticed on BJC3 that when Ben walks off the screen/lighting region his darkness/tint goes back to normal, and it looks kind of sucky!

Fair point, I'll look into it.

Dusk

Quote from: Pumaman on Sun 18/07/2004 21:35:34

* Fixed AnimateCharacterEx not working properly when playing a multi-loop animation backwards.

Thanks ;)
I'll try the new beta as soon as I can...

D.

Gilbert

#109
Quote from: Pumaman on Thu 07/10/2004 20:54:47
Quote from: Radiant on Wed 06/10/2004 15:53:17
Not sure if this is a bug, but if you Animate an object and then turn it off, it still classifies as animating (for IsObjectAnimating).
I'm not sure whether this is a bug either; the fact is that it still is animating if you were to turn it back on again, so I guess this behaviour makes sense.
Actually I'm not sure but I think something is not very consistence, being the fact that if a character/object was moving, if you turn it off it will stop, in my opinion, when they're off you can just treat them as invisible, and continue their motions, this can make some old-style animted effects of say, something moving and "flashily" disappearing easy.

Other thing I just found to be a problem was that some of the read-only checks on game variables now imposed are quite annoying, one noticiable variable is game.score, I used to modify it manually a lot, but with new version you can only use GiveScore(), which is restrictive.
Unless you have a SetScore() function with does exactly the same thing with game.score=...  but will not do any other silly extra stuffs like playing the score sound (when it's actually unwanted). Currently, for example, if you for some reasons want to change the score to zero, you have to use:
GiveScore(-game.score);
which is awkward.

strazer

Quote from: GilbotActually I'm not sure but I think something is not very consistence, being the fact that if a character/object was moving, if you turn it off it will stop, in my opinion, when they're off you can just treat them as invisible, and continue their motions, this can make some old-style animted effects of say, something moving and "flashily" disappearing easy.

I've scripted my own character control system and at the moment I make characters that are not in the current room fully transparent (to save a view) and track their "No interaction" property while I move them around the virtual room.
I could of course assign them a blank view, but then I would still need to save their normal view and restore it when they re-enter the current room.

So it's not that important, but yeah, it would be nice if characters could still be moved when turned off (via character[CHARID].on for example).

Pumaman

In order to save on resources, AGS does not move or animate objects or characters that are turned off.

However, because the object is still in the middle of being animated, IsObjectAnimating will return true -- because if the object is turned back on, its animation will resume.

Gilbert: I guess I can remove the restriction for game.score ;)

Pumaman

Right, I'm back, and the FInal is here!

Gilbert

Quote from: Pumaman on Sat 16/10/2004 21:22:48
However, because the object is still in the middle of being animated, IsObjectAnimating will return true -- because if the object is turned back on, its animation will resume.

Hmmm, but the problem was that if an object is still in the middle of being moved, it would be stopped when turned off.
Anyway, it's not that important, just to point it out.

Goldmund

Superb! And great thanks for fixing the background speech "bug" I complained about!
;D

Joacim Andersson

I don't know if you consider this a bug or if there is some reason I've missed that made you remove it. But in earlier versions you could assign a string value to a string on the declaration line...
string sMyString = "See how neat, I can assign a value without using StrCpy";
I noticed that this behaviour was gone already in v2.61

Gilbert

This way of string assignment is never supported, so, just avoid.

Joacim Andersson

#117
Quote from: Gilbot V7000a on Thu 04/11/2004 01:21:57
This way of string assignment is never supported, so, just avoid.
That's not true. I have a couple of games I wrote in v2.56 that uses it. It's nothing strange about it. It's allowed in a C program for example.

Gilbert

This is true, '=' assignment was never supported, if it worked, it's just by accident, you should never do that, as it can produce problems like memory corruptions, etc.
So this "feature" is not "removed" as far as I know, the engine probably now does better checking on the codes to prevent people like you from going illegal stuff.

Joacim Andersson

#119
Well, I really can't see why it would cause any memory problem. The documentation states that a string is a char array capable of holding 200 characters. So there would in that case cause memory problems if I use StrCpy or StrCat if the result string would exceed 200 characters as well.

I can't use the equal sign for assigning strings to a char array in C either except from in the declaration itself.... so the following is fully legal in a C program:

char str[200] = "See, I don't need to use StrCpy";

And since the script in AGS tries to mimic C and the fact that it did work earlier I just wanted to know the reason why it has been removed. It's no biggy I was just curious.

But I'm glad that people like me can't do illegal stuff since I'm such a dork and usually do that :). Actually I am a system developer and work a lot with C and C++ so I do know about memory management ;)

SMF spam blocked by CleanTalk