Adventure Game Studio | Forums

AGS Support => Advanced Technical Forum => Topic started by: Pumaman on Mon 02/05/2005 18:56:18

Title: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Mon 02/05/2005 18:56:18
Well, it's been a good 6 months in development, but version 2.7 is now ready for your consumption! This is a major upgrade from 2.62, and in particular the scripting language has changed somewhat so it may well take a bit of getting used to.

If you've used previous AGS versions, please read this upgrading guide (http://www.adventuregamestudio.co.uk/manual/UpgradingTo27.htm) to get you started with understanding the changes and answering any questions you may have.

Full changelog since 2.62:
* Added object-based functions for Characters, Objects, Hotspots, Regions, Inventory Items, GUIs, Overlays, Files and the mouse. This also indirectly adds some new functions, since there is now a way to do GetTransparency, GetBaseline, etc.
* Added named pointers to each character, eg. "cEgo", "cBman", etc. This allows you to do "cEgo.Walk" rather than "character[EGO].Walk"
* Added struct member function support, including static member functions.
* Added script array bounds checking.
* Added script module support, so that you don't have to cram everything into the global script. This also allows you to easily share code with other people by exporting the module.
* Added icons to script editor autocomplete.
* Added script Property support, to make the various interfaces more intuitive.
* Added support for optional parameters to text script.
* Added support for enums to script, including autocomplete support when calling a function that uses them.
* Added plugin API functions NotifySpriteUpdated, SetSpriteAlphaBlended, QueueGameScriptFunction, RegisterManagedObject, AddManagedObjectReader and RegisterUnserializedObject.
* Added simple inheritance support to structs, allowing you to create derived classes.
* Added support for protected member variables/functions and write-protected member variables.
* Added left-to-right operator precedence option.
* Added float data type, along with related conversion functions and trigonometric functions such as cos, sin and tan.
* Added "Enforce object-based scripting" option, which means that old-style commands (such as MoveCharacter) no longer work.
* Added sprite file indexing to speed up load time for games with a large number of sprites.
* Added Solid, BlockingWidth and BlockingHeight properties to Objects.
* Autocomplete now lists structure members.
* Added Crop Sprite Edges Symmetric option, to leave the central pivot point of the sprite unchanged.
* Added AbortGame function to allow script modules to perform checks on their parameters and easily give an error.
* Added #ifdef, #ifndef, #endif, #undef and #error preprocessor directives to the script language.
* Added DEBUG and STRICT pre-defined macros when in debug mode and strict scripting mode, respectively.
* Added script call stack when an error occurs, rather than just the current line number.
* Added script editor Preferences dialog, allowing you to control which automatic editing features are enabled.
* Added Character.BlockingWidth/BlockingHeight to allow you to customize the blocking size of a character.
* The "player" variable is now kept updated to reflect the current player character, so it's now perfectly safe to useÃ,  player.Walk rather thanÃ,  character[GetPlayerCharacter()].Walk
* Added GUI OnClick handler to provide a more intuitive way to handle clicks on the GUI background.
* Added export/import single GUI function.
* Added ClipImage option to GUI buttons.
* Added option to select the transparency and palette settings for the Quick Import options.
* Improved the custom inventory window, so that it can display inventory for a specific character; and also it now has object-based methods to manipulate it, rather than messing around with variables like game.top_inv_item.
* Improved script type checking -- it will now catch far more errors if you try to do things like assign a string to an int, or pass character[EGO] to a function where EGO was wanted.
* Local variables are now automatically initialized to 0.
* Improved function calltips so that it highlights the current parameter.
* Added support for multi-word words in text parser.
* Removed various buttons on the Room Settings and GUI panes, and moved them to new Room and GUI menus, respectively.
* Script compiler now checks that the "import" declaration of variables in the script header matches the real definition in the global script.
* Added confirmation prompt in script editor if you choose "Discard and exit"; and added shortcut keys for the exit options.
* Increased max sprites to 30000.
* Increased max overlays from 10 to 20.
* Improved game startup speed and room loading speed.
* Changed MOD music player from JGMOD to DUMB, and consequently: Fixed some previously unsupported S3M's music files not playing. IT Impluse Tracker format mod files are now supported (music*.it)
* Removed limits on the total number of GUI controls you can have.
* If two room-changing functions are called in one script, an error now occurs (eg. using RestoreGame followed by NewRoom).
* Added the game name to the script editor title bar (useful if you're alt-tabbing between multiple games).
* Added ability to use a sprite as the inventory cursor hotspot dot.
* Dynamic sprites are now persisted in save games.
* Changed Test Game behaviour to hopefully fix problems with it hanging.
* SaveGameSlot/SaveGameDialog are now delayed-response functions, just like the RestoreGame ones. This means the game won't actually be saved until the script function finishes.
* Improved character 'skipping' sometimes at move speed 1.
* Increased max custom properties from 20 to 30.
* Changing an object's name now marks the room as dirty.
* RawDrawImage and MergeObject now draw alpha-blended images properly.
* Sprite Usage report now tells you which GUI a GUI button is on.
* Added [ to Display/Say/etc, to enable you to display the [ character rather than it doing a line break.
* Significantly improved script compile speed.
* Ctrl+Space now allows you to pop up the autocomplete list at any time, like in Visual Studio.
* If Split Resources Files is checked, the sprites are now put into the .001 resource file to stop the EXE getting too big (since it could cause performance problems due to anti-virus software).
* Added editor warning message if you Save Room As to a filename that's not roomX.crm or intro.crm
* Renamed "No interaction" character checkbox to "Clickable" (and thus reversed its behaviour) to make it consistent with the script.
* Renamed GUI "Foreground color" property to "Border color" since that's all it does.
* Importing a new background with a different size to the old one now gives you an opportunity to cancel.
* Improved accuracy of GetMP3PosMillis and voice lip-sync with OGG sound files.
* goto-previous dialog command now stops the dialog if there is no previous topic, rather than aborting the game.
* StrCopy now works with copying into char buffers less than 200 bytes (USE WITH CARE, there is no buffer overrun protection)
* Enabled Quick Import sprite options in 256-colour games.
* Added an option to Auto-number Speech Lines to number Display() lines for the narrator.
* PlaySound now returns the channel number that the sound is playing on.
* Renamed intro.crm to room0.crm, to stop it causing confusion.
* Renamed the manual to "ags-help.chm" to make it more obvious what it is when accessing it externally from the editor.
* Changed shortcut key for Freehand tool in Room Areas to Ctrl+D to stop it conflicting with Edit Script (Ctrl+E).
* Changing a character's script name now forces a re-compile of the dialog scripts.
* DisplaySpeech no longer changes the mouse cursor if the cursor mode is already the Wait mode.
* Auto-number speech lines now tells you which room the error was in, if there is a compile error when re-compiling.
* Script names can now contain the digit 0-9 after the first character.
* Fixed interactions getting disconnected and other problems after deleting an object.
* Fixed function calltip not appearing if you used the ( key to autocomplete the function name.
* Fixed "unknown interaction" crash if the room changed within an interaction.
* Fixed crash which could happen when an inventory cursor was in use.
* Fixed erroneous type mismatch error sometimes when using char arrays as strings.
* Fixed animated GIF import if the transparent color had the same RGB value as one of the real colors.
* Fixed PlayMusicQueued skipping some tracks if crossfading was enabled.
* Fixed script editor not re-opening properly if you closed it while it was minimized.
* Fixed problems creating a template with a filename longer than 15 characters (now truncates to 15 instead).
* Fixed Assign To View not always flipping the first frame when you asked it to.
* Fixed editor crash sometimes if you had been editing a room with no code in its room script.
* Fixed editor crash if you deleted a sprite folder whilst editing its name.
* Fixed #defined names so that they are not replaced if preceded by a dot.
* Fixed script compiler allowing array.member with no index specified.
* Fixed text parser not allowing 1-letter words.
* Fixed SetCharacterSpeechView not allowing -1 to turn it off.
* Fixed crash importing GIF files with comments (thanks to "Hard Rock" for the fix).
* Fixed slider background image not being exported as part of GUI.
* Fixed Paste From Clipboard sprites getting given an alpha channel if you previously imported an alpha-channel sprite from a file.
* Fixed FollowCharacter not working on two NPC's if Hide Player Character was ticked in the room.
* Fixed free disk space crash on game startup on some Win9x systems.
* Fixed pixel-perfect click detection not always working properly with flipped sprites.
* Fixed compiler crash if a single array or struct was bigger than 32KB.
* Fixed line numbers being missing from a couple of compiler error messages.
* Fixed SetChannelVolume not working properly with the ambient sound channel.
* Fixed occasional animation glitch if the previous loop in the view had no frames.
* Fixed compile error if you had more than 500 functions in the global script.
* Fixed speech animation not playing if DisplayMessage was used with a room message set to display as character speech.
* Fixed RunAGSGame crashing if called from a custom script function.
* Fixed IsKeyPressed(13) not working with the numeric keypad Enter key.
* Fixed GUI editor not allowing you to set a label text longer than 25 characters.
* Fixed clickable z-order of GUI controls to be the same as the visual z-order.
* Fixed rare crash which could occur with MoveObject.
* Fixed GUI Editor allowing you to add controls to a text window GUI.
* Fixed MoveCharacter error messages if a character was following another character and neither were in the current room.
* Fixed GetTime returning the wrong year.

The following items from the Tracker are now fixed/implemented:
BB78: Object name change doesn't mark room dirty (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=78)
BB82: .S3M music doesn't work (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=82)
BB87: Change operator precedence so 5-2-3=0 (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=87)
BB90: Rename "No interaction" checkbox (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=90)
BB92: MathSqrt and MathRaiseToPower functions (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=92)
BB97: Plugins: QueueRunScriptFunction (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=97)
BB98: Plugins: NotifySpriteUpdated (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=98)
BB99: Plugins: SetSpriteAlphaBlended (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=99)
BB103: GetOverlayX, GetOverlayY (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=103)
BB104: Import/Export single GUI (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=104)
BB124: Increase character blocking width (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=124)
BB130: Keep script editor open while testing game (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=130)
BB198: GUI background click pass -1 as button (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=198)
BB199: Detect wrong number of parameters in function import (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=199)
BB205: Check type of imported variables / function parameters (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=205)
BB223: Warning if load old game in Beta version (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=223)
BB234: Script modules / #include (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=234)
BB245: Display specific character's inventory (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=245)
BB248: Read-only GUI sliders (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=248)
BB252: ProgressBar GUI control (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=252)
BB268: MoveObjectBlocking (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=268)
BB271: Initialize local variables to zero (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=271)
BB273: ListBoxSetItemText (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=273)
BB276: SetButtonTextColor (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=276)
BB346: Centre text in message box (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=346)
BB353: Words with spaces in parser word list (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=353)
BB356: Display room info on "Areas" pane (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=356)
BB368: SetCharacterTint (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=368)
BB388: Determine if character is talking (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=388)
BB397: Floating point variables (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=397)
BB398: Make objects block the way (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=398)
BB424: .IT music support (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=424)
BB489: NewRoom inside script inside interaction crashes (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=489)
BB490: Can't restore minimized script window (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=490)
BB494: "Room" menu in editor (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=494)
BB506: Mouse.ChangeModeView (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=506)



Changes from Refresh to Refresh 2:
* Fixed GUI Button Click Action option not being changeable in the editor.
* Fixed auto-number speech not working with character.Think commands.
* Fixed the Player Enters Screen After Fadein running before fadein in the new room if ChangeRoom was called from Player Enters Screen Before Fadein.

Changes from 2.7 to 2.7 Refresh:
* Fixed crash using RestoreGameSlot from script module repeatedly_execute.
* Fixed Mouse Moves Over Hotspot not being run if the mouse was still but the room scrolled around it.
* Fixed translation files to be read from the datadir in acsetup.cfg, if specified.
* Fixed auto-number speech to not speechify global messages 983-999, since they are used for built-in dialogs.

Changes since 2.7 Final:
* Fixed crash using RestoreGameSlot from within a GUI control handler function.
* Fixed room loading errors that could occur after playing for a while.
* Fixed screen flickering briefly between games in RunAGSGame.
* Fixed inventory hotspot dot not working properly on 32-bit alpha-channel inventory item images.
* Auto-number speech lines now does DisplayAt and DisplayThought.


MAKE A BACKUP OF YOUR GAME BEFORE UPGRADING, JUST IN CASE ANYTHING GOES WRONG

http://www.adventuregamestudio.co.uk/ags_27.zip?refresh2
Title: Re: AGS v2.7 now released!
Post by: ryanlandry on Mon 02/05/2005 19:32:50
I'm at work right now, 3:30...but i can't wait to get home and try it out :|

i just recently became familiar enough with the scripting to be able to do almost anything i need to do on the first or 2nd attempt, and now it's gonna be as intuitive as takin' a leak!

merci, your program owns the world.

-RSL
Title: Re: AGS v2.7 now released!
Post by: edmundito on Mon 02/05/2005 19:34:02
Hooray!

Saturday School was/is written in all 2.7 goodness... hopefully it'll be out this week, just got those bugs to kill!
Title: Re: AGS v2.7 now released!
Post by: Pumaman on Mon 02/05/2005 21:09:23
Oh, one thing I forgot to mention -- the DOS engine is no longer included.

When I had my hard drive crash I lost my DOS compiler installations, and I really can't be bothered to get it all downloaded and set up again unless anyone really needs the DOS build.
Title: Re: AGS v2.7 now released!
Post by: on Mon 02/05/2005 21:59:20
Yes! Finally it's fully ready. Gotta start practicing the new script language. Thank you very much CJ for making yet another great version of AGS.
Title: Re: AGS v2.7 now released!
Post by: on Mon 02/05/2005 22:15:24
Aww....I really kind of wanted to release my game as a DOS build.  Since it is supposed to be in that retro-style...  Oh well, this is amazing.
Title: Re: AGS v2.7 now released!
Post by: Gilbert on Tue 03/05/2005 03:06:54
Ah well... I think I'll stick to V2.62 then.

Good for me that I don't really need to learn the OO-scripting anymore.
Title: Re: AGS v2.7 now released!
Post by: Kinoko on Tue 03/05/2005 03:10:41
HOORAY! Thanks a million CJ ^_^ I've been waiting for this for a long time. I'm sure it'll be a long time before I get used to the changes but it's kind of exciting at the same time, like being able to experience trying AGS for the first time again. Ahh, like a second marriage...

Hopefully this (coupled with my being stuck at home sick) gives me the motivation to get to work on my game again.

EDIT: One thing I've noticed is that I no longer get the problem of the game not running the first time I 'test' it. I used to have to test once, ctrl+alt+del and then test again the first time after turning the computer on. Now it runs like normal all the time.
Title: Re: AGS v2.7 now released!
Post by: edmundito on Tue 03/05/2005 07:03:49
Quote from: Kinoko on Tue 03/05/2005 03:10:41
HOORAY! Thanks a million CJ ^_^ I've been waiting for this for a long time. I'm sure it'll be a long time before I get used to the changes but it's kind of exciting at the same time, like being able to experience trying AGS for the first time again. Ahh, like a second marriage...
Or it's kind of like being married to someone for so long that you lose the spark in bed, so you have to get inventive and try a whole new way of "doing it", or have a second honeymoon. (Or maybe I've been watching too much Family Guy, including new episodes)

Quote from: Kinoko on Tue 03/05/2005 03:10:41
EDIT: One thing I've noticed is that I no longer get the problem of the game not running the first time I 'test' it. I used to have to test once, ctrl+alt+del and then test again the first time after turning the computer on. Now it runs like normal all the time.

I've become so afraid of AGS testing, that I'm even afraid to try this out on my compy. I hope it works once and for all! :)
Title: Re: AGS v2.7 now released!
Post by: Gilbert on Tue 03/05/2005 07:56:07
Actually, all (or in a better word - most) of the test game problems were hopefully fixed (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20262.0) in this version.
If there're still problems, report.
Title: Re: AGS v2.7 now released!
Post by: edmundito on Tue 03/05/2005 08:09:46
Chris, it worked! I love you sooo much, Chris. I want to have your baby somehow.

This is too much. I'm just going to cry out of joy.  :'(
Title: Re: AGS v2.7 now released!
Post by: Kinoko on Tue 03/05/2005 14:10:30
It's great, I got to the point once where I was too sick of the problem to work with AGS on my good computer. I'd rather use my crappy old P133 and at least be able to test normally. I got over that but I got into the habit of just testing and pretty much instantly ctrl+alt+deleting. Good thing I held off this time.
Title: Re: AGS v2.7 now released!
Post by: on Wed 04/05/2005 03:31:09
When there is no DOS-Version, you don't need the Wavetable-Syntheser or Midi-Driver [Edit]write in the help[/EDIT], because it was only for the DOS-Edition and new User will be maybe a little confused (I prupose to kill the "compile as DOS-Game" - Entry in the las final version) Good work. Normally I HATE object-orientied working, but it seems like a nice entry to a real modern programming-language...
Title: Re: AGS v2.7 now released!
Post by: on Thu 05/05/2005 18:05:51
Yeah, hooray! Now I have sucessfully re-written the complete GUI stuff from my game in 2.7 beta... and can start work on the game in 2.7. life really can be so great! Works all fine, too. where can I deliver that big bag of gold to, mr jones?  :=
Title: Re: AGS v2.7 now released!
Post by: RickJ on Thu 05/05/2005 20:18:44
I have noticed some odd behaviour.  Near the end of long AGSEDIT sessions button and other graphics fail to be drawn.  This includes the view of the room's background images in Room->Settings tab.    AFter closing the editor and re-opening the problem disappears.   
Title: Re: AGS v2.7 now released!
Post by: magintz on Fri 06/05/2005 14:40:29
Looking at this version of AGS I began to think back when I first joined AGS, making my first practice game in the old DOS engine and a little 2 room game where the only 2 puzzles where to get a key from under a door mat and then open the door with the key. Has anyone still got a copy of the old dos version it might be nice to look at.
Title: Re: AGS v2.7 now released!
Post by: Scummbuddy on Fri 06/05/2005 15:03:07
strazer has a page with a couple downloads of ol'

http://www.strazer.net/ags/tidbits.htm#history

I cant remember who has a page with all of them, though.
Title: Re: AGS v2.7 now released!
Post by: Pumaman on Fri 06/05/2005 19:10:06
Quote from: RickJ on Thu 05/05/2005 20:18:44
I have noticed some odd behaviour. Near the end of long AGSEDIT sessions button and other graphics fail to be drawn. This includes the view of the room's background images in Room->Settings tab. AFter closing the editor and re-opening the problem disappears.

How long is a long session? Is this problem particular to this version, or has it always happened?
Sounds like some sort of resource leak, but it's hard to say.

When this problem happens, could you open Task Manager, enable the GDI Objects column and see what it says for agsedit?
Title: Re: AGS v2.7 now released!
Post by: RickJ on Sat 07/05/2005 19:07:42
Quote
How long is a long session? Is this problem particular to this version, or has it always happened?
Title: Re: AGS v2.7 now released!
Post by: Pumaman on Sat 07/05/2005 20:22:49
Ok, I'll bear it in mind. Having to close the editor once a day isn't too serious a problem, so I won't treat it as a bug that should hold back this release.

QuoteI'm running WinME (Arrrrgh!!) on the AGS machine.  I don't think WinME task manager has that?  Unless you are talking about something other than than what comes up in responsde to the 3 finger salute??

Ah ok yeah, the Win9x task manager doesn't do this. Thanks anyway.
Title: Re: AGS v2.7 now released!
Post by: Oncer on Sun 08/05/2005 17:00:34
Quote from: Pumaman on Mon 02/05/2005 21:09:23
Oh, one thing I forgot to mention -- the DOS engine is no longer included.

When I had my hard drive crash I lost my DOS compiler installations, and I really can't be bothered to get it all downloaded and set up again unless anyone really needs the DOS build.


Well... I really need the DOS build! If you don't include it I'll stay at 2.62. We want to release our game for Win, DOS and Linux, so... I won't use 2.7 if there is no possibility to build the game for DOS   :D
I'm also going to wait for the linux build before upgrade, but I'm sure it will be released in a few days
Beside that, the DOS port has a better performance if you use real DOS
Title: Re: AGS v2.7 now released!
Post by: RickJ on Mon 09/05/2005 23:34:18
Problem Using RestoreGameSlot() from Script Modules -

Calling RestoreGameSlot() from a Module Scirpt's game_start() event is now disallowed; fair enough, as was previously explained the game isn't fully initialized at that point and so ... 

So in my MiniGame module I moved the RestoreGameSlot() from the game_start() event to the repeatedly_execute() event.  Currently game_start() sets a flag and repeatedly_execute() tests the flag, counts to 10 (i.e. 10 actual game cycles, not "while") , and then calls RestoreGameSlot(). 

When RestoreGameSlot() is called the following fatal exception occurs :

"... exception 0xC0000005 occured in ACWIN>EXE at EIP 0x0045C050; program pointer is +6, ACI version 2.70.861, gtags 492,4"

Is this something that can be fixed or am I doing something wrong?
Title: Bug report [I think(?)].
Post by: monkey0506 on Tue 10/05/2005 02:13:13
If I test my game and hold the Ctrl key while the game loads, I get this error message:

---------------------------
Adventure Game Studio
---------------------------

Unable to initialize your audio hardware.
[Problem: Failed to init digital sound driver]

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


As this is the game that I'm building the scrolling dialog script module in there isn't any sound, so I don't know if the sound would actually work or not, but I don't see why me holding Ctrl while loading a game would disable the sound card.  (I discovered this by accident...)

Edit:  I forgot to mention, the game does load, but according to this message the sound card won't work (not sure if it does or not).

Edit again:  Just to verify I checked it again, and I have to press Ctrl + T (for testing the game), then release both keys, then hold Ctrl again for this error to occur.  And it has occurred consistently every time I've followed this procedure.
Title: Re: AGS v2.7 now released!
Post by: Scummbuddy on Tue 10/05/2005 02:24:39
I ususally only get this if i have windows media player running or paused in the background.
Title: Re: AGS v2.7 now released!
Post by: Pumaman on Tue 10/05/2005 19:32:50
Quote from: RickJ on Mon 09/05/2005 23:34:18
Problem Using RestoreGameSlot() from Script Modules -

Thanks for the bug report, you're right, this happens if you restore/restart from within a csript module repeatedly_execute or rep_exeC_always. I'll get it fixed.
Title: Re: AGS v2.7 now released!
Post by: monkey0506 on Wed 11/05/2005 01:55:53
Quote from: Scummbuddy on Tue 10/05/2005 02:24:39
I ususally only get this if i have windows media player running or paused in the background.

I did have WMP paused in the background when I first discovered this, but testing it again:

1.  Open a game in AGS.
2.  Press Ctrl + T (test game).
3.  Release Ctrl and 'T'.
4.  Press (and hold) Ctrl.

I got the same error.  With no programs running in the background (other than Norton AntiVirus, my scanner, my graphics card monitor controller, and various other Taskbar Icons).  So, it had nothing to do with WMP in this case.
Title: Re: AGS v2.7 now released!
Post by: Pumaman on Wed 11/05/2005 19:26:39
Yeah, DirectSound is a bit funny about this, the application seems to have to have the focus and be idle when you try to initailize it, otherwise it fails.

You'll get the same error if you click away from the game while it's loading.
Title: Re: AGS v2.7 Refresh now released!
Post by: Pumaman on Fri 13/05/2005 21:41:15
Due to the crashing bug RickJ reported, I decided it would be prudent to release a new version to fix it. I also included a couple of other minor fixes at the same time.

Unless there are any other critical bugs found, this 2.7 Refresh will be the final official version in a week or so's time.

If you're not sure whether you got the Refresh or not (since the file name is the same as the previous version), go into the editor Help, About option. It should be v2.70.600.
Title: Re: AGS v2.7 Refresh now released!
Post by: HeirOfNorton on Sat 14/05/2005 00:56:30
Quote from: Pumaman on Mon 02/05/2005 18:56:18
* Auto-number speech lines now does DisplayAt and DisplayThought.

Just so you know, while this does work with DisplayThought, it does not work with charachter.Think. Those lines remain unnumbered when auto-numbering.

HoN
Quote
Title: Re: AGS v2.7 Refresh now released!
Post by: geomis on Sat 14/05/2005 09:54:17
i hope i am not sounding stupid but can you start a game on V2.62 and later start editing iit on V2.7 i am really new to this
Title: Re: AGS v2.7 Refresh now released!
Post by: Rui 'Trovatore' Pires on Sat 14/05/2005 10:18:18
Yes you can, but if you are that new you might like to start on 2.7 right away. It's THIS close to being oficially (sp?) released, and has many more features. ALso, the way scripts are made is very different, but I don't suppose that'd be a factor, if you're that new I kinda assume you haven't started scripting yet, which is cool.
Title: Re: AGS v2.7 Refresh now released!
Post by: geomis on Sat 14/05/2005 10:25:35
either scirpting is a name for a group of things or some thing bye it self it sound hard of course im a noob it is like a was suddenly droped in the USA i
dont know how really every thing is and every thing works
Title: Re: AGS v2.7 Refresh now released!
Post by: Dave Gilbert on Sun 15/05/2005 13:18:14
Ahoy CJ!  Wonderful work.  I am enjoying the new system muchly.  I only have one question about the object.visible property...

I thought I'd be able to use the object script name when turning objects on and off. like:

object[oClosedWindow].Visible=false;
object[oOpenWindow].Visible=true;

But it gives me the following error: "Type mismatch: cannot convert 'Object*' to 'int'"

I replaced the object script name with the object number and it compiled and worked fine, but it seems to defeat the purpose of having the object script names to begin with.  Is this a "feature" or am I doing something wrong? :)

Title: Re: AGS v2.7 Refresh now released!
Post by: Pumaman on Sun 15/05/2005 13:23:08
Quote from: Dave Gilbert on Sun 15/05/2005 13:18:14
object[oClosedWindow].Visible=false;
object[oOpenWindow].Visible=true;

It's actually much simpler than that:

oClosedWindow.Visible=false;
oOpenWindow.Visible=true;

:)
Title: Re: AGS v2.7 Refresh now released!
Post by: Dave Gilbert on Sun 15/05/2005 13:24:02
HAH.  Thanks CJ!  I had a feeling I was doing something dumb.
Title: Re: AGS v2.7 Refresh now released!
Post by: Ginny on Thu 19/05/2005 17:07:32
Great to see this new release! I was going to wait until it's final, but I didn't, and I seem to have found some glitch/bug/something -

When editing GUIs, I cannot change the default state of a Button's left click property. So for example, in the default game template, I can't change any of the buttons in the Iconbar to do anything other than 'Set Cursor Mode', and with any other button it seems to be stuck on 'Run Script'.

Did anyone else have this problem?
Title: Re: AGS v2.7 Refresh now released!
Post by: strazer on Thu 19/05/2005 17:27:27
Doesn't work here either.
Title: Re: AGS v2.7 Refresh now released!
Post by: Pumaman on Thu 19/05/2005 22:22:34
Hmm you're right, thanks for pointing it out. It's amazing how far a version can get before these things get noticed.
Title: Re: AGS v2.7 Refresh now released!
Post by: on Fri 20/05/2005 02:48:19
Huh...Interesting. :o

BTW Dave, just FYI, all the script O-names are used in the same manner... ;)
Title: Re: AGS v2.7 Refresh now released!
Post by: monkey0506 on Sat 21/05/2005 02:45:28
I would just edit my last post, but I didn't log in... ::)

Anyways, I have something of a bug to report.  It's very minor/trivial/not-really-that-important, but I figure I'll report it since it has been causing me some grief in trying to figure out what the problem was.  If the text displayed on a label has the exact width of the label, i.e. in the font I am using "Holy crap!  I can't believe it worked!  This is so friggin' awesome!" without the quotation marks has a width of 318 pixels.  This is also the width of my label.  The " awesome!" was flooded to a new line within the label which caused graphical errors.  Or perhaps this is considered a feature that when text has the exact width of the label the label floods the text.(?)..

In any case I figured it out and fixed the problem (changing the bounds from > width to >= width in a while loop).
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Sun 22/05/2005 12:41:51
Ok, Refresh 2 is now up which fixes the GUI Button bug that Ginny reported, as well as a couple of other things that came up.

Hopefully this should be really the final version this time.

QuoteAnyways, I have something of a bug to report.  It's very minor/trivial/not-really-that-important, but I figure I'll report it since it has been causing me some grief in trying to figure out what the problem was.  If the text displayed on a label has the exact width of the label, i.e. in the font I am using "Holy crap!  I can't believe it worked!  This is so friggin' awesome!" without the quotation marks has a width of 318 pixels.  This is also the width of my label.  The " awesome!" was flooded to a new line within the label which caused graphical errors.  Or perhaps this is considered a feature that when text has the exact width of the label the label floods the text.(?)..

Hmm, I kinda see your point -- but then, the label's wrapping behaviour is not specified and changing it now could have adverse affects on other people if their games expect this behaviour now.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Mon 23/05/2005 02:09:13
Okay. ;) I understand.  But I have a question:

Quote* Added simple inheritance support to structs, allowing you to create derived classes.

What inheritance is provided?  Other than basic types I don't seem to be able to include anything in a struct declaration unless the base struct is defined in one of the script headers preceeding the declaration of the derived struct...  I searched the manual for inheritance but it didn't return any topics...

Edit:  "I don't seem to be able to include anything in a struct declaration" -- Erm... I can include member function imports and protected data members and stuff as well, I meant that I can't use a custom defined data type within a struct (I know this has been discussed before, but the quote above raised some question in my mind and clarification as to its meaning would be appreciated). :)
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Mon 23/05/2005 18:49:16
Inheritance means this:

struct A {
  int a;
};

struct B extends A {
  int b;
};

It's not particularly useful since virtual functions aren't supported, but it might come in handy for the odd thing.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Mon 23/05/2005 22:59:40
I'll look into that.  I tried looking under inheritance but couldn't find anything in the manual.  And structs are only mentioned in one place (2.7 conversion thingy). :o



Edit:  Oops... :-[ I forgot what inheritance was... Got it confused with something else (obviously).
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Tue 24/05/2005 19:33:48
That's because structs (and therefore inheritance) are unofficial features and are so not documented.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Tue 24/05/2005 19:53:10
So are you saying that they aren't "officially" supported?  Kind of like the way defining a struct in a header file allows you to create an item of that type within another struct?
Title: Problem with the visibility of objects!!
Post by: Ozzie on Fri 27/05/2005 20:17:44
Well, I found a strange bug and I suppose it's caused only in AGS 2.7 because I never had it with AGS 2.62.

Well, it's actually a simple problem, I have 4 objects in my room, but only two show up! I can do what I want, delete all the script that is concerned about the objects, didn't work, deleted all the objects and created them again, it was still there. Even more strange is that it were always the same objects, more precisely, only the same pictures, because the objects numbers were different the next time.

Then I just created a new room with everything the same, the same background and objects, and it worked.

Oh, I forgot to say, "object is initially visible" is on.

I would just use the new room, but I don't want to draw the walkbehinds again....it was quite some work!
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Fri 27/05/2005 20:49:29
Are you sure you don't have any script commands which are turning the objects off?
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Ozzie on Fri 27/05/2005 21:52:43
Yes, I'm very sure because I deleted every possible command in that room!!

Edit: I'm going to draw a new walkbehind, don't know how to continue else with the game. At least you know of the problem!
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Sun 29/05/2005 14:23:16
I found a problem in the manual...An entry appears to have been cut short:

QuoteCalling global functions from local scripts
You can now call your global script functions directly from your rooms. This means that if you have a common script that you want to use in response to various different events during the game, you can call it from your room scripts rather than duplicating code.
To use a global function, open up the main script header (the "Edit script header" option on the Game menu), and add a line similar to the following:

import function my_function_name (parameters);

Where my_function_name is the name of the global script function, and parameters is a list of the TYPES ONLY of the parameters it takes. For example, if you had in your global script:
function do_animation (int anim_number) {

then you would write:
import function do_animation (int);

To use the function, you just call it normally in your script, eg:
do_animation (3);

You can also return a value to the caller by using the "return" statement, and the local script picks this up the same way it does with built-in functions. For example, the end of your global script function could be:
return 51;

then the local script just does:

That's all it says.  I searched for "return value" because I was trying to figure out if returning a string is possible* when I came across this.

*I had previously thought this was possible, but I got an error when a member function of a struct tried to return "this.text" saying that you can't return a local string.  I was trying to protect the char[] (string) to prevent users from changing it as this particular struct is designed to return information about the dialog option currently shown on a label, but I don't appear able to do so.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Mon 30/05/2005 15:50:45
Quote from: Ozzie on Fri 27/05/2005 21:52:43
Yes, I'm very sure because I deleted every possible command in that room!!

Edit: I'm going to draw a new walkbehind, don't know how to continue else with the game. At least you know of the problem!

Any chance you could upload the problem room so I can take a look at it?

QuoteThat's all it says.  I searched for "return value" because I was trying to figure out if returning a string is possible* when I came across this.

I just loaded that page in the help file and it ended with:

then the local script just does:
int value = do_animation(3);


as it's supposed to.

In answer to your other question, you cannot return strings from functions. This is because strings are not assigned with normal operators but must be copied with StrCopy etc, so functions should have a "string buffer" parameter if they need one, rather than returning it.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Mon 30/05/2005 21:48:49
Well technically it wasn't a "string", it was a char[200].  I've returned a char[200] before and copied it to a temporary variable with StrFormat(temp, "%s", GetOptionText(optionbuffer)) (see Scrolling Dialog Template for reference).  It worked with 2.62...  Anyway, I'll probably add a buffer parameter so that I can protect the text (on the label) from being changed by the users.  Especially now that I have made the OptOnLabel object global...

And as to the apparent error, perhaps I should make sure that the window isn't bigger than the screen first...
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Thu 02/06/2005 19:38:23
Returning arrays from functions isn't supported, so it shouldn't work unfortunately.


Anyway, I think enough time has passed now to officially release 2.7. However, first I need people to update their mirrors with the latest ags_27.zip so that I can update the download page.

Anyone who has some webspace to mirror the file is welcome to do so. If you are mirroring the download, please make sure you have Refresh 2 (v2.70.601 in the editor About box).
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Fri 03/06/2005 03:38:19
Quote from: Pumaman on Thu 02/06/2005 19:38:23Returning arrays from functions isn't supported, so it shouldn't work unfortunately.

Hmm... But yet it did work.  Oh well.  I did away with that function a long time ago.  And I can add the buffer parameter to the member function.  Thanks for the help Chris.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: simulacra on Mon 06/06/2005 19:49:39
Umm... just to make things clear: the 2.7 Refresh 2 has no DOS support, right? And there will be no DOS support in the future unless there is a protesting crowd of streakers blocking your front door shouting give me a D... D!!! Give me an O... O!!! And a S! ... S!!!

Is that correct?
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Mon 06/06/2005 21:25:31
That's correct.

I'd prefer nude models to streakers, but either way would work.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: simulacra on Mon 06/06/2005 22:59:09
Right. All ARGsers send nude photos to me.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Rui 'Trovatore' Pires on Tue 07/06/2005 07:46:59
 That reminds me of something...  (http://www.vgcats.com/comics/?strip_id=112)
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Gilbert on Tue 07/06/2005 08:03:23
/me takes off his clothes immediately...

The protestors' photos should be posted here (http://www.sylpher.com/dosuser/).
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Tue 07/06/2005 17:46:00
Quote from: Gilbot V7000a on Tue 07/06/2005 08:03:23
The protestors' photos should be posted here (http://www.sylpher.com/dosuser/).

That is the most amazing thing I have ever seen. :'( :'( :'( :'( :'(  These are tears of joy my friend...tears of joy...

Edit:  I just noticed how bad that sounded... -- Edited the quote.

Edit:  I have discovered something of a problem, let's see if you see it:

/* Something header file */
struct MyStruct {
  import function doSomething();
  /* other stuff */
  };

struct MyOtherStruct {
  import function doSomethingElse();
  int MyStruct;
  /* other stuff */
  };


Did you catch that?  I used the name of a previously declared struct as the name of a data member.  And it compiled.  Perhaps it's just me, but that doesn't seem right...

Also, has function always been an optional word instead of defining the return type (i.e., I was just thinking about it, in the manual the return types of functions like GetAtScreenXY are listed instead of "static function", and when testing it, I found out I can do it too!)?  Or is this something that slipped through the cracks by accident?

Edit:  Also, when playing a video in WMP, I have found that I have a GUI background image which is partially replaced by the video (where ever the video is at behind a certain color in the GUI, it gets replaced by the video...  And I guess that since it worked in 2.62, using the return type in place of function has been implemented for a while.  Actually I think the video thing has nothing to do with AGS as taking a screenshot and pasting it into Photoshop continues to display the streaming video (where possible) in place of one specific color...
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: SSH on Fri 10/06/2005 09:25:17
Quote from: monkey_05_06 on Tue 07/06/2005 17:46:00
Did you catch that?  I used the name of a previously declared struct as the name of a data member.  And it compiled.  Perhaps it's just me, but that doesn't seem right...

I think its normal that that is allowed. MyOtherStruct.MyStruct is unambiguously an int.

Quote
Also, has function always been an optional word instead of defining the return type (i.e., I was just thinking about it, in the manual the return types of functions like GetAtScreenXY are listed instead of "static function", and when testing it, I found out I can do it too!)?  Or is this something that slipped through the cracks by accident?

If you look through the AGS editor files with a text editor, you can find the sekrit builtin header, including the giveaway line:

#define function int
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: Pumaman on Sat 11/06/2005 18:38:41
QuoteDid you catch that?  I used the name of a previously declared struct as the name of a data member.  And it compiled.  Perhaps it's just me, but that doesn't seem right...

Because struct members are always accessed with a dot, you'll probably get away with it. Interesting point though, I'm not sure whether that should be made illegal.

QuoteAlso, has function always been an optional word instead of defining the return type (i.e., I was just thinking about it, in the manual the return types of functions like GetAtScreenXY are listed instead of "static function", and when testing it, I found out I can do it too!)?  Or is this something that slipped through the cracks by accident?

As SSH says, function = int. It's the default return type.

QuoteEdit:  Also, when playing a video in WMP, I have found that I have a GUI background image which is partially replaced by the video (where ever the video is at behind a certain color in the GUI, it gets replaced by the video...

Yes, when playing a video overlay DirectX selects one particular colour as the overlay colour, and the graphics card overlays the video onto any parts of the screen with that colour. Nothing AGS can really do about it.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: monkey0506 on Sat 11/06/2005 20:30:07
Thanks for the help.  As for the struct name as a data member, the reason that I thought it shouldn't work is because if struct within struct support is ever supported then the name of the struct that you're trying to use as the name of a data member would be interpreted as a variable type.

I figured it would be equivalent to me typing something like:

struct StructType {
  char int[200];
  };

Not ambiguous, but I don't think it should work.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: edmundito on Tue 14/06/2005 21:06:50
Hey, can I actually put those optional parameters into my own methods/functions? I couldn't find it in the manual.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: strazer on Wed 15/06/2005 13:54:01
Yes. In the function import definition, simply set a default value to the variable like this:


// main script

function DoSomething(int vara, int varb) {
  // do something
}



// script header

import function DoSomething(int vara, int varb=3); // varb will be optional
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: edmundito on Thu 16/06/2005 22:38:57
Thanks!

Now, more questions:

How many modules can you have in a single game? And from the  global script can I access the functions inside the modules? Or must they be imported in the module header first?
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: strazer on Thu 16/06/2005 22:56:21
They must be imported into the module header to be accessible outside the module.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: edmundito on Fri 17/06/2005 00:39:28
Thanks!

I'm making sure that I don't try anything dumb first.  :=
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: edmundito on Fri 17/06/2005 19:31:52
Oh no! I found a typo on ags-help!

In the section "Upgrading AGS 2.7", under "Is there anything I should watch out for?", there is a link to a seperate page... (it should be spelled separate, btw  ;)). Same on this page: http://www.adventuregamestudio.co.uk/manual/UpgradingTo27.htm

And another thing, I can't find on the index or the search page for the section on structs, if there is one.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: strazer on Fri 17/06/2005 19:43:48
Quote from: Pumaman on Tue 24/05/2005 19:33:48
(...) structs (and therefore inheritance) are unofficial features and so are not documented.
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: edmundito on Sat 18/06/2005 17:20:29
But structs are the best thing that happened to AGS since sliced bread!  :=
Title: Re: AGS v2.7 Refresh 2 now released!
Post by: GarageGothic on Mon 20/06/2005 12:17:47
I agree with netmonkey that structs rock. How about an unofficial documentation? ;)

Edit: Actually, I would like a better documentation of some features. They may seem obvious to C++ programmers, but I don't believer neither "bool" nor "define" are listed in the manual. I don't know what other there are.