The Daily Click ::. Forums ::. Klik Coding Help ::. The advanced movement object for the games factory really dosnt work properly.
 

Post Reply  Post Oekaki 
 

Posted By Message

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
22nd March, 2004 at 21:32:12 -

I was working on an engine for a sonic game and clwe (the person that created sonic diy demo) was kind enough to show me an example of his way around wall climbing using sine and cosine.
i needed mmf to open it so i got the demo version and opened it, after a LONG time trying to type the events into tgf and getting the thing working.
on the very last line i typed i came across a problem.

the advanced math object has a function called fixed object where it can releate angles from an object and the engine im using needs this

so i typed it and and when i pressed enter one of the brackets was missing and now no matter how many times i put the bracket in it still goes away.

trying to run the program crashes it because its actually an invalid expression.

so i type
set counter to FixedAngle( "Advanced Math object", X( "right" ), Y( "right" ) )
and pressing enter it turns to
set counter to FixedAngle( "Advanced Math object", X( "right", Y( "right" ) )


if you are still with me here i was wondering if there was any other way to figure out an objects angle using its x and y position.
a formula mabye?

phew long post, i hope someone can help.

 
.

Kramy



Registered
  08/06/2002
Points
  1888
22nd March, 2004 at 23:39:11 -

Try adding a space after the bracket it deletes, and before it. You might also try setting an alterable value/counter to the x coordinate before calculating it, then get the alterable value.

 
Kramy

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
23rd March, 2004 at 10:10:53 -

will do!

 
.

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
23rd March, 2004 at 10:20:01 -

i tried both ways but the bracket gets deleted no matter how it is done.
thanks for the suggestions anyway.

 
.

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
23rd March, 2004 at 11:04:33 -

I had this weird bracket bug before too. I solved it by placing two brackets instead of one. After that the expression was valid, the game crashed in runtime...

 
This space is for rent

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
23rd March, 2004 at 12:31:01 -

The double brackets thing works (It's a known TGF bug). You might be able to put +0 after it too if you're having problems.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
23rd March, 2004 at 20:52:38 -

i tried the double bracket and the +0 ideas.

everything seemed to be going fine until i tested the frame.
it crashed on me

if only there was a way around this without having to use that part of the advanced maths object.

 
.

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
24th March, 2004 at 13:02:39 -

Im not sure what your purpose is with those angles as I have never worked with the advanced math object. If you want the angle between two objects: the tangent of x degrees is equal to Y of the second object minus the first divided by the X of the second object minus the first. In formula: Tan x degrees=(Y("2")-Y("1"))/(X("2")-X("1")) If you didn't know that already. I don't know if its usefull. Besides, you'll probably still need the advanced math object to use the tangent function

 
This space is for rent

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
24th March, 2004 at 13:56:11 -

i just realised i need to use tangents before checking here.
and now someone has posted a formula!!!!!

wooo ill try that straight away!
lets hope its good.
thanks to you all.

Image Edited by the Author.

 
.

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
24th March, 2004 at 14:00:42 -

That's no good as you'll only get a number between 0 and 90. Instead of using the angle from fixed object expression, use the other expression and subtract the end object positions from the start object positions as the parameters.

 
n/a

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
25th March, 2004 at 11:46:14 -

D'oh! Your right, it calculates the angle in a triangle...sorry

 
This space is for rent

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
25th March, 2004 at 21:06:28 -

im a little confused now
what expression do i use?

I just noticed that i called the object the advanced movement object in the title.
i meant Maths not movement.
im sure everyone knows anyway


Image Edited by the Author.

 
.
   

Post Reply



 



Advertisement

Worth A Click