GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2009-07-04 09:42:13

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

GM8 - Things that work differently than GM7

I was doing some benchmarks with GM8 and ran into some script problems. Turns out the "What is New" section of the GM8 BETA Help File is not very complete. I've only begun to look but there are MANY things that work differently in GM8. I'll post them as I find them.

The Game Maker 8 Beta is available here: http://glog.yoyogames.com/?p=546

Browse the entire GM8 Help File here: http://www.gmlscripts.com/gm8beta2/

The list of changes in the following posts would not be possible without the excellent help of WinMerge and the Microsoft Help WorkshopThe Regulator was also instrumental in parsing and transcoding the table of contents into HTML. Agent Ransack was very helpful in finding specific elements in the many pages of the help file. Finally, thanks go to Matt Kruse for his DHTML Tree  script.


Here are some changes to the IDE:

  • Code Editor is completely new, I'm probably not going to cover that here.

  • Sprite Editor is completely new, I'm probably not going to cover that here.

  • Background Editor is completely new, I'm probably not going to cover that here.

  • Import/Export feature is also completely new. I'll leave that to the Help File to explain. I will mention that it replaces Merge Game, which is no longer available.

  • Global Game Settings now has an option to disable screen savers and power management.

  • Global Game Settings screenshot on <F9> option now saves as PNG instead of BMP.

  • Time Line panel has a new Spread feature. More info below.

Here are some changes to the available Actions:

  • Open Web Page Action has been removed.

  • There are several new Splash Actions (including one for local or remote HTML).

  • There are some new Time Line Actions for controlling playback.[/li]

Last edited by xot (2009-07-24 12:17:51)


Abusing forum power since 1986.

Offline

#2 2009-07-04 10:03:21

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > COMPUTING THINGS > REAL-VALUED FUNCTIONS

These are new functions to GM8:

random_range(x1,x2) Returns a random real number between x1 (inclusive) and x2 (exclusive).
irandom(x) Returns a random integer number between 0 and x (inclusive when x is an integer).
irandom_range(x1,x2) Returns a random real number between x1 (inclusive) and x2 (inclusivee). Both x1 and x2 must be integer values (otherwise they are rounded down).


Abusing forum power since 1986.

Offline

#3 2009-07-04 10:05:26

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > GAME PLAY > TIMING

The first one works differently, the other two are new to GM8:

timeline_speed Normally, in each step the position in the time line is increased by 1. You can change this amount by setting this variable to a different value. You can use real numbers like 0.5. If the value is larger than one, several moments can happen within the same time step. They will all be performed in the correct order, so no actions will be skipped. You can also use a negative value to let the time line play backwards.
timeline_running Indicates whether the time line is running (true) or paused or stopped (false). You can change this variable to run or stop the time line.
timeline_looping Indicated whether the time line is looping (true) or not (false). You can change this variable to switch looping on or off.


Abusing forum power since 1986.

Offline

#4 2009-07-04 10:09:08

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > GAME PLAY > GENERATING EVENTS

This paragraph clarifies the event order:

As you know, Game Maker is completely event driven. All actions happen as the result of events. There are a number of different events. Creation and destroy events happen when an instance is created or destroyed. In each step, the system first handles the begin step events. Next it handles the alarm events, keyboard and mouse events and next the step event. After this the instances are set to their new positions after which the collision event is handled. Finally the end step events are handled after which the draw event is used to draw the instances (note that when there are multiple views the draw event is called multiple times in each step). You can also apply an event to the current instance from within a piece of code.

There is a new event type:

Finally for the ev_trigger event type you should use the constants that you can specify when defining these events.


Abusing forum power since 1986.

Offline

#5 2009-07-04 10:18:45

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GM8 > GAME GRAPHICS > DRAWING SHAPES

The screen save functions now save PNG instead of BMP.

screen_save(fname) Saves a png image of the screen in the given filename. Useful for making screenshots.
screen_save_part(fname,x,y,w,h) Saves part of the screen in the given png filename.

GML > GAME GRAPHICS > DRAWING SURFACES

Surfaces are now saved as PNG instead of BMP.

surface_save(id,fname) Saves a png image of the surface in the given filename. Useful for making screenshots.
surface_save_part(id,fname,x,y,w,h) Saves part of the surface in the given png filename.


Abusing forum power since 1986.

Offline

#6 2009-07-04 10:26:12

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > SPLASH SCREENS, HIGHSCORES AND OTHER POP-UPS> SPLASH SCREENS

Text splash screens can no longer contain images. There is a new splash screen for local or remote HTML, which can naturally display images. It does this via embedding Internet Explorer into the game window. It didn't work right for me the first time (blank page after partial load over internet) but this is Internet Explorer we're talking about here.

splash_show_text(fname,delay) Shows a text splash screen. fname is the name of the text file. You can either display standard text files (.txt) or rich text files (.rtf). Only part of the rich text features are taken into account. E.g. images and other embedded objects are not shown. delay indicates the delay in milliseconds before returning to the game. use 0 to wait until the player presses the escape key or clicks with the mouse in the window.
splash_show_web(url,delay) Shows a web page splash screen. url is the url of the webpage (starting with http://) or it is the file name for a local html file. Note however that you must provide the full path for this to work. So you best e.g. use as url something like working_directory + "\index.html". delay is the delay in milli seconds before returning to the game.

This is new:

splash_set_close_button(show) Indicates whether to show a close button in the top right corner of the splash screen. This is useful when running games in full screen mode or without a border. Default the value is true.


Abusing forum power since 1986.

Offline

#7 2009-07-04 10:32:52

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > RESOURCES > SPRITES

These functions have been deprecated:

sprite_get_bbox_mode(ind) Returns the bounding box mode (0=automatic, 1=full image, 2=manual) of the sprite with the given index.
sprite_get_precise(ind) Returns whether the sprite with the given index uses precise collision checking.

As expected, sprites are saved as PNG rather than BMP now. There is a new function to save a sprite strip. Nice.

sprite_save(ind,subimg,fname) Saves subimage subimg of sprite ind to the file with the name fname. This must be a .png file. Only available in the Pro Edition.
sprite_save_strip(ind,fname) Saves all subimages of sprite ind as a strip to the file with the name fname. This must be a .png file. Only available in the Pro Edition.


Abusing forum power since 1986.

Offline

#8 2009-07-04 10:35:10

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > RESOURECE > BACKGROUNDS

These functions have been deprecated:

background_get_transparent(ind) Returns whether the background with the given index is transparent.
background_get_smooth(ind) Returns whether the background with the given index has smoothed edges.
background_get_preload(ind) Returns whether the background with the given index must be preloaded.

Again, PNG instead of BMP saving for backgrounds.

background_save(ind,fname) Saves the background ind to the file with the name fname. This must be a .png file. Only available in the Pro Edition.


Abusing forum power since 1986.

Offline

#9 2009-07-04 10:43:46

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > CHANGING RESOURECES > SPRITES

These functions have been deprecated:

sprite_set_bbox_mode(ind,mode) Sets the bounding box mode of the sprite (0=automatic, 1=full image, 2=manual).
sprite_set_bbox(ind,left,top,right,bottom) Sets the bounding box of the sprite with the given index. Works only when the bounding box mode is manual.
sprite_set_precise(ind,mode) Sets whether the sprite with the given index uses precise collision checking (true or false).

All of these functions have different arguments and may work differently:

sprite_add(fname,imgnumb,removeback,smooth,xorig,yorig) Adds the image stored in the file fname to the set of sprite resources. Many different image file types can be dealt with. When the image is not a gif image it can be a strip containing a number of subimages for the sprite next to each other. Use imgnumb to indicate their number (1 for a single image). For (animated) gif images, this argument is not used; the number of images in the gif file is used. removeback indicates whether to make all pixels with the background color (left-bottom pixel) transparent. smooth indicates whether to smooth the edges. xorig and yorig indicate the position of the origin in the sprite. The function returns the index of the new sprite that you can then use to draw it or to assign it to the variable sprite_index of an instance. When an error occurs -1 is returned.
sprite_replace(ind,fname,imgnumb,removeback,smooth,xorig,yorig) Same as above but in this case the sprite with index ind is replaced. The function returns whether it is successful.
sprite_create_from_screen(x,y,w,h,removeback,smooth,xorig,yorig) Creates a sprite by copying the given area from the screen. removeback indicates whether to make all pixels with the background color (left-bottom pixel) transparent. smooth indicates whether to smooth the boundaries. This makes it possible to create any sprite you want. Draw the image on the screen using the drawing functions and next create a sprite from it. (If you don't do this in the drawing event you can even do it in such a way that it is not visible on the screen by not refreshing the screen.) The other parameters are as above. The function returns the index of the new sprite. A work of caution is required here. Even though we speak about the screen, it is actually the drawing region that matters. The fact that there is a window on the screen and that the image might be scaled in this window does not matter.
sprite_add_from_screen(ind,x,y,w,h,removeback,smooth) Adds an area of the screen as a next subimage to the sprite with index ind.
sprite_create_from_surface(id,x,y,w,h,removeback,smooth,xorig,yorig) Creates a sprite by copying the given area from the surface with the given id. removeback indicates whether to make all pixels with the background color (left-bottom pixel) transparent. smooth indicates whether to smooth the boundaries. This makes it possible to create any sprite you want. Draw the image on the surface using the drawing functions and next create a sprite from it. The function returns the index of the new sprite. Note that alpha values are maintained in the sprite.
sprite_add_from_surface(ind,id,x,y,w,h,removeback,smooth) Adds an area of the surface id as a next subimage to the sprite with index ind.

Functions sprite_add_alpha and sprite_replace_alpha have been replaced:

sprite_add_sprite(fname) Adds the sprite stored the file fname to the set of sprite resources. The file must be a .gmspr file that is saved in the sprite property form in Game Maker. As this file contains all sprite settings, no further arguments are required. The function returns the index of the new sprite that you can then use to draw it or to assign it to the variable sprite_index of an instance. When an error occurs -1 is returned.
sprite_replace_sprite(ind,fname) Same as above but in this case the sprite with index ind is replaced. The function returns whether it is successful.

This function is new and has some very interesting features. EDIT: This definition is no longer correct (see below).

sprite_collision_mode(ind,sepmasks,kind,tolerance,enlarge) Changes the collision mask for the sprite with index ind. sepmasks indicates whether there must be separate collision masks for all subimages. kind is the kind of mask (0=precise, 1=fill image, 2=bounding box, 3=disk). tolerance indicates the tolerance in the transparency value (0=no tolerance, 255=full tolerance). enlarge indicates with how many pixels to enlarge the mask (use negative values to shrink it.

EDIT: There have been some changes to this last function in the next beta. See here:
http://www.gmlscripts.com/forums/viewto … 1851#p1851

Last edited by xot (2009-07-20 21:36:51)


Abusing forum power since 1986.

Offline

#10 2009-07-04 10:56:56

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > CHANGING RESOURCES > BACKGROUNDS

These functions have new arguments and may work differently:

background_add(fname,removeback,smooth) Adds the image stored in the file fname to the set of background resources. Many different types of images can be dealt with. When the image has an alpha channel, this is used for transparency. removeback indicates whether to make all pixels with the background color (left-bottom pixel) transparent. smooth indicates whether to smooth the boundaries. The function returns the index of the new background that you can then use to draw it or to assign it to the variable background_index[0] to make it visible in the current room. When an error occurs -1 is returned.
background_replace(ind,fname,removeback,smooth) Same as above but in this case the background with index ind is replaced. The function returns whether it is successful. When the background is currently visible in the room it wil be replaced also.
background_create_color(w,h,col) Creates a background of the given size and with the given color. It returns the index of the new background. When an error occurs -1 is returned.
background_create_gradient(w,h,col1,col2,kind) Creates a gradient filled background of the given size. col1 and col2 indicate the two colors. kind is a number between 0 and 5 indicating the kind of gradient: 0=horizontal 1=vertical, 2= rectangle, 3=ellipse, 4=double horizontal, 5=double vertical. It returns the index of the new background. When an error occurs -1 is returned.
background_create_from_screen(x,y,w,h,removeback,smooth) Creates a background by copying the given area from the screen. removeback indicates whether to make all pixels with the background color (left-bottom pixel) transparent. smooth indicates whether to smooth the boundaries. This function makes it possible to create any background you want. Draw the image on the screen using the drawing functions and next create a background from it. (If you don't do this in the drawing event you can even do it in such a way that it is not visible on the screen by not refreshing the screen.) The function returns the index of the new background. A work of caution is required here. Even though we speak about the screen, it is actually the drawing region that matters. The fact that there is a window on the screen and that the image might be scaled in this window does not matter.
background_create_from_surface(id,x,y,w,h,removeback,smooth) Creates a background by copying the given area from the surface with the given id. removeback indicates whether to make all pixels with the background color (left-bottom pixel) transparent. smooth indicates whether to smooth the boundaries. This function makes it possible to create any background you want. Draw the image on the surface using the drawing functions and next create a background from it. Note that alpha values are maintained in the background.

Functions background_add_alpha and background_replace_alpha have been replaced:

background_add_background(fname) Adds the background stored the file fname to the set of background resources. The file must be a .gmbck file that is saved in the background property form in Game Maker. As this file contains all background settings, no further arguments are required. The function returns the index of the new background that you can then use to draw it or to assign it to the variable background_index[0] to make it visible in the current room. When an error occurs -1 is returned.
background_replace_background(ind,fname) Same as above but in this case the background with index ind is replaced. The function returns whether it is successful. When the background is currently visible in the room it wil be replaced also.


Abusing forum power since 1986.

Offline

#11 2009-07-04 11:02:59

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GML > CHANGING RESOURCES > TIME LINES

This is a new function:

timeline_clear(ind) Clears the time line with the given index removing all its moments. Make sure no instances uses the time line at the moment.


Abusing forum power since 1986.

Offline

#12 2009-07-04 11:16:28

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

Looks like the LITE version of GM8 has been further crippled vs older versions.

Creating new Constants is now a PRO ONLY feature. Dumb.

Last edited by xot (2009-07-23 01:01:53)


Abusing forum power since 1986.

Offline

#13 2009-07-04 11:20:16

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

A new feature has been added to the Time Lines panel:

Spread. Use this button to spread out a range of moments by adding time between them or put them closer together by removing time between them. You specify the start and the end of the range and the percentage for the spread. A percentage of 100 means nothing changes. For values smaller than 100 the moments are moved closer together and for values larger than 100 they are moved further apart. For example if you have moments at timesteps 5, 8, and 12 and you indicate a s range 5:12 and a percentage 200, the moments will move to time staps 5, 11, and 19. (The intervals between them have doubled.)


Abusing forum power since 1986.

Offline

#14 2009-07-18 13:28:32

Caniac
The #1 Caniac
From: Raleigh NC, usa
Registered: 2009-05-08
Posts: 8
Website

Re: GM8 - Things that work differently than GM7

Wow, thats a Lot of changes!


Xot is Awesome!
GMVision is Awesome Too!

Offline

#15 2009-07-18 14:46:16

The 11th plague of Egypt
Member
Registered: 2009-07-18
Posts: 2

Re: GM8 - Things that work differently than GM7

BUT. Are there any changes to the room editor? It really needs the option to zoom in/out.
Also, it would be useful to visually rotate objects, instead using the creation code to do such a thing.

They also promised in the blog that it would have been the first thing to be changed.

BTW first post, hello everybody!

Last edited by The 11th plague of Egypt (2009-07-18 14:48:47)

Offline

#16 2009-07-19 03:15:14

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

The room editor could certainly be a lot more powerful with only a few small changes. After seeing the amount of effort put into the sprite editor, I'm hopeful that the room editor will get a similar upgrade one day. The next GM8 BETA is supposed to be released this week. It seems unlikely it will have any new features but why not dare to dream?

Welcome aboard!


Abusing forum power since 1986.

Offline

#17 2009-07-20 08:00:23

The 11th plague of Egypt
Member
Registered: 2009-07-18
Posts: 2

Re: GM8 - Things that work differently than GM7

I really hope they fix that. You can edit sprites with an external spite editor, but there is no such thing as an external room editor.

We could request that through the Mantis report system. I'll do.

EDIT: the room zoom has been reported as a wish and marked as "resolved".
Mark thinks "no change required" WTH ?!
Let's report the object rotation then. It should be fairly easy to implement.

And Mark is the only programmer actually fixing bugs. What's YoYo Games all about then ? A website ?
I still remember how they got me subscribed, they told they wanted to move the whole GMC to the new site.

Last edited by The 11th plague of Egypt (2009-07-20 08:38:22)

Offline

#18 2009-07-20 18:03:55

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

I wouldn't bother. He's already said he's done taking feature requests and beta software is expected to be feature-complete.

If Mark is the sole maintainer of Windows GM7 I would guess that it is because he is the only one who has coded it. The others appear to be working on the port of the IDE to Mac, and the port of the runner to C/C++, and placing increasingly bad adverts on the YoYo site (I'm looking at you, Evony).

Oh, but lookie here, the new beta is out. I'm impressed they got it out the door on time.

http://glog.yoyogames.com/?p=548


Abusing forum power since 1986.

Offline

#19 2009-07-20 20:46:39

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

Game Maker 8 Beta 2 Changes

Several new interesting changes to note. Here are a few related to how our creations operate. I'll be following up with more details about some of them. There are also many other changes related to the IDE that I probably won't be covering here. See the full list here.

Game Maker News > Changes wrote:
  • Increased the limit on the number of vertices in drawing 3D primitives for models from 1000 to 32000.

  • Corrected a bug in ignoring z-value for model vertices.

  • Corrected the Outside View and Boundary View events.

  • When the game window looses focus, io events like key presses are now cleared.

  • Game will now run (with warning) when there is no enabled sound card.

  • Less problems with Out of Memory errors when loading and saving games or executables. Unfortunately I had to change the file format for this.

  • Added a variable gamemaker_version. Current value is 800.

  • You can now use high quality icons for your games.

  • Added functions disk_size(drive) and disk_free(drive).

  • Collision mask definition has been changed. Makes it compatible with past and adds bounding box options back in (plus possibility to draw them with mouse).

  • Changed the window caption to first show the name of the game. Also show this correctly in the Task Bar.

Last edited by xot (2009-07-23 01:03:04)


Abusing forum power since 1986.

Offline

#20 2009-07-20 20:59:41

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: GM8 - Things that work differently than GM7

GAME MAKER IDE > SPRITE EDITOR

Several tools in the new sprite editor have quietly become "Pro" only inluding some older ones that were once free. It's dissappointing to see this continue to happen.

  • Set Alpha from File

  • Outline (♫ Born free ... ♪)

  • Shadow

  • Glow

  • Buttonize

  • Gradient Fill (♪ ... as free as the wind blows. ♫)

http://www.gmlscripts.com/gm8beta2/help … iting.html


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB