Long shot that you will answer. But how do I make it so the weight doesn't smoothly go from 0 - 1. Say I want it to stay 0 until half way up and then lerp from 0 - 1. For clairity I want the wind to only affect the top half. Really good tutorial and good intro to shaders, thanks in advance
@celesteorsa3918Ай бұрын
you could do this with an if statement inside the vertex shader, if you know the height of the vertex you would like to start deforming from you would do this: if _trans_pos.y < _vertex_pos_y {do smoothstep}.
@speicalkeek4579Ай бұрын
@@celesteorsa3918 thanks for the suggestion. I am currently only using 4 vertexs like the video but maybe could do 6 instead and this would work.
@thefallenlime3 ай бұрын
Told me what I needed to know: it's similar enough to Unity that I can do it for others without much issue. Thanks.
@angywizard3 ай бұрын
I know this video was from quite a while ago, I've followed up to 21 minutes but when I went to test and see the json file in my browser GameMaker is giving an error with the statement at 7:34 "var object = instance.object_index;" saying "Variable <unknown_object>.object_index(14, -2147483648) cannot be resolved. at gml_GlobalScript_scr_instance_get_save_map (line 6) - var object = instance.object_index;". I'm uncertain what may be wrong this far in, and I'm fairly new to GameMaker. Perhaps something has changed since the making of the video? Either way, I appreciate the tutorial because I've learned a lot about how saving with json works this far. Just not knowledgeable enough to figure this problem out yet!
@Oh_No_Cat4 ай бұрын
that really helped me a lot, thank you sir 😎
@zerotrest5 ай бұрын
it might be a new problem but it just wont work, you fall threw that blocks either way, I tried a newer method and it worked immediately, everything else worked tho, maybe it was mb
@brunodallago51596 ай бұрын
Has anyone found a way to do this same effect with moving lights?
@clbl87067 ай бұрын
My last time using Gamemaker was Studio 1.0 back in 2014. Crazy seeing how much more refined the engine is getting.
@celesteorsa39187 ай бұрын
Thanks for this guide, at least it's a good start to understanding vertex shaders. I would also like to know how I can change the rotation of the image in real time with shaders, and also how I can change the position of individual vertices so that I can make a tentacle that moves based on the rotation of an octopus's head. A tutorial on Gamemaker how to edit a mesh in real time and doing math inside the shader, seems taboo on the internet!
@svinta7 ай бұрын
THANK YOU How would I make the pool cue go closer to the ball when you release the left mouse button, so it looks like it's actually hitting the ball?
@alexandergovorov67089 ай бұрын
Hey! Very nice tutorial. I have one question. Why using shader for bending? If I got how vertices work right, you can modify vertices' coordinates to make grass bend.
@celesteorsa391827 күн бұрын
It is extremely slow to modify vertices in a vertex buffer by updating it at each step, if that is what you mean. Instead, using a shader allows you to transform vertices very fast. You could for example interpolate the vertices of two polygon models. Unfortunately there are not many guides on vertex shaders available for gamemakers. This is my battle at the moment.
@alexandergovorov670823 күн бұрын
@@celesteorsa3918 Didn't really expect an answer already 😅 So as fragment shaders does it with pixels, vertex shader also can modify all the vertices at once, right? Cool! If I get it right interpolation can be used for a sort of procedural animation. If you use those polygons as final animation states. Right now I'm working on a game where we want to implement cool animations for different flora entities. The best reference I know is Ori's background trees animation during the storm - not sure how they did that though. Do you know good guides on how to implement that?
@celaldogangunes9 ай бұрын
9 years of a video and here i use it for my game. :)
@bassicguitar7863 Жыл бұрын
Amazing video, really helped me! I was just wondering how the collision test could be adapted to stop the player moving through certain objects too? I know this may be obvious, but I've just started with gamemaker and any help would be really appreciated!
@Cartoonicus Жыл бұрын
How do I do an "if variable" function with multiple values? if variable: "name" is equal to "1,3,4,7,19, or 35"
@donsoyer Жыл бұрын
have You got an example of it with the scripts that You didn't show? :)
@ethanharrold6891 Жыл бұрын
Fantastic Tutorial, I have it all up and running perfectly and smoothly in my initial room, but once I transition to the next room it no longer detects the tile layer, and the collisions stop working, do you know of any way to fix this? It is not a naming issue as all the tile sets and tile layers are named exactly the same as the previous room. If anyone has any ideas please let me know! Thanks again :)
@malucifer Жыл бұрын
I think you would need to get the layer id and tilemap id again because you changed room. I would make those actual variables in the player object and in your transition object, re assign those variables to what's in the room you are going to.
@ItsTheMagicMelon Жыл бұрын
What I did to fix this problem, was move: var tile_layer = layer_get_id(“Wall”); tile_map = layer_tilemap_get_id(tile_layer) out of the create event of the player, and into the step event of the player. This way it checks every step of the game, instead of just at the beginning of its creation
@ItsTheMagicMelon Жыл бұрын
Also, could you let me know how you got the room transition working properly? Mine works for the most part, but it puts the player at the wrong x and y coords.
@ilikecakeandbiscuits Жыл бұрын
Why does the car decelerate as it corners? Can we nullify the lateral velocity whilst keeping the speed in any way?
@GMWolf Жыл бұрын
It's an inherent property to these sorts of physics. You could compute an exact impulse to only change the direction of the car, without changing its speed. But at that point it defeats the purpose of car physics and you would be much better off completely changing systems and just setting the speed and angle of the car directly.
@mr_pop672 Жыл бұрын
on loading the json file on the newest game maker it gives my this error ############################################################################################ ERROR in action number 1 of <Unknown Event> for object O_load: ds_list_size argument 1 incorrect type (undefined) expecting a Number (YYGI32) at gml_Script_load_instances (line 12) - for(var i = 0; i < ds_list_size(list); i++) { ############################################################################################ gml_Script_load_instances (line 12) gml_Object_O_load_Gesture_0 (line 7) - load_instances(json);
@mr_pop672 Жыл бұрын
i dont get how it works on the save script being the same peice of code but not working on the load
@delphonse9243 Жыл бұрын
I am so confused on all these videos I watch for GMS2 everyone says it works perfectly but everytime I emulate these videos I get bugs that won't let me do anything. Is there something outside what the video describes that I need to do to prep for these videos? I am brand new just trying to get a few specifics done for me game it seems like D&D really is the only method that works for me as every code I try inputting I apparently do wrong somehow.
@GMWolf Жыл бұрын
Since this video game out, gml changed significantly. I recommend you check out some other videos that came out recently to learn gml first, and then come back to these videos and adapt the code.
@ilikecakeandbiscuits Жыл бұрын
This is gold, thank you so much
@phantasmagoria617 Жыл бұрын
does it work if you leave the game alltogether and come back
@GMWolf Жыл бұрын
Yes. The json has to be saved to a file, and then loaded from that file when you load the savegame.
@phantasmagoria617 Жыл бұрын
How do you do that?
@GMWolf Жыл бұрын
Hard to explain in a single KZbin comment. I recommend you ask for help over at the game maker forum: forum.gamemaker.io The game maker manual is also a great place to get started: manual.yoyogames.com/#t=GameMaker_Language%2FGML_Reference%2FFile_Handling%2FText_Files%2FText_Files.htm&rhsearch=file&rhhlterm=file
@rayseeklo2 жыл бұрын
For some reason, the bboxes cause the game to not load for me. Weird.
@SuperRapda2 жыл бұрын
Hi, I updated gamemaker and this doesn't work properly anymore. Now when the player and the camera moves, all sLights also move.
@TheBaraxianGaming2 жыл бұрын
Followed your code to the letter and am getting this error: Variable <unknown_object>.state(100003, -2147483648) not set before reading it. at gml_GlobalScript_Move (line 5) - if (state == states.idle) { What am I doing wrong here?
@tinblue2 жыл бұрын
this is a pretty flawed tutorial. Everything you did is inside a restricted room with a bog standard viewport following the player. No matter how big you make it it's still not infinite. So makes the whole point of chunks pointless.
@GMWolf2 жыл бұрын
Your view can move beyond the size of the room. And you can create objects beyond the size of the room. The size of the room only really limits the a few things like the room editor, or built in view functionality. Of course you are still limited by the reality of computers. With 32 bit floating point numbers, you can only go so far before running into precision issues. A rule of thumb is 16km for 1mm precision.
@tinblue2 жыл бұрын
@@GMWolf Yeah, I've been reading about this. Sorry for my comment coming across as a little rude. I'm just new to GM2 and getting a bit frustrated at lack of tutorials on chunking using GM's room system. Your tutorial is really great and I have it working in GM2 but because of my limited knowledge right now I'm struggling with the concept of breaking out of the room limits. Is GM2 not 64bit then? Don't support there is a chance of you making a big comeback and doing a new GM2 version of this tutorial? Thanks for the fast reply despite my rudness.
@GMWolf2 жыл бұрын
Dw we are all here to learn. It's not about being a 32 or 64 bit process (which is more to do with the target architecture). It's about the type of data used to represent numbers. I think GMS can represent numbers as 64 bits when they get too large (unsure about floating points however). Unfortunately I do believe the graphics use 32 but floating point representations which means a loss in precision when you get into very large numbers. There are a few strategies to cope with that, such as moving the world, rather than the camera, or some sort of floating origin system. I think it's unlikely I make a GMS2 comeback anytime soon.
@MisterNewYear Жыл бұрын
@@tinblue i think i figured out your problem because i was bashing my head into a wall trying to figure this one out too lmao. It's not about drawing in the negatives, but its about the grid we made isn't able to draw into the negatives. To get around this, I just made the starting point for the grid in the middle by multiplying the worldsize (my one size fits all variable for height and length) by 0.5, and then adding the x and y values to it
@joandersonoliveira68022 жыл бұрын
does anyone know how to replace the function instance_get_save_map()? the video is 5 years old now and today that function dosent exists anymore.
@GMWolf2 жыл бұрын
Iirc that function/script was defined by me in the tutorial. It's not built in.
@joandersonoliveira68022 жыл бұрын
@@GMWolf thats odd. i always copy everything when im learning a new system. guess i missed then
@GMWolf2 жыл бұрын
Remember this was written before 2.3. GML has changed since, so make sure you wrap everything in functions.
@joandersonoliveira68022 жыл бұрын
@@GMWolf yep, i realized that :)
@brujo48422 жыл бұрын
For those having trouble with the "jump" glitch on the first drag, etc, or wanting the ability to zoom, put these on your camera object: Create: camera = view_camera[0]; zoom_level = 1; default_zoom_width = camera_get_view_width(camera); default_zoom_height = camera_get_view_height(camera); drag_room_x = 0; drag_room_y = 0; Global drag start: drag_room_x = event_data[? "posX"]; drag_room_y = event_data[? "posY"]; Global dragging: ratio = camera_get_view_width(camera) / window_get_width(); var real_mouse_x = event_data[? "rawposX"] * ratio; var real_mouse_y = event_data[? "rawposY"] * ratio; var _x = drag_room_x - real_mouse_x; var _y = drag_room_y - real_mouse_y; //_x = clamp(_x, 0, 400); optional //_y = clamp(_y, 0, 400); camera_set_view_pos(camera, _x, _y); Step: zoom_level = clamp(zoom_level + (((mouse_wheel_down() - mouse_wheel_up())) * 0.1), 0.5, 2); var view_w = camera_get_view_width(camera); var view_h = camera_get_view_height(camera); var rate = 0.2; var new_w = lerp(view_w, zoom_level * default_zoom_width, rate); var new_h = lerp(view_h, zoom_level * default_zoom_height, rate); camera_set_view_size(view_camera[0], new_w, new_h); --- The magic fix here is the "ratio" bit in Global dragging. Basically, we use the ratio to make "posX" and "rawposX" coordinates align to the same spot on the screen. I'm pretty new to Gamemaker and haven't experimented with this very much, but it works in my little demo. Let me know if you guys figure out something better.
@koolgool2 жыл бұрын
This is pretty great. Trying to get it so the camera zooms toward the mouse cursor's location, but I'm still trying to figure out how all this works.
@SandTurtle2 жыл бұрын
my god thank you, that jumping glitch was making me tear my hair out, and it only got worse the more i zoomed
@hiworldman22999 ай бұрын
my camera is still jumping any idea why?
@Real_KR4K3N3 ай бұрын
ive been working on cameras all day, and this was exactly what i needed XD thank u stranger
@artfurret2 жыл бұрын
This tutorial helped me a lot thanks
@dann7902 жыл бұрын
Sorry for commenting here on this incredible old video, but I'm having the stuttering issue a couple people have mentioned in the comments, only instead of happening at every tile, it seems to be happening every frame. I tried making a post on the GMC forum about this, but they don't make posts visible until moderators accept them. Any idea as to what this could be? If need be I can show the code.
@GMWolf2 жыл бұрын
Every frame? That is quite odd. I can't recall any possible issues outside the tile->tile transition. Does the stutter happen with any other animated objects? It's hard to discuss code in yt comments. What forum subsection did you post to? AFAIK only the tutorials section needs moderator approval.
@dann7902 жыл бұрын
@@GMWolf Wow, you responded really fast! I'm assuming it's every frame because of how consistent it is, but it's just very common, so I can't say for sure. All sections need moderator approval for me, since I had made an account to post this, and the first 5 posts on a GMC forum account require moderator approval. I tried other animated objects, and it's just this object, so it's definitely not lag. Is there any good way for me to send my code to you that isn't youtube comments?
@dann7902 жыл бұрын
I figured it out, I had messed with viewports and it made it look like it was shuffling back and forth when in reality it was just the camera not keeping perfectly on center with the character. Sorry about that!
@GMWolf2 жыл бұрын
Great! Glad you figured it out! Happy deving!
@davisantos56722 жыл бұрын
I'm watching it exactly 7 years after it was recorded. Thanks
@tomekipro16872 жыл бұрын
uncomplit
@coxyofnewp2 жыл бұрын
Just came across an old vid of yours and wondered - what you up to? see no upload since this.. Hope all good !
@GMWolf2 жыл бұрын
Hi, thanks, i'm doing alright. I stopped making videos since I both got a job and stopped using GM. Having less free time to work on videos combined with a shift of focus means I haven't really had the motivation or focus for a new video. I still do hold some hope that one day I'll be back (probably with non-GM content) but after 2 years now I don't think that's likely. Glad to see people still seeing my videos, especially those I remember commenting regularly :)
@carlitosgonzalez62882 жыл бұрын
hey GM Wolf please comment I really love your youtube vids and I just made this on gml so I can have some fun with my bros 😍 😍 😍 😍 please comment 😍 😍 😍 😍
@nemesis666first2 жыл бұрын
I was looking for a "code" and "dynamic" way to do that, not just a "right click and rename" solution >.> ...
@GMWolf2 жыл бұрын
Then you just assign a variable with the instance id...
@AditionalPylons2 жыл бұрын
I know this is almost a 5 year old video now, but I also followed this guide exactly as shown. It would instantly crash all the time stating that Variable <unknown_object>.state(100003, -2147483648) not set before reading it. at gml_GlobalScript_move (line 4) - if (state == states.idle) Neither me or my professor could figure out why it's happening, but the solution was to put the move script directly in the key down. Any idea why? Thanks for the video regardless, lots of great info!
@GMWolf2 жыл бұрын
Are you using gms2.3? If so make sure you are using the new GML function syntax. Other than that kinda hard to debug over KZbin comments, if you head over to the GMC (forum.yoyogames.com) and post a few more details I might be able to help you
@AditionalPylons2 жыл бұрын
@@GMWolf Oh wow thanks for the fast reply. I'm only familiar with the latest version of Gms, what is the syntax change you are referring to?
@GMWolf2 жыл бұрын
Previously each script was its own function. Notice I just write the instructions directly into the script file without defining a function. In the latest version of GML, you have to wrap the statements in a function declaration. I would recommend you read about functions in the manual. It should show you the syntax to define functions.
@AditionalPylons2 жыл бұрын
@@GMWolf Ah, this makes more sense now! Thanks so much for all the information, I'll be reading into it shortly.
@leoriley76842 жыл бұрын
please make a tutorial on how to zoom and do this
@leoriley76842 жыл бұрын
this only works when my camera is 1920 x 1080 I want it to be smaller however any fixes? edit: i fixed this by dividing the rawpos values by 4 because I wanted my camera to be 4 times smaller
@SuperCeoman2 жыл бұрын
How do I use gml_pragma now that GMS2 uses the function keyword, instead of scripts acting as one big function? I tried putting this in a script: gml_pragma("global", "functionName()") ...but nothing happened
@GMWolf2 жыл бұрын
I think just putting the code outside of a function executes it globally now. Although I haven't checked it myself yet.
@hamzaaslam3812 жыл бұрын
Hi , just wanted to know , how to add the sprint functionality , i change the walk_anim_length when sprint key is pressed , the player move fast but it make some jerk like movement. can you help me on this . thankyou
@GMWolf2 жыл бұрын
It's probably because we reset the animation time to 0 for every grid step. What we should be doing is carrying over any excess when we get to the end of one step, into the beginning of the next.
@FrozenInIce2 жыл бұрын
what you're talking about is realy similar to how they would make the game objects at least it sounds like it
@darksacor3 жыл бұрын
Very good video, I would love to test how this effect works, but copying code from 40 minutes of video is really lazy. Too bad the link is down. Still I think I will make the effort as it will be worth it. Thank you very much for these kinds of tutorials
@MarioFranzoni3 жыл бұрын
I'm using this line of code to turn but the car only turns right: ((gamepad_axis_value(4, gp_axislh) > 0.3) - (gamepad_axis_value(4, gp_axislh) < -0.3)) * 5 Can't figure why :(
@MarioFranzoni3 жыл бұрын
Thank for the explanation. I tried to replicate the code in GMS2 but I'm getting a compile error and I don't understand why
@GMWolf3 жыл бұрын
Since GMS 2.3 GML has changed and you need to use functions etc. I recommend you learn GMS first and then adapt this code to use the new syntax.
@MarcelCu_3 жыл бұрын
You forgot mentioned different ratios between window with and camera with it flick at beginning of dragg but thaks save me lot of troubles :D
@SamplingKid3 жыл бұрын
in gm8 you could use sprites / objects as tiles and hold shift to duplicate them, is that not a thing anymore? kinda annoying to drag every single piece in a room
@christiancuba43283 жыл бұрын
Can you share the project? I try doing it on my computer but it throws me error everytime
@dracmeister3 жыл бұрын
This is cool and all but is there a way to initialize variables from instance_create_depth? In the older versions of GMS, namely 1.4, you could just do this: m = instance_create(x,y,myObj) m.var1 = 24; m.var2 = false; In GMS2, you can do the same thing but, if you set default values for the created object instance, it will take the default values instead of the ones specified in instance_create_depth. Now, even in the older version of GameMaker, namely, 8.1 and below, you could check to see if a variable is initialized and else set a default value, this check also exists in GMS2 called "variable_instance_exists." It has 2 parameters (id, "var") It'll output a boolean if "var" exists. I tried it, but it always seemed to initialize from the object not from instance_create_depth. Say, I have this script: function shoot() { shot = instance_create_depth(x,y,objShot); shot.var1 = 20 shot.var2 = true } And on the create event of the object: if !variable_instance_exists(id,"var1") var1 = 5 if !variable_instance_exists(id,"var2") var2 = false When shoot() is executed, the defaults set on the create event, not the bit from the script. Am I doing something wrong? Am I using the wrong functions? Methods? Am I stuck in the older ways of doing something like this?
@GMWolf3 жыл бұрын
The create event will run immediately after (during, to be accurate) the instance_create call. that is, before you se the variables using m.var1 = 5. I'm not sure there is a great way to set variables before the create event runs unfortunately.
@greenagon3 жыл бұрын
I cannot seem to manage to get this right, the movement always stutters unless I set walk_anim_length to be 1 second or slower.
@patriciaduffy24793 жыл бұрын
Thanks for the great tutorial. How does this system work when game is a complex rpg, with room changing?
@GMWolf3 жыл бұрын
This tutorial is not meant as a finished product, but more of a way to show the JSON functions, and give some ideas on how to use data instead of code to drive a system. You'll have to adapt it to your specific needs :)
@patriciaduffy24793 жыл бұрын
@@GMWolf Thanks for the quick response. Do you happen to know of any tutorials that show how to save when changing rooms? There's really not much out there.
@GMWolf3 жыл бұрын
What do you mean by changing rooms? Do you mean when you come back to a room it has all the changes you made? In that case you can save the room when you leave, and load it when you enter it. To make things simpler you can have a separate save file for each room, for example.
@patriciaduffy24793 жыл бұрын
@@GMWolf Yes, I'm making a complex rpg that will have numerous rooms. Thanks, I'll have to try to figure this out, as I'm not advanced at all. Thanks so much for responding.
@GMWolf3 жыл бұрын
In general I don't think a single tutorial will solve everything you need for a save system. They are quite dependent on the exact game you are creating. If you need more in depth help I think the forums (forum.yoyogames.com) is a great place to get help, post code samples and get feedback or advice. I'm on there a lot. Good luck and happy deving.
@iMRDY993 жыл бұрын
Thanks GM Wolf.. this is the best tile collision system ever. Deadly Accurate !
@GMWolf3 жыл бұрын
Thanks! And , you're welcome! Actually looking back I can find so many ways to make it better haha, I'm glad you find it useful though.
@StallionTG3 жыл бұрын
Been looking for a good muliply shader for a while now.