The Daily Click ::. Forums ::. Klik Coding Help ::. 360 degree offset.
 

Post Reply  Post Oekaki 
 

Posted By Message

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
10th June, 2009 at 03:30:17 -

After a quick peruse of the forums I haven't been able to work this out...
I'm using a 360 degree aiming engine I found on here (can't remember where) using the Advanced Direction Object. The arm that points towards the mouse/reticule has its hotspot over the shoulder, and it's action point a few pixels above and to the right/left of the hotspot in the barrel of the gun (the exact location varies from weapon sprite to weapon sprite). My problem at the moment is one of two things: With this method, the bullets are offset from the reticule (Due to the difference between the hotspot and action point locations, I'm guessing). I can get around this by changing the x and y values that the ADO looks at from the hotspot to the action point, but this causes the arm sprite to jitter around like crazy when you get too close to it with the mouse...

Anyone got any help/fixes?

Cheers.

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
10th June, 2009 at 11:26:34 -

It's sort of a bug, and like most bugs, it's a bit hard to find out where the source of the problem is without the code

One quick fix would be to disable the arm sprite from aiming when it's too close to the mouse. Just add a condition that the distance has to a minimum distance, large enough to prevent the jittering.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
10th June, 2009 at 16:32:06 -

Thanks for the reply. I tried the solution you mentioned but I was wondering if there were any other options

http://www.byond.com/members/Milo87/files/360Shooting.mfa

Another point: I'll be interested to see if other people can download from that link. It should allow direct downloading but I've never tried it outside of Byond before...

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
10th June, 2009 at 16:53:45 -

Hmm..can't see a quick fix to it, I'll try to look at it in 2 weeks though, if nobody else does.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
10th June, 2009 at 17:00:06 -

Ok, cheers again for your help

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
10th June, 2009 at 17:52:19 -

To stop the "jittering":

In the second event -> First action -> set Player Arm's Angle to ...
Change The first coordinates to the Player Arm's hotspot instead of it's action point.

The bullet wheren't offset, but they become this way. Perhaps just change the Player Arm's action point & center the bullet hotspot?

Edited by Spitznagl

 
...

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
10th June, 2009 at 19:14:32 -

I said in my first post that I'd tried aiming from the hotspot rather than the action point. That's what causes the bullets to miss the reticule since the action point is in a different location to the action point. Thanks for the feedback, though. Your second point has given me an idea!

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
10th June, 2009 at 20:02:29 -

Hum... Sorry, I obviously didn't read everything .

Solution: First, use the hotspot for the arm rotation, then, in the same event (the second), Replace the Yellow bar's(simply named "Active") actions by these:
______________________________________________
[Just copy/paste into the expression editor]

+ Set X position to:

XActionPoint( "Player Arm" )+(Cos(Angle( "Player Arm" ))*Abs(Distance( "Advanced Direction Object", XMouse, YMouse, XActionPoint( "Player Arm" ), YActionPoint( "Player Arm" ))))

+ Set Y position to:

YActionPoint( "Player Arm" )-(Sin(Angle( "Player Arm" ))*Abs(Distance( "Advanced Direction Object", XMouse, YMouse, XActionPoint( "Player Arm" ), YActionPoint( "Player Arm" ))))

+ Set Angle to:

Angle( "Player Arm" )
______________________________________________

Both problems solved

Edited by Spitznagl

 
...

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
12th June, 2009 at 19:01:53 -

Ah! Marvellous! That's a really nice effect thanks

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Spitznagl

Cabinetmaker

Registered
  06/12/2008
Points
  4260

The SpinsterVIP MemberHas Donated, Thank You!Picture Me This Round 29 Winner!Picture Me This Round 31 Winner!Picture Me This Round 36 Winner!
13th June, 2009 at 00:52:32 -

No problem
Now it's offset with the cursor, but it probably doesn't matter.

 
...

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
13th June, 2009 at 01:11:05 -

It shouldn't. The mouse and the reticule are never going to be visible at the same time so it shouldn't be too noticeable. Now that annoyance is out of the way I can actually start progressing with this little project...

 
There are 10 types of people in the world: Those who understand binary and those who don't.
   

Post Reply



 



Advertisement

Worth A Click