N
NizarPlayz
Guest
I can't use draw_self() it says Unknown function or script. Please help! I'm using GM 8.0 Pro any help would be really appreciated! What code do i use instead of draw_self() if i can't use it.. :/
draw_set_alpha(1)
draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation+90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation+90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha)
draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation-90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation-90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha)
draw_self()
Replace "draw_self();" with "draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);".I was searching on YT for car physics and then i copied and pasted this code
and then it gave error at the last lineCode:draw_set_alpha(1) draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation+90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation+90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha) draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation-90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation-90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha) draw_self()
Unknown function or script: draw_self() and then i used angle_difference code in other object it also gave the same error please anyone help me
/// angle_difference(angle1, angle2)
//
// Returns the relative angle [-180..180] between the given angles.
//
// angle1 1st direction in degrees
// angle2 2nd direction in degress
//
/// GMLscripts.com/license
{
return ((((argument0 - argument1) mod 360) + 540) mod 360) - 180;
}
I'm using GM 8.0 and i'm not good in coding as i'm learning it and i don't know what to do because the draw_self() code does not exists and also angle_differenceWell the point of a yt video is for you to learn what he is doing. Not really for you to copy it over without understanding the code.
My question is: do you understand what draw_self() is even supposed to do?
as for the answer to your question: check your profile post, someone else already gave it.
draw_set_alpha(1)
draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation+90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation+90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha)
draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation-90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation-90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha)
draw_sprite_ext
I don't know what to do with the draw_self() cuz i'm bad at coding as i'm learning it so.. :/Replace "draw_self();" with "draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);".
For "angle_difference()"... I've forgotten off the top of my head, but am looking now.
Edit: Copy/Paste this code into a new script titled "angle_difference":
Tell me if that works.Code:/// angle_difference(angle1, angle2) // // Returns the relative angle [-180..180] between the given angles. // // angle1 1st direction in degrees // angle2 2nd direction in degress // /// GMLscripts.com/license { return ((((argument0 - argument1) mod 360) + 540) mod 360) - 180; }
I didn't even understand a word what you said there ''Replace "draw_self();" with "draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);".''The answers are listed above
If you follow it directly you should have it working.
Like @Tthecreator said, you should try to understand what's going on too.
draw_set_alpha(1)
draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation+90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation+90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha)
draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation-90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation-90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha)
draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
Oh i see ok i will try and tell you in a few mins if it works or notYou literally just replace draw_self() with that line shown above. That manually produces draw_self().Code:draw_set_alpha(1) draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation+90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation+90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha) draw_sprite_ext(spr_wheel,0,x+lengthdir_x(center_to_front*0.75,-phy_rotation)+lengthdir_x(center_to_front/2-center_to_front/5,-phy_rotation-90),y+lengthdir_y(center_to_front*0.75,-phy_rotation)+lengthdir_y(center_to_front/2-center_to_front/5,-phy_rotation-90),1,1,-phy_rotation + richting*0.8,c_white,image_alpha) draw_sprite_ext(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
Well yes draw_self() isn't a function :/ and i like sticking to the main GM which i useI've never used GM 8 but is it possible that draw_self() simply isn't a function in that version of Game Maker? You could probably just use one of the other draw functions and just name the sprite that you want to use (or just put sprite_index). You're already using draw_sprite_ext so you could just use that for the main body, too, just use the default variables in all the fields, basically.
Is there no way you could upgrade to Studio 1.4? The professional version is Pay What You Want on Humble Bundle right now.
Now how the heck am i gonna solve this one.. :/God dammit now i have another error...
Unknown function or script: physics_apply_force
FUUUUUUUU
Can you atleast solve this 1 last error?@NizarPlayz: By upgrading to GMS1 (as mentioned above, you can get it on the Humble Bundle). From there you can upgrade to GMS2 for a cheaper rate too.
You won't be able to get those physics functions in GMS8
I would suggest you either search for a GM8 specific car physics tutorial or upgrade to Studio. Now with the humble bundle deal would be an excellent time.Now how the heck am i gonna solve this one.. :/
Jeez dude i told you i'm learning to code since i left GM for 6 months now i have came back and i forgot all the coding that i learned before..but do you know what draw_self() is supposed to do?
Whether it is working or not, please tell me what it's supposed to do.
Okay, I would be a little too harsh if I just asked you that so here is a link: http://docs.yoyogames.com
This is the link to the Game Maker: Studio manual. (I know, not the gm8 one, but we are looking at a studio function after all)
Now without copy and pasting stuff, would you be able to use given manual to search for what this function does.
Also in your latest example you just wrote "draw_sprite_ext" which is wrong.
Do you know what a function is? A function is a piece of code that you can give some data and then does something with that data. (In some cases it can also give you some data back)
Now a function can be something like c=add(5,3); (the function add doesn't actually exist, this is all theoretical)
What that add function would do is take 5 and 3 and add them together. The "c=" part would indicate that we put the answer of that function inside the variable "c". If you don't know what variables are, then please ask.
Now a function starts with a name, in this example "add". Followed by a "(". Then there are the arguments. arguments are the information that your function needs to do its job. Like our add function would need 2 numbers. one argument would be 5 and the other would be 3. An argument could also be a variable, some math or the output of another function. A function could have any number of arguments, even none in which case the "(" is directly followed by ")". You can differentiate between different arguments using a "," and at the end of your arguments you put a ")". Now you are using the function draw_sprite_ext go ahead and look at the manual what kind of arguments it needs.
I think you have a lot to learn but with a little bit of patience you can come anywhere. But please, try to be a little bit less "pushy" and a little bit less "spammy". This response took quite a while to write, and in the meantime you've kept spewing out messages. I'm sorry that I said what I just said.
The thing is, I don't want you to just blindly copy and paste code without knowing what it does. You need analyze and understand it. Maybe not every bit at the beginning, but when some piece of code uses a function you've never seen then it's at least worth it to look it up in the manual. I don't even remember if gm8 had one, but press f1 and see what happenes.
Fine I will get GMSI would suggest you either search for a GM8 specific car physics tutorial or upgrade to Studio. Now with the humble bundle deal would be an excellent time.
I would also suggest you get a better handle on coding before tackling something like car physics but that's on you.
OkayWell, it's worth upgrading to GMS1. Ask your parents! You can get GMS1 in the Humble Bundle for $1.
Hey! I got GMS 1 and when i load my project it says GMX Saving and suddenly it stops responding help meh ;pWell, it's worth upgrading to GMS1. Ask your parents! You can get GMS1 in the Humble Bundle for $1.
Great you got it! That's a dollar well spend! Now the GMX saving thing can take some time, but not something like 15 minutes or more.Hey! I got GMS 1 and when i load my project it says GMX Saving and suddenly it stops responding help meh ;p
Yes i used import thing to load my .GMK project it says loading data and after that it says GMX Saving and then it gets stuck it won't load ahead then when i click it, it says Game Maker Studio has stopped responding i don't know why this is happening i really want to complete my project :/Great you got it! That's a dollar well spend! Now the GMX saving thing can take some time, but not something like 15 minutes or more.
What step are you at? Did you just use the import function and are you getting it directly after importing?
This sounds like some sort of bug... Maybe you can open gms1, open the help menu and click "report a bug". I do have to say that since the release (and even amidst the making) of gms2 support hasn't been that great for gms1. Let's just hope you have some luck.Yes i used import thing to load my .GMK project it says loading data and after that it says GMX Saving and then it gets stuck it won't load ahead then when i click it, it says Game Maker Studio has stopped responding i don't know why this is happening i really want to complete my project :/
Without GMS 1 I can't complete my project :/ Well i'm uploading a video of the error.. When it's done i will give the link to you and ya watch it and tell me how to fix the errorThis sounds like some sort of bug... Maybe you can open gms1, open the help menu and click "report a bug". I do have to say that since the release (and even amidst the making) of gms2 support hasn't been that great for gms1. Let's just hope you have some luck.
I'm making a top down 3D Racing game in GM 8.0 you can't use some codes,variables and functions so i decided to get GMS 1 but bad luck :/ it won't open my projectThis sounds like some sort of bug... Maybe you can open gms1, open the help menu and click "report a bug". I do have to say that since the release (and even amidst the making) of gms2 support hasn't been that great for gms1. Let's just hope you have some luck.
Okay :/Sorry, I'm currently on a databundle and won't be able to download stuff, watch videos, etc. I should put that in my signature. In fact, I will do that right now.
Did you solved your problem??So I had a similar problem and used the search box to find topics that may help me solve mine.. alas they were renamed to 'solved' so I couldn't find any matches.
You seem to have missed this post so I'll just remind you again to make sure...If the topic is solved, please do NOT remove the title. Add [SOLVED] to the title but keep the original text too, as otherwise the topic becomes useless as the search function won't find it and you can't see from the forum overview what was being discussed.