Would do me good
by rennie moffat · in Torque Game Builder · 10/06/2009 (12:50 pm) · 23 replies
Hi, I would like it, if someone could explain something that is very simple, and while I get what it says, in the code, I am trying to figure out how the computer is compiling this, random information (when I say random, I mean "turnSpeed" is not a term which is part of the basd code of Torque).
This is from the astroids control,
This is from the astroids control,
//I fully understand the purpose of this code. Where I am confused, //or wondering how, is how is it that "turnSpeed" knows how to TURN an object? %this.owner.setAngularVelocity((%this.right - %this.left) * %this.turnSpeed); //The only other reference to "turnSpeed" in the code is in the addBehaviorField(turnSpeed, "Velocity of turning (degrees per second)", float, 120.0); //Again, I get this, what each thing represents, but where I am lost is, how is "turnSpeed" associated with rotation. To me a simple see a float, but nothing to //officially do with degrees. Yet the object is turning. I wonder this because I would have thought to put a setRotation somewhere in the code. but non exists. //Can anyone explain to me how that works?
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
So my question is then...
Oh wait I see it.
So Im going to say, this is true since %this.right - %this.left is either 0,1, or negative 1. In which case it will still return a vector, since I guess acceleration is a vector.
:hoorah.
This aint so bad.
10/06/2009 (1:52 pm)
Ok, my bad, I had flipped thru the operators, and must have missed minus, but I just saw it.So my question is then...
Oh wait I see it.
So Im going to say, this is true since %this.right - %this.left is either 0,1, or negative 1. In which case it will still return a vector, since I guess acceleration is a vector.
:hoorah.
This aint so bad.
#3
If I further go on and click on the word "Angle" in that, it tells me that "Angle" is a float value that represents an angle in degrees. If the number is an angular velocity, it is in degrees per second.
The line you mention above appears to be coming from a behavior. Since you've repeatedly told me that you understand dynamic variables, I won't go into that, but suffice it to say, "right" and "left" aren't an integral part of the engine, either. The author of this line cleverly set up a convention that will turn the object in the correct direction based upon the state that "right" and "left" are set to.
10/06/2009 (2:09 pm)
Hmmmm.... When I go to here, I see that setAngularVelocity()'s purpose is to set the angular velocity of the object. It then goes on to say that the parameter is an angle velocity at which the object will rotate. It goes on to note the similarity between auto rotation and angular velocity, but that there is a key difference in the physics.If I further go on and click on the word "Angle" in that, it tells me that "Angle" is a float value that represents an angle in degrees. If the number is an angular velocity, it is in degrees per second.
The line you mention above appears to be coming from a behavior. Since you've repeatedly told me that you understand dynamic variables, I won't go into that, but suffice it to say, "right" and "left" aren't an integral part of the engine, either. The author of this line cleverly set up a convention that will turn the object in the correct direction based upon the state that "right" and "left" are set to.
#4
where my trouble lies now tho is how to call my minX from onWorldLimit. Am continuing tho.
10/06/2009 (2:13 pm)
hmm ok so i can see where y wrongs have been. I have gone back and made significant changes.where my trouble lies now tho is how to call my minX from onWorldLimit. Am continuing tho.
if (!isObject(Spacer3000WorldLimits))
{
%template = new BehaviorTemplate(Spacer3000WorldLimits);
%template.friendlyName = "Spacer3000 World Limits";
%template.behaviorType = "World Limit Behavior: Player";
%template.description = "Spacer3000WorldLimits";
}
function Spacer3000WorldLimits::onBehaviorAdd(%this)
{
%this.owner.enableUpdateCallback();
sceneWindow2D.startCameraMove();
%this.schedule(100, "setWorldLimit");
}
function Spacer3000WorldLimits::setWorldLimit(%mode, %minX, %minY, %maxX, %maxY, [%callback = false])
{
%mode = clamp;
%minX = sceneWindow2D.getWord(minX, 0);
%maxX = sceneWindow2D.getWord(maxX, 2);
%minY = sceneWindow2D.getWord(minY, 3);
%maxY = sceneWindow2D.getWord(maxY, 1);
}
}
function Spacer3000WorldLimit::onWorldLimit(%this, %limitMode, %limit)
{
%this.getWorldLimit();
%this.getPosition($player);
if ($player.positionX() = %this.getMinX()
{
%this.clamp;
}
if ($player.positionX() = %this.getMaxX)
{
%this.clamp;
}
if ($player.positionX() = %this.getMinY)
{
%this.clamp;
}
if ($player.positionX() = %this.getMaxY()
{
%this.clamp;
}
#5
1) Why are you enabling the update callback on the object while using a schedule within the behavior?
2) Where is the camera moving to?
3) Why does your schedule call only have two parameters when the function itself has six?
4) Why is the last parameter in setWorldLimit set the way it is? Didn't the console give you errors on this?
5) Why are none of the variables in setWorldLimit being used?
6) Why are you passing parameters to getWord? Didn't the console give you errors on this?
7) There is nothing in this behavior to make it get executed more than once. Did you mean for that?
8) What will call onWorldLimit?
9) Behaviors don't have world limits, so getting this is useless.
10) Behaviors don't have positions, so getting this is useless.
11) Even if behaviors had limits and positions, did you mean to assign them to something?
12) Even if behaviors had a position, the getPosition would take no parameters as stated clearly in the documentation.
13) Did you mean to use operator assignment instead of operator equal in your conditionals?
14) If you did mean operator equal, float values will rarely equal each other.
15) The results of your conditions will do nothing, but will probably make the console print out error messages.
Good luck!
10/06/2009 (2:34 pm)
At first pass, these are the problems I see. There might be more.1) Why are you enabling the update callback on the object while using a schedule within the behavior?
2) Where is the camera moving to?
3) Why does your schedule call only have two parameters when the function itself has six?
4) Why is the last parameter in setWorldLimit set the way it is? Didn't the console give you errors on this?
5) Why are none of the variables in setWorldLimit being used?
6) Why are you passing parameters to getWord? Didn't the console give you errors on this?
7) There is nothing in this behavior to make it get executed more than once. Did you mean for that?
8) What will call onWorldLimit?
9) Behaviors don't have world limits, so getting this is useless.
10) Behaviors don't have positions, so getting this is useless.
11) Even if behaviors had limits and positions, did you mean to assign them to something?
12) Even if behaviors had a position, the getPosition would take no parameters as stated clearly in the documentation.
13) Did you mean to use operator assignment instead of operator equal in your conditionals?
14) If you did mean operator equal, float values will rarely equal each other.
15) The results of your conditions will do nothing, but will probably make the console print out error messages.
Good luck!
#6
here
http://www.garagegames.com/community/forums/viewthread/102125
10/06/2009 (2:37 pm)
sorry I accidently posted my reply to this in the camera determines world limits thread.here
http://www.garagegames.com/community/forums/viewthread/102125
#7
Does an event/method, function what have need to have all set parameters listed? Like, schedule, but often I think I have seen ones like onLevelLoaded with %this, but no screengraph.
4) Why is the last parameter in setWorldLimit set the way it is? Didn't the console give you errors on this?
so it must be set to "true"?
I have no good console, must get Torsion for the Mac.
5) see edit in other post.
http://www.garagegames.com/community/forums/viewthread/102125
all edits can be seen there as i posted wrongly here as this thread is more for a moving camera determining world Limts behavior, what that thread is trying to achieve.
http://www.garagegames.com/community/forums/viewthread/102125
10/06/2009 (2:42 pm)
3) Why does your schedule call only have two parameters when the function itself has six?Does an event/method, function what have need to have all set parameters listed? Like, schedule, but often I think I have seen ones like onLevelLoaded with %this, but no screengraph.
4) Why is the last parameter in setWorldLimit set the way it is? Didn't the console give you errors on this?
so it must be set to "true"?
I have no good console, must get Torsion for the Mac.
5) see edit in other post.
http://www.garagegames.com/community/forums/viewthread/102125
all edits can be seen there as i posted wrongly here as this thread is more for a moving camera determining world Limts behavior, what that thread is trying to achieve.
http://www.garagegames.com/community/forums/viewthread/102125
#8
to try and answer your question: yes and no.
now, you always have a console, you just need to hit the "Ctrl + Tilde" combination and it will pop up.
also, you should post the edit here, and delete the one in the other post...
10/06/2009 (3:06 pm)
Quote:you should know, you designed the function... right?
Does an event/method, function what have need to have all set parameters listed? Like, schedule, but often I think I have seen ones like onLevelLoaded with %this, but no screengraph.
to try and answer your question: yes and no.
Quote:again, you designed the function, so you should know if you need that flag there or not...
so it must be set to "true"?
I have no good console, must get Torsion for the Mac.
now, you always have a console, you just need to hit the "Ctrl + Tilde" combination and it will pop up.
also, you should post the edit here, and delete the one in the other post...
#9
@Rennie - You always have the console.log to look at.
With your new behavior, I see the following problems. There might be more.
1) Your onUpdate function is scoped to an incorrect class.
2) Where did the behavior get a player member variable?
3) Did you mean to define a function called getCurrentCameraPosition in your behavior?
4) Why is the last parameter of your setWorldLimits in the onUpdate set the way it is. This problem has been pointed out to you no less than six times.
5) Do you mean for nothing to happen in your onUpdate function?
6) Why is the last parameter of your setWorldLimit function set the way it is?
7) All of your {min|max}{X|Y} variables in setWorldLimits will be invalid because you are incorrectly using getWord. You've told me no less than 3 times that you understood how this function worked.
8) There appears to be an extra bracket in your behavior.
9) How will setWorldLimit and onWorldLimit be called?
10) Assigning the limitMode parameter to clamp will not keep your player on the screen.
11) Float values will rarely equal each other.
12) The results of your conditionals will not give any errors, but will effect no behavior.
13) When did the behavior get the variables {min|max}{X|Y}?
14) Logically, you are comparing x values to y values.
15) Logically, you are comparing vectors to floats.
16) As is, the {min|max}{X|Y} variables are not scene windows and do not have the camera position functions defined.
10/06/2009 (4:29 pm)
@Ehrlichmann - Good call on the tilde!@Rennie - You always have the console.log to look at.
With your new behavior, I see the following problems. There might be more.
1) Your onUpdate function is scoped to an incorrect class.
2) Where did the behavior get a player member variable?
3) Did you mean to define a function called getCurrentCameraPosition in your behavior?
4) Why is the last parameter of your setWorldLimits in the onUpdate set the way it is. This problem has been pointed out to you no less than six times.
5) Do you mean for nothing to happen in your onUpdate function?
6) Why is the last parameter of your setWorldLimit function set the way it is?
7) All of your {min|max}{X|Y} variables in setWorldLimits will be invalid because you are incorrectly using getWord. You've told me no less than 3 times that you understood how this function worked.
8) There appears to be an extra bracket in your behavior.
9) How will setWorldLimit and onWorldLimit be called?
10) Assigning the limitMode parameter to clamp will not keep your player on the screen.
11) Float values will rarely equal each other.
12) The results of your conditionals will not give any errors, but will effect no behavior.
13) When did the behavior get the variables {min|max}{X|Y}?
14) Logically, you are comparing x values to y values.
15) Logically, you are comparing vectors to floats.
16) As is, the {min|max}{X|Y} variables are not scene windows and do not have the camera position functions defined.
#10
?
if so...
1) Your onUpdate function is scoped to an incorrect class.
oops.
2) Where did the behavior get a player member variable?
I am not sure what you mean by "player member variable". %this = $player?
3) Did you mean to define a function called getCurrentCameraPosition in your behavior?
yes, I thought by placing it where I did. onUpdate, it would call the camera position for the entire behavior, thus making it easier to get when needed, later in code.
4) Why is the last parameter of your setWorldLimits in the onUpdate set the way it is. This problem has been pointed out to you no less than six times.
Well only once really, but I asked, if it needs to be set to "true". You have not answered, I guess I am wrong, which parameter are you talking about? If you mean %this.sceneWindow2D.setWorldLimits(%mode, %minX, %minY, %maxX, %maxY, [%callback = true]);, should I remove the %this?
5) Do you mean for nothing to happen in your onUpdate function?
NO. I am not sure why you imply I would. Please explain. I really have no idea, as I thought this would work. I call something, that needs to be updated regualrly, ie currentCameraPosition, playerPosition etc.
6) Why is the last parameter of your setWorldLimit function set the way it is?
Again if you mean %callback or %maxY = getWord(sceneWindow2D, 1); =, either way I am unsure as to why this would be wrong.
7) All of your {min|max}{X|Y} variables in setWorldLimits will be invalid because you are incorrectly using getWord. You've told me no less than 3 times that you understood how this function worked.
I understand the mechanincs of it, what it does, I suppose I need to look at how more. Will study this more Sensei. Thanks.
8) There appears to be an extra bracket in your behavior.
OK. Thanks, will check.
9) How will setWorldLimit and onWorldLimit be called?
Hmm, I set callback to true. SHould it be called inside of something, another function, unsure.
10) Assigning the limitMode parameter to clamp will not keep your player on the screen.
Really, will it not "contain him"?
11) Float values will rarely equal each other.
So how should I equate my playerPosition to the {min|max}{X|Y}?
12) The results of your conditionals will not give any errors, but will effect no behavior.
I have experienced this some. Where a variable in a behavior, like spin limit for example does not work. Why is this. I am unclear on "conditionals". HAve a C++ book, will look up but an brief explantion would give you 3 gahbillion points sir.
13) When did the behavior get the variables {min|max}{X|Y}?
in setWorldLimits.
14) Logically, you are comparing x values to y values.
With in my onWorldLimits? If so, what am I doing wrong, the only explantion I would have is I am using the getWord, improperly, as in I am calling the wrong number. Probably not tho huh?
15) Logically, you are comparing vectors to floats.
Again, that seems wrong to me, I feel, (obviously I am not) when I look at it, there should be two vectors as points being called Xplayer and Xcamera.
16) As is, the {min|max}{X|Y} variables are not scene windows and do not have the camera position functions defined.
Still unsure, any explanation would be great.
Thanks so much for this William I really do appreciate it.
10/06/2009 (5:18 pm)
@William, are we talking about the linked behavior @http://www.garagegames.com/community/forums/viewthread/102125?
if so...
1) Your onUpdate function is scoped to an incorrect class.
oops.
2) Where did the behavior get a player member variable?
I am not sure what you mean by "player member variable". %this = $player?
3) Did you mean to define a function called getCurrentCameraPosition in your behavior?
yes, I thought by placing it where I did. onUpdate, it would call the camera position for the entire behavior, thus making it easier to get when needed, later in code.
4) Why is the last parameter of your setWorldLimits in the onUpdate set the way it is. This problem has been pointed out to you no less than six times.
Well only once really, but I asked, if it needs to be set to "true". You have not answered, I guess I am wrong, which parameter are you talking about? If you mean %this.sceneWindow2D.setWorldLimits(%mode, %minX, %minY, %maxX, %maxY, [%callback = true]);, should I remove the %this?
5) Do you mean for nothing to happen in your onUpdate function?
NO. I am not sure why you imply I would. Please explain. I really have no idea, as I thought this would work. I call something, that needs to be updated regualrly, ie currentCameraPosition, playerPosition etc.
6) Why is the last parameter of your setWorldLimit function set the way it is?
Again if you mean %callback or %maxY = getWord(sceneWindow2D, 1); =, either way I am unsure as to why this would be wrong.
7) All of your {min|max}{X|Y} variables in setWorldLimits will be invalid because you are incorrectly using getWord. You've told me no less than 3 times that you understood how this function worked.
I understand the mechanincs of it, what it does, I suppose I need to look at how more. Will study this more Sensei. Thanks.
8) There appears to be an extra bracket in your behavior.
OK. Thanks, will check.
9) How will setWorldLimit and onWorldLimit be called?
Hmm, I set callback to true. SHould it be called inside of something, another function, unsure.
10) Assigning the limitMode parameter to clamp will not keep your player on the screen.
Really, will it not "contain him"?
11) Float values will rarely equal each other.
So how should I equate my playerPosition to the {min|max}{X|Y}?
12) The results of your conditionals will not give any errors, but will effect no behavior.
I have experienced this some. Where a variable in a behavior, like spin limit for example does not work. Why is this. I am unclear on "conditionals". HAve a C++ book, will look up but an brief explantion would give you 3 gahbillion points sir.
13) When did the behavior get the variables {min|max}{X|Y}?
in setWorldLimits.
14) Logically, you are comparing x values to y values.
With in my onWorldLimits? If so, what am I doing wrong, the only explantion I would have is I am using the getWord, improperly, as in I am calling the wrong number. Probably not tho huh?
15) Logically, you are comparing vectors to floats.
Again, that seems wrong to me, I feel, (obviously I am not) when I look at it, there should be two vectors as points being called Xplayer and Xcamera.
16) As is, the {min|max}{X|Y} variables are not scene windows and do not have the camera position functions defined.
Still unsure, any explanation would be great.
Thanks so much for this William I really do appreciate it.
#11
Since I'm about to party, let's focus on #4 and #5.
Let's start with #4. It's been pointed out to you MANY times that there are not supposed to be square brackets around your parameters. In every single tutorial that you've supposedly done, not one of them has a square bracket around a parameter. In every single code example that comes with the engine, not one of them has a square bracket around a parameter. This is why everybody keeps asking if you've done the tutorials. It's painfully obvious that you haven't.
Moving on to #5. Why do I imply that your onUpdate function would do nothing? Because it's true. You call functions, many of which will just cause the parser and interpreter to choke. Nowhere in this code is any WORK being done. If this were a C++ compiler (and there weren't syntax and usage errors), the first 4 lines could get removed by the optimizer!
10/06/2009 (6:25 pm)
I don't even know where to begin.Since I'm about to party, let's focus on #4 and #5.
Let's start with #4. It's been pointed out to you MANY times that there are not supposed to be square brackets around your parameters. In every single tutorial that you've supposedly done, not one of them has a square bracket around a parameter. In every single code example that comes with the engine, not one of them has a square bracket around a parameter. This is why everybody keeps asking if you've done the tutorials. It's painfully obvious that you haven't.
Moving on to #5. Why do I imply that your onUpdate function would do nothing? Because it's true. You call functions, many of which will just cause the parser and interpreter to choke. Nowhere in this code is any WORK being done. If this were a C++ compiler (and there weren't syntax and usage errors), the first 4 lines could get removed by the optimizer!
#12
5. ok hmmm.
so is it what I am calling or how I am calling it?
10/06/2009 (7:31 pm)
4. oh, hmm, well i am dyslexic, but i blame that. My bad. 5. ok hmmm.
so is it what I am calling or how I am calling it?
#13
10/06/2009 (10:54 pm)
ps. don't party too hard. It's only Tuesday man!!!
#14
That said, let's examine just one line of your code, line #20.
I could continue for a very long time, and this is just one line! And, surprisingly, I STILL haven't done any work with it!
Imagine me spending that much time on each line, trying to explain what's wrong and interpret your intent. So while it would do you some good to have somebody go over each part of this with you, it would be a full-time job for several weeks. I have my own games to write, so this person cannot be me.
Run your game and bring up the console (Ctrl-Tilde or just Tilde, it depends). See what error messages you get and fix the problem in your code. Once you've got the behavior to a state where there are no more error messages coming out, then come back here with your questions.
Best of Luck!
10/07/2009 (4:44 am)
If you are dyslexic, I would recommend that you always go over all of your work slowly and carefully a second time. Programming, unfortunately, is picky about the tiniest of details. If you see square brackets in the examples, then you really need to slow down and analyze each section more carefully. And you'll never find a programming language that frees you from the burden of clarifying your ideas.That said, let's examine just one line of your code, line #20.
%this.player.getWorldLImits();For most purposes, a behavior will only have the variable "owner" set and the fields added by "addBehaviorField". Therefore, when you say "%this.player", you aren't accessing anything. Let's pretend that you meant to use "owner" instead of "player". Now you have
%this.owner.getWorldLimits();That function doesn't exist, but let's pretend you meant "getWorldLimit". Now you have
%this.owner.getWorldLimit();This function returns a string in the form "limitMode minX minY maxX maxY callback", but you aren't doing anything with it. The function returns it and then it is dropped. So let's pretend you meant to use the results and save it to a local variable. Now you have
%currentLimits = %this.owner.getWorldLimit();Now I have to try to interpret your meaning. Did you really intend to get the camera's edges instead of the object's limit? Or did you mean to factor in the size of the scene object?
I could continue for a very long time, and this is just one line! And, surprisingly, I STILL haven't done any work with it!
Imagine me spending that much time on each line, trying to explain what's wrong and interpret your intent. So while it would do you some good to have somebody go over each part of this with you, it would be a full-time job for several weeks. I have my own games to write, so this person cannot be me.
Run your game and bring up the console (Ctrl-Tilde or just Tilde, it depends). See what error messages you get and fix the problem in your code. Once you've got the behavior to a state where there are no more error messages coming out, then come back here with your questions.
Best of Luck!
#15
%currentLimits = %this.owner.getWorldLimit();
I do not have this line, but to me, it makes sense to use, i take you are recommending it. Having said that, I had not even written anything that EQUATED getWorldLimit to anything, I simply had %this.getWorldLimit(). So you are saying that by equating it to %currentLimits, I can use that call later to get the "current limits". If this is true, cool, thanks. It makes sense.
Regarding what I was/am trying to do, overall I thought a call to %currentWorldLimits compared to %currentPlayerPosition will calculate whether the player is with in or beyond the limits.
I have not yet set a %currentPLayerPosition but I imagine, going on this that...
%currentPlayerPosition = %this.owner.getPosition()
Thanks so much William, I will start using the Crtl-whatever button to check my console for errors.
Cheers, hope your not hung over.
Ren
10/07/2009 (8:59 am)
Ok, so last night, before I read this I went back and corrected a few things. I replaced %this.player, with %this.owner, removed the [] and removed an unwanted or shall i say unneeded bracket. So my code is now getWorldLimit (no s). This is good, by you saying I better understand. The getWorldLimit returns the same "string"(?) as setWorldLimit, but just plugs it in, doesn't actually do anything with it, no calculations, just a measuring cup if you will. %currentLimits = %this.owner.getWorldLimit();
I do not have this line, but to me, it makes sense to use, i take you are recommending it. Having said that, I had not even written anything that EQUATED getWorldLimit to anything, I simply had %this.getWorldLimit(). So you are saying that by equating it to %currentLimits, I can use that call later to get the "current limits". If this is true, cool, thanks. It makes sense.
Regarding what I was/am trying to do, overall I thought a call to %currentWorldLimits compared to %currentPlayerPosition will calculate whether the player is with in or beyond the limits.
I have not yet set a %currentPLayerPosition but I imagine, going on this that...
%currentPlayerPosition = %this.owner.getPosition()
Thanks so much William, I will start using the Crtl-whatever button to check my console for errors.
Cheers, hope your not hung over.
Ren
#16
With in the onUpdate I am unsure if I should be equating something or telling it do something. My instincts tell me, tell it to do, but from you are saying I should equate it with in onUpdate (if necessary).
example.
That would make sense right, as then I could call %currentPlayerPosition to get the position of where it currently is. If this is true, and this is where I get a bit confused is... this %currentPlayerPosition. I could use it in say the onWorldLimit function is an if statement? Say like this...
Would this input be correct? Also if true, would my %this.currentPlayerPosition need closing ()'s?
Thanks!
10/07/2009 (9:09 am)
One quick question tho.With in the onUpdate I am unsure if I should be equating something or telling it do something. My instincts tell me, tell it to do, but from you are saying I should equate it with in onUpdate (if necessary).
example.
function Spacer3000WorldLimits::onUpdate(%this)
{
%currentPlayerPosition = %this.owner.getPosition();
}That would make sense right, as then I could call %currentPlayerPosition to get the position of where it currently is. If this is true, and this is where I get a bit confused is... this %currentPlayerPosition. I could use it in say the onWorldLimit function is an if statement? Say like this...
function Spacer3000::onWorldLimit(%this stuff in here)
{
if (%this.currentPlayerPosition > %this.currentLimits)
{
%limit = true
}Would this input be correct? Also if true, would my %this.currentPlayerPosition need closing ()'s?
Thanks!
#17
Now I understand that you say that you are dsylexic and you obviously have some issues with grasping certain scripting concepts, and that's all well and good, but I highly recommend focusing on learning the basics before you go off to try and make your game, as the goals of making your game can interfere with the goals of learning scripting (and you need to learn scripting before you accomplish the goals aimed at making your game).
I've seen many of your posts, and while I have posted occasionally here and there to help you, I feel that I can't other than to ask you sincerely to take a step back and focus on the basics before you post scripts that you've created but, in fact, do not yourself understand. And the key here is that before you seek our help with your code, you yourself must understand what it is you can scripted, and that entails searching the documentation, doing dumps, looking at the console, and analyzing on your own before you come to the community.
If you continue to just throw script together without understanding and decide to just go to the community for every little question, you'll see fewer people try to help you. You seem to be very determined to make this game, and that's great, but you are not taking into consideration the fact that everyone here is also working on their own games, and the repeated questions that can otherwise be resolved by understanding Torque Script takes time away from what they would otherwise be doing.
Be considerate of the time of others and learn Torque Script, please and thank you.
10/07/2009 (10:52 am)
Rennie, please go read and understand this. It is a scripting language reference that tells you the different between variables and functions. You absolutely must grasp those concepts before you attempt even the most basic scripting. If you don't do that, and I see it happening here, you are burning out otherwise valuable help here on the forums. People are more than willing to help you, but if you do not at least try to learn the basics of scripting, then eventually your forums threads will go unanswered because people will figure that all you are doing is plugging in what other people give you without putting in the work to learn it.Now I understand that you say that you are dsylexic and you obviously have some issues with grasping certain scripting concepts, and that's all well and good, but I highly recommend focusing on learning the basics before you go off to try and make your game, as the goals of making your game can interfere with the goals of learning scripting (and you need to learn scripting before you accomplish the goals aimed at making your game).
I've seen many of your posts, and while I have posted occasionally here and there to help you, I feel that I can't other than to ask you sincerely to take a step back and focus on the basics before you post scripts that you've created but, in fact, do not yourself understand. And the key here is that before you seek our help with your code, you yourself must understand what it is you can scripted, and that entails searching the documentation, doing dumps, looking at the console, and analyzing on your own before you come to the community.
If you continue to just throw script together without understanding and decide to just go to the community for every little question, you'll see fewer people try to help you. You seem to be very determined to make this game, and that's great, but you are not taking into consideration the fact that everyone here is also working on their own games, and the repeated questions that can otherwise be resolved by understanding Torque Script takes time away from what they would otherwise be doing.
Be considerate of the time of others and learn Torque Script, please and thank you.
#18
10/07/2009 (10:56 am)
Thank you Ted, I will continue my learning path. So far it is good. Thank you.
#19
I hope my newbiness is helpful to anyone at my level. A message board is democratic, people can choose to answer or not. If I get help great. and I hope it helps someone else too.
@William
I have just plugged this code in, if you have a minute please tell me why it sucks or why it works.
10/07/2009 (12:10 pm)
@boardI hope my newbiness is helpful to anyone at my level. A message board is democratic, people can choose to answer or not. If I get help great. and I hope it helps someone else too.
@William
I have just plugged this code in, if you have a minute please tell me why it sucks or why it works.
function Spacer3000WorldLimits::onBehaviorAdd(%this)
{
%this.owner.enableUpdateCallback();
%this.owner.worldLimitCallback = true;
%this.owner.getCurrentCameraPosition() = %currentCameraPosition;
%this.owner.setWorldLimit(sticky, %minX, %minY, %maxX, %maxY, true)
{
%minX = ((getWord(%currentCameraPosition, 0) - 50);
%maxX = ((getWord(%currentCameraPosition, 0) + 50);
%minY = ((getWord(%currentCameraPosition, 1) - 50);
%maxY = ((getWord(%currentCameraPosition, 1) + 50);
}
function Spacer300WorldLimits::onUpdate(%this)
{
%this.owner.getCurrentCameraPosition();
}
#20
Rennie, going back to what I said earlier, it is clear that you have not checked your own work before asking others to check it, nor have you tried to understand how the scripting language works. If you had done those two things, you would see that what you have would generate many errors in the console- which you should be looking at for error reporting before you come here.
Let's reverse the question: What do you see wrong with that script?
Very true. But what I am telling you has implications far beyond yourself. People who get burned out trying to teach other people things they should be able to learn on their own both prevents them from helping others with valid issues while at the same time makes them less apt to help in the future.
10/07/2009 (12:19 pm)
Quote:if you have a minute please tell me why it sucks or why it works
Rennie, going back to what I said earlier, it is clear that you have not checked your own work before asking others to check it, nor have you tried to understand how the scripting language works. If you had done those two things, you would see that what you have would generate many errors in the console- which you should be looking at for error reporting before you come here.
Let's reverse the question: What do you see wrong with that script?
Quote:A message board is democratic, people can choose to answer or not
Very true. But what I am telling you has implications far beyond yourself. People who get burned out trying to teach other people things they should be able to learn on their own both prevents them from helping others with valid issues while at the same time makes them less apt to help in the future.
Torque Owner rennie moffat
Renman3000
I just got it.
Velocity is made up by just multiplying a number, the float is a float, it is always just a number. Like a vector. But what does "-" mean ? I assume minus, if so doesn't that give me one number, when with a vector, which velocity is I need two numbers. Obviously I have them but again I think "-" is minus.
:?