- Game Maker Community
- → Viewing Profile: Topics: Necromian
Necromian
Member Since 30 Apr 2006Offline Last Active Apr 04 2013 05:15 PM
Community Stats
- Group GMC Member
- Active Posts 991
- Profile Views 3031
- Member Title GMC Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Female
-
Location
Amsterdam
Latest Visitors
Topics I've Started
Lost Ability To Export To Standalone .Exe
12 March 2013 - 12:54 AM
variable_global_set
18 January 2013 - 10:58 PM
I was using variable_global_set to save and load the state of objects in rooms on the fly. When the player enters a room, each object would generate a unique id based on the room, the type of object, and its x/y coordinate. For example, an object in room 6 with type 1 at (30,62) would have a global variable of "objvar_6_1_30_62". The object would then check if a global variable of this name exists, and if it does, then load the variable (or array) and change its state (so it would load a value from the variable, like its previous hp). If the variable doesn't exist, then the object would create it with a default value. Then, when the room ends, the object will save its state back into the global variable (like saving the hp to it), so that way the next time the player enters the room, the object will have the same hp.
Since the variable_set and variable_get functions are now obsolete, I'm looking for a way to replace them. My only idea right now would be to make every object persistent, and simply deactivate them when they're not in the right room. Then, if the player enters a room for the 2nd...* time, then the object would activate and destroy the pre-existing one in the room.
However, there has to be a better way than this.
A few errors
25 July 2012 - 09:41 PM
Firstly, whenever I try to save my game as a project, I get the error "The system cannot find the path specified", followed by "An error occured while saving project"
I also get this error when I try compiling one of my games. It always happens right after the compiler is done converting the sound files to .OGG.
Error : Exception : System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at GMAssetCompiler.HTML5Saver.<WriteDataFiles>b__34(KeyValuePair`2 _kvp, TextWriter __s, Int32 __n)
at GMAssetCompiler.HTML5Saver.WriteDataKVP[T](IList`1 _data, TextWriter _s, WriteDelegateKVP`1 _del)
at GMAssetCompiler.HTML5Saver.WriteDataFiles(IList`1 _datafiles, TextWriter _s)
at GMAssetCompiler.HTML5Saver.Save(GMAssets _assets, TextWriter _s)
at GMAssetCompiler.HTML5Saver.Save(GMAssets _assets, String _name)
at GMAssetCompiler.Program.Main(String[] _args)
I've installed on two computers and I have the same problem both times. I'm wondering if anyone else has run into this problem, and has any suggestions on what to do. The saving error is universal, but the exception only happens when I try compiling one of my old games (it used to use included files, but I deleted those to see if it would fix the problem. It didn't)
Finding the point of collision along a line
31 January 2012 - 05:55 PM
So I want to find the point along a collision line that obj_a collides with obj_b. If there is any function to do this then it would be a huge lifesaver right now.
Currently I'm using a function I wrote to find out where the collision point is, but it involves using a binary search-esque method where I create a dynamic mask that's half the size of the collision line, and then shrink it in half repeatedly until I find the point where it is no longer colliding. The problem is that this has to happen every frame of the game, and it slows down fps significantly.
Edit : Maybe I can use move_contact with a 1x1 pixel mask to do it? Will there be any speed issues in using this?
Editx2 : I've solved this on my own using the move_contact method. I'll keep this topic open though so that people can search for it in the future if they have a similar question.
Drawing part of a sprite
22 November 2011 - 11:03 PM
So basically I want to draw a part of a sprite, as defined by the coordinates of a rectangle. If I have a sprite of a landscape, and I define the corners of the drawing rectangle to some points within the landscape, then I want only the portion of the landscape INSIDE of the rectangle to be drawn.
I think that this can be achieved using draw_sprite_part, but that code specifically seems to have problems doing what I want it to do. I think an easier approach might be to use textured primitives to draw a portion of the sprite, but there are issues with that as well, especially when moving the landscape or the drawing rectangle. An added bonus to the textured primitives approach would be the easy ability to change orientation of the sprite by simply flipping coordinates. Anyways, does anyone have any pointers or solutions for me?
(I think I actually figured out how to do this a couple of years ago when making a signature making program, but somehow my files got corrupted and I can't get the source anymore.)
- Game Maker Community
- → Viewing Profile: Topics: Necromian
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content