Game Development Community

Massive Waiting Time

by rennie moffat · in Torque Game Builder · 10/21/2009 (5:30 pm) · 16 replies

Hi Guys,
My TGB is running annoyingly slow (looking into a windowsOS), not a problem. So anyways I have taken to just writing script. I haven't been able to test it with out massive time wasting back up so.. I am just wondering, if anyone around has a chance, please go over this script and tell me of any glaring errors or bad habits I am writing.


Thanks:]...





if (!isObject(Enemy))
{
  %template = new BehaviorTemplate(Enemy);
   
  %template.friendlyName = "Enemy";
  %template.behaviorType = "AI";
  %template.description  = "Enemy, Spawn, Life and Movement Behaviors";
 
}

function Enemy::onBehaviorAdd(%this)
{
  %this.owner.enableUpdateCallback();
  %this.setWorldLimit();

}

function Enemy::onBehaviorRemove(%this)
{
  if (!isObject(moveMap))
    return;

  %this.owner.disableUpdateCallback();
}

function Enemy::onUpdate(%this)
{
  %this.owner.EnemyPosition = %this.owner.getPosition();
  %this.owner.getWorldLimit();
}

function Enemy::EnemyPosition(%this)
{
	%this.setAngularVelocity(%speed, %angle);
	%this.speed = 30;
	%this.angle= %this.getRandom();
}

	
function Enemy::getWorldLimit();
{
		%this.owner.getPosition() = %this.Position;
		if(%this.Position(getWord(getX, 0), getWord(getY, 1));
		if(%this.getX >30)
		{
			%this.right;		{
		}
		
		if(this.Position > 30)
		{
			%this.bottom;
		}
		
		if(%this.getX < -30)
		{
			%this.left;
		}	
		
		if(%this.getY < -30)
		{
			%this.top;
		}
}
		
		
funtion Enemy::onWorldLimit()
{
	if(%this.owner)
	{			
		%this.right()
		{
			%this.owner.setLinearVelocityX(-15);
		}
	
		%this.left()
		{
			%this.owner.setLinearVelocityX(15);
		}
	
		%this.top()
		{
			%thisowner.setLinearVelocityY(15);
		}
	
		%this.bottom()
		{
			%this.owner.setLinearVelocity(-15);
		}	
}

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.


#1
10/21/2009 (6:26 pm)
Sorry, everybody, but I can't contain myself.

Rennie, almost every line has an error. You cannot type random lines onto the forum and ask for somebody to fix it.

Because you'll bitch if I don't provide actual help, I'll start this whole process over again.

%aString = "This is a string.";
%firstWord = getWord( %aString, 0 );
echo( %firstWord ); // This would print out "This" (without the quotes).
%secondWord = getWord( %aString, 1 ); // %secondWord now equals "is".
%thirdWord = getWord( %aString, 2 ); // %thirdWord now equals "a".
%fourthWord = getWord( %aString, 3 ); // %fourthWord now equals "string.".

%aPosition = %this.owner.getPosition(); 
// %aPosition now contains a string in the form "x y"

%xPosition = getWord( %aPosition, 0 );
%yPosition = getWord( %aPosition, 1 );

How can you not have learned this already?
#2
10/21/2009 (6:31 pm)
Also, and this goes for everybody, the title to this post is horrendous.

Pretend that I'm having troubles with "enableUpdateCallback". I do a forum search and I get a long list of posts. One of them has the title "Massive Waiting Time". That sounds like it might be related, so I have to click on it. It makes searching the forums VERY tedious and impossible for new users.

Your title should be "Can't Use TGB Right Now, Could Somebody Check My Syntax For Me?".
#3
10/21/2009 (6:42 pm)
I am not asking you to fix it.
This is my major problem with you and Erichl, or what ever his name is.

I based most of my work off a pattern, so my work, tough it may be wrong, must not be GLARINGLY wrong.

Perhaps if you see a habit, that you can pick out. nothing major.



I do appreciate your response tho, I will go over your code. My internet has been down as well all day too. I am just looking for help, not a beating, remember the term newbie applies to my knowledge level. I don't think I have ever "bitched" at you. Maybe Erichl, but that's a different story.


Thanks Again William.






The thing about me learning, maybe this will better help you understand me, is that i am learning an approach to building, I know I may be off, but not as far off as I was last week, nor the week before nor the month before that.

Once I learn the patterns in and out I will be fine,
still any comments, please don't make them harsh, again remember I have virtually no TGB at the moment nor, this afternoon, any internet, it came back up when I posted this, after an hour of "free styling"


again. please don't go ape shit anyone it is just a question.
#4
10/21/2009 (8:01 pm)
None of my comments have ever been written with any anger behind them.

I do find that everything I say to you is taken with complete hostility on your part.

I did not go "ape shit" on you. I just said that every line of your code had an error in it. In your post you asked if there were any glaring errors. The answer was "yes, every line has an error on it, almost all of them glaring".

I then proceeded to give you a very specific example of where there was an error. As much as you protest, you still haven't learned the most basic of functions in the Torque Scripting Language, getWord. I tried to show you an example of how it works. Specifically, I gave you the pattern needed to use it.

Then I pointed out that you hadn't even tried to compile it yet. Your title should have reflected that you weren't having problems with "Massive Waiting Time", but with the inability (at least today) to compile your scripts before posting them here.
#5
10/21/2009 (8:31 pm)
Ok Fair Enough Sheriff. I will reflect that more accurately but it is the internet and it is quick check its not like I made you drive across town. But just to give you a heads up. I studied advertising so coming up with catch phrases in order to snag clients like "TGB it's Awesome" or something like that are common place for me. Sorry if you were mislead.

:?


PS.
I am going to use my getWord thread to study up. I know it was there but again, today, had no way to access it.

Thanks.


#6
10/21/2009 (8:53 pm)
You are right. It isn't like you made me drive across town. So when I answered your question, I didn't expect hostility on your part.

But just to give you a heads up, I like to use the forums, so if you have another "catch phrase" for a title, I'll re-post my request to make the title more search friendly.

As for finding posts, you can click on your name next to your replies. There is a link that says "142 threads". If you click on that, that will list the threads you created. You'll find a thread with the title "getWord.word". (See how titles that have meaning are helpful?) This is the thread you are looking for.
#7
10/21/2009 (10:55 pm)
um yes William, master of threads, not to be cheeky. I understand how threads work, but again, I was working on it with out internet or scripts, just off the top of my head.

I have played a lot of sports, a coach or teacher would help, take me aside what ever. I am sure the hostility you have felt, if any came from my hostility towards Elchr, he answers in provoking ways, not you as such I have never directed anger at you. At least never intended.


#8
10/22/2009 (1:36 am)
keep saying im the source of all of your problems, and dont try to actually learn what you've been tought here...

while it's true that im sick and tired of you BS, dont try to come here and look like an innocent sheep ... some more ppl might not say it out loud, but we all know you're full of ........

i'll say it again, read the docs, try and code the things by yourself, debug your code and all that, and when you REALLY feel like you're stuck, come and ask (not cry) for help ... cuz, from my POV (and im sure in some more ppls pov) what you're doing is just WRONG, i cant hide my concern about it.

you might have noticed that i've stopped "hunting" you, but if you keep trying to blame me for your clumsiness or whatever you wanna call it (i have a better word, but im forbidden to call you names here), then, im sorry but i have to defend myself then...

dont take my (and other ppl's) advice, you'll wind up asking questions that wont get any answers at all eventually... even if everyone knows it.... and why is that? because you dont bother on investigating before asking for something as easy as to "how to use the getWord command"... just a hint, its on the docs, and many MANY posts in the forum.
#9
10/22/2009 (2:51 am)
Just to clarify, I was trying to help you find your thread in response to your statement:

Quote:I am going to use my getWord thread to study up. I know it was there but again, today, had no way to access it.

It appears you had access to the forums to make your post in the first place, so I just wanted to show you how you could find your previous post on getWord.

If you already knew how to find it, I'm sorry to have given the silly step-by-step.
#10
10/22/2009 (10:08 am)
@ William,
not a problem, thanks again.



@Erich
Yes I am reading the docs and practicing scripts. While I am a newb I am no longer a complete newb. I realize why you guys were being hard on me, but at the time, I never, was "not reading the scripts" or "not learning" or "expecting you to write my code for me" I was just asking questions. That is what is great about forums and the internet in general, it helps level the playing field.

Thanks Again.
#11
10/22/2009 (12:23 pm)
Quote:
@Erich
Yes I am reading the docs and practicing scripts. While I am a newb I am no longer a complete newb. I realize why you guys were being hard on me, but at the time, I never, was "not reading the scripts" or "not learning" or "expecting you to write my code for me" I was just asking questions. That is what is great about forums and the internet in general, it helps level the playing field.

you can say all you want, but trust me, no one buys that BS anymore... for instance:

Quote:
So anyways I have taken to just writing script. I haven't been able to test it with out massive time wasting back up so.. I am just wondering, if anyone around has a chance, please go over this script and tell me of any glaring errors or bad habits I am writing.

if you're not expecting soeone to write the code for you, or you're reading the docs, and learning from writing your own scripts, what was that question for? ... after waht?, 4 months of TGB Scripting on your side, you should be able to spot errors like the ones in the code posted... w/o the need to compile... but still you come and ask for help in the forums.

so, i REALLY doubt you're actually learning anything... i wont say you dont read the tuts (i doubt you read the docs) because at least you take the time to butcher some code from there and then come to the forums asking for help on a code you didnt write, you dont understand (and dont really intend to) and thus, waste our time.

yeah... forums are great if you ahve REAL DOUBTS about something, but in the 142+ post you made in your entire career in the forums, 90% of them are rubbish and useless BS that you could have solved YOURSELF if you actually take the time to STUDY... but yeah, i guess its easier to BOTHER someone else with questions that are explained to death on the forums and in the engine documentation.

take care.
#12
10/22/2009 (12:53 pm)
Again, E, you are not reading what I write.

I said I DO NOT expect anyone to write my code, I was just asking questions. What is so wrong with that? This is a board, where people come for help, to ask questions.


Sheesh.
#13
10/22/2009 (12:55 pm)
Oh and again, what I think is not "rubbish"

You really have a negative attitude, you should check that out.

Remember, one mans floor is another's ceiling, so while I may be 20 levels below you now I will probably be kicking your programming but one day, so please be nice.
#14
10/22/2009 (12:58 pm)
you dont expect anyone to write your code, you dont expect anyone to debug your code, you dont expect anyone to do anything for you, yet you come every day, create a countless number of useless threads asking for useless BS and still, you wonder whats so wrong with that?... d00d.

its true that this is a board where ppl come for help ... but you're not asking for help, your asking for tutoring, and unless you PAY US for that, i dont think we need to go thru this day in and day out... and you know whats funny?... even if you pay us for that, we would give you the same advice after every tutoring class: GO READ THE DOCS, SO YOU COULD ADVANCE FASTER...

laters.
#15
10/22/2009 (1:04 pm)
This is why the chinese were and are smarter then the whites.

Please hear me out. The Orientals did not hide there knowledge, insight, education from one another, they shared it, as such they were/kinda are in some ways still far more advanced then the west. Heck they kinda run the video game gambit. Anyways, in the West, Christians, Catholics if you will, the base of North American thought, the powers that be hid the knowledge from the people, they would not teach them how to read or write. It left us with a thing we like to call the "Dark Ages" or the "mid Evil Times".





So My point is, by you acting like that, you are lessening your own worth. To answer something that would take a basic yes or no, two seconds of your time, you have waisted 5 of mine. PLEASE if you don't have a quick answer for me, DO NOT I repeat, Do Not Answer.


Thanks.


Being selective is a good thing, its how we evolved.



#16
10/22/2009 (1:24 pm)
awww!... how wise!... yet, still full of.... dude, while its true that the asians somehow loved to share the info one to another, its also true that they suffered somehow of the dark ages too...

ALSO, when they were trying to teach someone something, and that person didnt really put any real effort to keep up with a given pace, they tried to make him catch up OR go at his own pace, but when they discovered that that person wasnt actaully tryin, they just left him alone... reminding him (one way or another) that he wasnt trying and that if he wanted help from them, he needed to actually try.

so, again, its not like im not trying to help you... is just that you dont actually take my messages for what they are... ADVICE.

why would i give you a quick answer if all you will do later is ask for the same thing, in a different way?... wouldnt it be better if you actually tried, so when you come with a new (real) question, that hasnt been answered, we help you with that?... wouldnt that be awesome?