Jump to content


Photo

'direction' is broken


  • Please log in to reply
21 replies to this topic

#1 TheOctagonTheory

TheOctagonTheory

    GMC Member

  • New Member
  • 26 posts

Posted 22 March 2012 - 12:09 AM

The 'direction' property of object instances is broken and always returns zero. So I can't get the rotation of an object. Is there any workaround for 'reading' the direction of an object instance?

Edited by TheOctagonTheory, 22 March 2012 - 12:10 AM.

  • 0

#2 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8249 posts
  • Version:GM7

Posted 22 March 2012 - 12:11 AM

Don't double-post threads.
  • 0

#3 TheOctagonTheory

TheOctagonTheory

    GMC Member

  • New Member
  • 26 posts

Posted 22 March 2012 - 08:06 AM

Thanks for you valuable and friendly help!

Some people...

Don't double-post threads.


Edited by TheOctagonTheory, 22 March 2012 - 08:10 AM.

  • 0

#4 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16820 posts
  • Version:GM:Studio

Posted 22 March 2012 - 08:49 AM

What have you done to test this? I've just checked it out and it seems to work fine, so please post the code you used and the target device you tested for...
  • 0

#5 NAL

NAL

    凸ʕಠᴥಠʔ凸

  • YoYo Games Staff
  • 686 posts
  • Version:GM:Studio

Posted 22 March 2012 - 09:34 AM

My only suggestion - are you using physics? Box2D takes over anything like direction, speed, gravity etc as it has its own native settings for these. Changing them in GM would cause a lot of issues.
  • 0

#6 TheOctagonTheory

TheOctagonTheory

    GMC Member

  • New Member
  • 26 posts

Posted 22 March 2012 - 10:11 AM

I used the Chapter 3 'Galatic Mail' example from Game Maker Apprentice book. Even the example doesn't work. You can rotate the spaceship counter-clockwise completely (360 degrees) around. But if you try to rotate the spaceship clockwise it stops and can't get past 0 degrees rotation (east on a compass) because rotation is decreased to some arbitrary below zero. I tried reading 'rotation' only to find out that in the documentation that 'this variable is broken in HTML5, and will always return 0'.




What have you done to test this? I've just checked it out and it seems to work fine, so please post the code you used and the target device you tested for...


  • 0

#7 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16820 posts
  • Version:GM:Studio

Posted 22 March 2012 - 11:48 AM

That wiki was last edited a long time ago and is incorrect. I have tested in GM:Studio and GM:HTML5 and in both direction works fine... so, I repeat, could you please post the code that you say doesn't function as I have no access to the book you cite as your reference and could you also tell me what build of GM:Studio you are using (goto Help >>> About GameMaker to find this).
  • 0

#8 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8249 posts
  • Version:GM7

Posted 22 March 2012 - 01:20 PM

Thanks for you valuable and friendly help!

Some people...


Don't double-post threads.

I reported one of your threads because you broke a rule. Notice how one is missing? I gave you valuable help, because hell, some people have had all their threads closed for doing what you did. No need for that kind of attitude.
  • 0

#9 twelveways

twelveways

    GMC Member

  • GMC Member
  • 1383 posts

Posted 22 March 2012 - 02:23 PM

point_direction(xprevious,yprevious,x,y)
  • 0

#10 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14395 posts
  • Version:GM:Studio

Posted 22 March 2012 - 09:18 PM

direction is based on speed (hspeed,vspeed, motion_add/set). no speed, no direction, defaults to 0

post #9 could work for you if in the end step or draw.
  • 0

#11 TheOctagonTheory

TheOctagonTheory

    GMC Member

  • New Member
  • 26 posts

Posted 22 March 2012 - 09:24 PM

I'm not the one with the attitude. YOU ARE the one with the God-like attitude like a lot of nerds who run forums like this one and have the power to delete other people's threads. It goes to your heads. You could have explained yourself in a more gentle manner. "Don't double-post threads." => "I removed one of your threads because it is against the forum rules. Please don't double-post in the future." Your stern manner upset me.


Thanks for you valuable and friendly help!

Some people...


Don't double-post threads.

I reported one of your threads because you broke a rule. Notice how one is missing? I gave you valuable help, because hell, some people have had all their threads closed for doing what you did. No need for that kind of attitude.


Edited by TheOctagonTheory, 22 March 2012 - 09:26 PM.

  • 0

#12 Zesterer

Zesterer

    Professor of Articul

  • GMC Member
  • 1019 posts
  • Version:GM8

Posted 22 March 2012 - 09:28 PM

Eh... Buddy? Don't tick these people off...

As a *noob* (no offense) you aren't really in the place to argue. Just be polite, follow the rules, and you should get what you want. Don't try challenging the moderators.
  • 0

#13 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8249 posts
  • Version:GM7

Posted 22 March 2012 - 09:32 PM

I'm not a mod. My assumption was that this was going to be the thread to be locked/deleted, and whenever I report a thread for this reason, I usually give a quick message to the person that, along with the thread being removed shortly after, helps them to understand what they should avoid doing in the future. Considering your low post count and join date not being that old, I saw it necessary to simply point it out to you.

Your sarcasm creates the attitude, along with your insult towards me thereafter. I didn't even write anything mean, like damn.
  • 0

#14 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14395 posts
  • Version:GM:Studio

Posted 22 March 2012 - 09:33 PM

aversion to authority....

Listen, I answered your post... #10...

Let it be.

[edit] BTW, I suggest you re-read what BR wrote with a clear head. because he did not cause anything to alarm anyone, and he certainly did not say what you quoted him saying later on.
  • 0

#15 TheOctagonTheory

TheOctagonTheory

    GMC Member

  • New Member
  • 26 posts

Posted 22 March 2012 - 10:10 PM

I didn't mean that to be a quote. I meant that instead of:

"Don't double-post threads."

he could have instead used:

"I removed one of your threads because it is against the forum rules. Please don't double-post in the future."

Anyway. I WON'T double-post again. And thanks to those of you who did try to help me.

Back to the original subject of this thread...

If no speed equals no direction then when using the 'Move Free' action, why is there a place to enter a value for both direction and speed?

ANd if direction can only return zero if the corresponding object isn't moving, what does this do?

direction = direction + 10;
a = direction;

Shouldn't 'a' hold a value that is other than zero?




aversion to authority....

Listen, I answered your post... #10...

Let it be.

[edit] BTW, I suggest you re-read what BR wrote with a clear head. because he did not cause anything to alarm anyone, and he certainly did not say what you quoted him saying later on.


  • 0

#16 Zesterer

Zesterer

    Professor of Articul

  • GMC Member
  • 1019 posts
  • Version:GM8

Posted 22 March 2012 - 10:14 PM

No speed doesn't mean no direction. It means that the direction is only set when the speed is >0
  • 0

#17 TheOctagonTheory

TheOctagonTheory

    GMC Member

  • New Member
  • 26 posts

Posted 22 March 2012 - 10:49 PM

Maybe I'm barking up the wrong tree with trying to use 'direction' for what I want to do...

Is there a way to set/change/get the rotation of an instance of an object?

No speed doesn't mean no direction. It means that the direction is only set when the speed is >0


  • 0

#18 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16820 posts
  • Version:GM:Studio

Posted 23 March 2012 - 12:15 AM

Ho hum...funny how you focus on a comment buy one of the members WHO ISN'T A MODERATOR yet you completely ignore the post by one of the Administrators who also happens to work at YoYo Games. Posted Image

Now, if youŽd care to go back and read what I said, we could possibly sort this out a hell of a lot quicker...
  • 0

#19 TheOctagonTheory

TheOctagonTheory

    GMC Member

  • New Member
  • 26 posts

Posted 23 March 2012 - 01:06 AM

I have the 'direction' problem in GM HTML 5 v1.0.218.

Here is the project file from the chapter 3 of the Game Maker Apprentice book.

It can be imported and run in GM HTML5. It won't run in GM Studio v1.0.114. Use the right/left arrow keys to rotate the rocket. The rocket can be rotated completely counter-clockwise using the left arrow key, but it can only be rotated clockwise to the zero direction (east) using the right arrow key. The rocket will not rotate clockwise past that position. I believe it's due to the Move action: (direction: direction - 10) not being able to represent a proper value when 10 is subtracted from 0.

Thanks

Ho hum...funny how you focus on a comment buy one of the members WHO ISN'T A MODERATOR yet you completely ignore the post by one of the Administrators who also happens to work at YoYo Games. Posted Image

Now, if youŽd care to go back and read what I said, we could possibly sort this out a hell of a lot quicker...


  • 0

#20 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14395 posts
  • Version:GM:Studio

Posted 23 March 2012 - 01:54 AM

it's not direction that's broken. It's the change sprite d&d

replace the d&d with a code box d&d and use this code

image_index = direction/5;


it looks like the change sprite d&d have become a little less smart. it does not interpret the code for values (or does so badly)... Where as the windows version do interpret code.

I suspect this d&d is not the only victim of the short coming

It's in the hands of yoyo now. Nocturne?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users