Daniel Mallett
Member
Sorry, dumb question but how do I get the beta. I switched to the beta channel but it says v2.2 still.
I believe you're describing what FrostyCat has already taken care of here, check it out:Anyone has an opinion on using the native data structures vs wrapping them into custom structs to turn them more like objects?
The lightweight data structures library that I have been working on since the beginning of the month is finally complete: https://github.com/dicksonlaw583/LightweightDataStructures
There are a couple of regressions from the last runtime to the current one that prevents the library from showing its full potential. But at the very least it's ready for an open beta showing what the new OOP features can offer.
And FrostyCat's version for JSONs as structs is here: https://github.com/dicksonlaw583/JsonStruct I'm definitely going to be using these.I think FrostyCat did the same as well
Very first post in this thread has a link to the blog where you can apply:Sorry, dumb question but how do I get the beta. I switched to the beta channel but it says v2.2 still.
So setting your v2.2 IDE to opt into the beta is nothing related to v2.3.Just to note, there is no longer a separate “beta branch” to opt into – this Beta install is a secondary installation and does not share info with your 2.2.5 install, so you don't need to modify your existing GMS2 setup in order to take part.
They are now 1D arrays, but you can use chained accessories, so in practice they can be any dimension. Like "Array[0][5][3][9][12] = 0;" would be 5 dimensional array.Is anyone else upset about the removal of 2d arrays? When I started to read the article I thought that it was going to say we now have 3d arrays. I thought yessss finally. But no they have gone the other way.
Those are error catching, not error reporting functions. I don't know any programming language which offers it out of box. You still need to write "report" part by yourself, but that would be much much easier now.Does anyone know if the new error catching functions will connect to a sentry account or will I still have to use tools like yellow afterlife and other market place tools?
a = function() { }
typeof( a ) // method
function b() { }
typeof( b ) // number
Only functions declared the first way becomes methods (i.e. anonymous functions). Functions declared the second way with a name become scripts, which are referenced using IDs.What the hack is going on here?GML:a = function() { } typeof( a ) // method function b() { } typeof( b ) // number
Are there any substantial advantages to saving the function as a variable apart getting the id?Only functions declared the first way becomes methods (i.e. anonymous functions). Functions declared the second way with a name become scripts, which are referenced using IDs.
I've raised this issue before at the beta forums, and the answer is that YoYo is doing this for backwards compatibility with code relying on scripts being numeric IDs. I'm not satisfied with the answer any more than you are, but that's the way it'll be for GMS 2.3.
If you don't update to the 2.3.0 version when it goes stable and you find a bug in 2.5.x, if that bug exists in 2.3.x then it will be fixed in 2.3.x. If it doesn't then it won't be fixed in 2.5.x as it's already been fixed (or doesn't exist) in the current 2.3.x version. Either way, you'll need to update or work around it, as YYG are not going to support two versions of the same software going forward.1) How long will there be support for what is now the current version of GMS2 beyond release of the new version?
Everything should be the same as before and you shouldn't notice any difference.2) Regarding the new origin marker for sprites in the sprite editor, will changing a project over to the new version disrupt the placement of assets which had previously been dragged into rooms in the former GMS2 version?
As above! Should all be the same...3) Will the grid/grid "snapping" means of manual room/sprite editing still be available in the new version...? For example, I have the room grid set on snap 128x128 for my assets layer and 64x64 for my instances layer... Will that still work?
The only reason I can think of that it is advantageous as a variable is simply to be able to copy the reference around. Previously you could copy around the name of the script in a variable and then execute it with script_execute(). Now you can simply copy the function variable and call it directly with parenthesis. Both of these things are quite useful.Are there any substantial advantages to saving the function as a variable apart getting the id?
thanks for the full-bodied answer, I hope a full tutorial will come out later that shows the full potential of this new version.The only reason I can think of that it is advantageous as a variable is simply to be able to copy the reference around. Previously you could copy around the name of the script in a variable and then execute it with script_execute(). Now you can simply copy the function variable and call it directly with parenthesis. Both of these things are quite useful.
One use is in a state machine kind of thing. Instead of making multiple objects for the different states your thing is in, and instead of running different code based on a switch statement, you can simply set a variable equal to whatever function should be getting called each step, and then call that each step based on the variable. Then, if you change states(jumping turning to falling), you can simply change that variable.
Another use is if you use parent/child objects (or a single object and instnace creation created variables) for things like enemies or buttons. In the case of the buttons, you can make a parent button that has the event handling for mousing over, etc... and then the children objects(or the instance creation code) sets variables for what function to call when the button is actually clicked. This lets you keep only one copy of all the code for buttons, and then the code that varies can be kept separate.
Last example...callbacks. In my input system for example, you set it to be searching for an input(so they player hits the key they want to use for the jump action for example). The game doesn't freeze, rather an object just does the search behind the scenes. Then, it calls a function depending on whether it eventually got a key pressed and set the input, or if the search timed out because it took too long. And when you start the searching, you pass in as arguments what functions you made for that purpose, and it then calls them using those references, so you can remove the text telling the user to hit a key.
You don't like it? What could be better than infinite-dimension arrays?I see what they have done. I'll have to get used to it but I don't like it.
Once the beta goes full open instead of the current semi-open, you'll be able to post things on the forum and I'll be making a topic somewhere for you all to showcase creations.It would be cool if there was a forum thread for sequences that we could submit to or watch to see how others have used it.
Wait, are we not allowed to post stuff we make in Sequences right now?Once the beta goes full open instead of the current semi-open, you'll be able to post things on the forum and I'll be making a topic somewhere for you all to showcase creations.
//Create Event
inputs=
{
dir :
{
right=
{
key : ord("D"),
chk : false,
};
left=
{
key : ord("A"),
chk : false,
};
}
};
colon, not equali am trying to create an engine with nested structures but i am failing ... is there a way to fix this piece of code? Thank you all!
Code://Create Event inputs= { dir : { right= { key : ord("D"), chk : false, }; left= { key : ord("A"), chk : false, }; } };
Nice way to do to that, I hadn't thought of it. You just have to add on the falling part either when the curve ends or the button is release, and check for collisions.I got a chance to tinker around with the beta yesterday. I used an animation curve to control jump characteristics like Super Mario 2. Just by changing the curve, and a jumptime variable, I made my object jump like Princess Peach. Very cool!
For the falling part, I kept track of the last y, and subtracted that from current y, and that gave me a fall speed, or offset that I could then apply naturally. That way, even when the curve was done, or my jump time was exceeded, the object can continue to fall whatever speed it was falling at the end of the curve. Obviously if I want to go this route, I'll have to work out what happens when you release the jump button early, and animation curves let you retrieve values at any time along the curve, so there's plenty of options. But the more I think about it, It's probably easier just to break out of the curve and begin a natural fall. I like to work with vectors for movement a lot. But I thought it was neat how you could use animation curves to get those jump velocities exactly like you want. I'm real excited about where GMS is going and look forward to more experiments.Nice way to do to that, I hadn't thought of it. You just have to add on the falling part either when the curve ends or the button is release, and check for collisions.
I added a feature to my Easing system(will release when 2.3 is out) that uses an animcurve instead of the regular equations as well. I'm also planning to use them for a gradient coloring system, and probably for the particle system too(gradients to have more control instead of just the 3 values).
Vector2 = function(_x, _y) constructor
{
x = _x;
y = _y;
static Add = function(_other)
{
x += _other.x;
y += _other.y;
}
}
var pos = new Vector2(1,0);
show_debug_message(pos);
var move = new Vector2(1,0);
show_debug_message(move);
pos.Add(move);
show_debug_message(pos);
___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object o_player:
Variable o_player.Vector2(100040, -2147483648) not set before reading it.
at gml_Object_o_player_Create_0 (line 15) - var pos = new Vector2(1,0);
############################################################################################
gml_Object_o_player_Create_0 (line 15)
gml_Script_spawn_player (line 19)
gml_Object_o_gameplay_manager_Step_0 (line 19) - spawn_player(player_id);
They are declared globally if they're on Scripts. Which means you're gonna need the global. prefix to use Vector2.I've got a script file vec2 with the following code:
Now when I use this code in the create event of an object:GML:Vector2 = function(_x, _y) constructor { x = _x; y = _y; static Add = function(_other) { x += _other.x; y += _other.y; } }
I get an error message:Code:var pos = new Vector2(1,0); show_debug_message(pos); var move = new Vector2(1,0); show_debug_message(move); pos.Add(move); show_debug_message(pos);
I thought structs are declared globally? Or have I missed something?Code:___________________________________________ ############################################################################################ ERROR in action number 1 of Create Event for object o_player: Variable o_player.Vector2(100040, -2147483648) not set before reading it. at gml_Object_o_player_Create_0 (line 15) - var pos = new Vector2(1,0); ############################################################################################ gml_Object_o_player_Create_0 (line 15) gml_Script_spawn_player (line 19) gml_Object_o_gameplay_manager_Step_0 (line 19) - spawn_player(player_id);
I can bump that up a bit. My ticket ID is 171887. I'll post again when I get in.I am now able to access the beta (170331). The highest ticket id who has access to the beta, as reported on this thread, is 170356 (DanTheCan).
No it's a desktop and quite powerful one... the problem seems to be that the GMS2 runner isn't powerful enough for the graphics card to kick in... when open a more heavy program (browser with youtube open) the graphics card kick in and GMS2 runner will take the ride... would be greatif the GMS2 runner would "call the GPU for help" by default... or at least allow to set that as an optionIs your PC a laptop?
If it is: it may be sensible to check if there is any aggressive power management profile active.
And if you try a lot, lot of draw code to drop FPS a little, does it switch? I also noticed, that GMS uses "main" card only, maybe it's executable needs some flag to be marked as "game" and use proper GPU? The same issue is with IDE, which likes to lag for me when more windows are opened, but it uses Intel card instead of my GTX.No it's a desktop and quite powerful one... the problem seems to be that the GMS2 runner isn't powerful enough for the graphics card to kick in... when open a more heavy program (browser with youtube open) the graphics card kick in and GMS2 runner will take the ride... would be greatif the GMS2 runner would "call the GPU for help" by default... or at least allow to set that as an option
This fixed my issue:They are declared globally if they're on Scripts. Which means you're gonna need the global. prefix to use Vector2.
var pos = new global.Vector2(1,0);
show_debug_message(pos);
var move = new global.Vector2(1,0);
show_debug_message(move);
pos.Add(move);
show_debug_message(pos);
alternatively, rather than doing it like this:This fixed my issue:
ThanksGML:var pos = new global.Vector2(1,0); show_debug_message(pos); var move = new global.Vector2(1,0); show_debug_message(move); pos.Add(move); show_debug_message(pos);
Vector2 = function(_x, _y) constructor
function Vector2(_x, _y) constructor
I reported this in the BETA forums but don't know if they will address it...And if you try a lot, lot of draw code to drop FPS a little, does it switch? I also noticed, that GMS uses "main" card only, maybe it's executable needs some flag to be marked as "game" and use proper GPU? The same issue is with IDE, which likes to lag for me when more windows are opened, but it uses Intel card instead of my GTX.
[]
accessor, array reference and quicksort sorting (thanks to Java for giving it a name): https://github.com/KeeVeeGames/ArrayList.gmlYeah I figured that out just after. /facepalm lolalternatively, rather than doing it like this:
it might be wise to start doing it like this:GML:Vector2 = function(_x, _y) constructor
the former declares it locally ( or in the event of a script, inside a global variable ).GML:function Vector2(_x, _y) constructor
the latter declares it as a standalone constructor that can be called in the way you intended