The Daily Click ::. Forums ::. Klik Coding Help ::. im stumped
 

Post Reply  Post Oekaki 
 

Posted By Message

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
10th February, 2008 at 03:31:25 -

so i came up with an idea for a little game (FINALLY!)

and i wanted to do 360 shooting...and then i forgot how lol.

i been looking for tuts on doing it in tgf but the one i used way back when that worked so perfectly doesnt seem to exist anymore. and i cant find it on any of my disks or computers. so i set out to do my own. i used basic trig for 360 degrees and the advanced math object but i cant seem to get it working just the way i want. its the stupid offset that i dont know exactly when to divide and when to multiply by.

so if anyone can help a fellow out, id love an example that uses the advanced math object and trig, cause i want to be able to tune it once i get it.

please and thank you!!!

 
n/a

Dustin Gunn

Gnarly Tubular Way Cool Awesome Groovy Mondo

Registered
  15/12/2004
Points
  2659

Game of the Week WinnerKlikCast StarVIP MemberI'm on a BoatGOTW Winner Oct 2010Kliktober Special Award Tag
10th February, 2008 at 10:39:38 -

I recommend just using trig for something that simple.

It's really just as easy as this:

Set x position to x position + cos(angle) * distance
Set y position to y position - sin(angle) * distance

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
10th February, 2008 at 15:33:34 -

i dont think you can just use trig like that in tgf. thats what the advanced math object is for. and the offset thing is a bitch.
its not the trig i have a probelm with. thats the easy part.

anyway i found an example on a backup disk of mine. its not exactly what i want, but i think itll do. oh how i wish for mmf2.

Image Edited by the Author.

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
12th February, 2008 at 02:16:02 -

You can't! Or at least I haven't seen it done. If you toss the trig formula like that, MMF is gonna turn the cos(angle)*distance into integers, which doesn't work for small numbers, like if distance was set to 1. If you can turn it into a float, it should work fine, but I'm not sure if TGF has that. I scrapped another project just because of this problem.

 
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

Ricky

loves Left For Dead 2

Registered
  28/12/2006
Points
  4075

Has Donated, Thank You!Game of the Week WinnerVIP MemberWii OwnerHero of TimeGOTM Winner! - November 2009I am an April Fool
12th February, 2008 at 02:36:40 -

You can use values to account for the decimal values, thus avoiding rounding errors

Upon the object being created (no such condition exists, you'll have to insert it into the same event in which the object is created)
- set vale A to x coordinates
-set value B to y coordinates

Always
- add to value A: cos(angle) * speed
- add to value B: sin(angle) * speed
- set x coordinated to vale A
- set y to value B

I know this works in mmf2. Probably won't work in TGF
I made an example. It works but its .mfa
http://www.esnips.com/doc/19a2a585-1092-4a1e-aa93-68ab520864c7/true-360-shooting

Image Edited by the Author.

 
-

Dustin Gunn

Gnarly Tubular Way Cool Awesome Groovy Mondo

Registered
  15/12/2004
Points
  2659

Game of the Week WinnerKlikCast StarVIP MemberI'm on a BoatGOTW Winner Oct 2010Kliktober Special Award Tag
12th February, 2008 at 07:55:35 -

use alterable values instead of direct positions.

Then again tgf only has integer alterable values!

what I'm trying to say is upgrade to MMF2

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
12th February, 2008 at 12:09:10 -

i dont know if id use it enough to want to buy it. thats why im holding off. i would totally buy mmf1.5 if it were still available.

ive seen tgf do the trig. i just dont remember how and couldnt find the example that used to be up on here. i even made a nice 360 shooting engine but i never backed it up and it got lost in a computer crash.

 
n/a

nim



Registered
  17/05/2002
Points
  7234
14th February, 2008 at 18:01:22 -

Hi Cecil, I've just found an old rotation example I made in TGF using Advanced Math object. It's basically sin/cos as Dustin explained, with an extra variable (Global Value 1) used for acceleration/deceleration on the rotation. I don't have TGF installed anymore but if you have the Advanced Math Object and TGF1.6 it should work.

http://lowflyingcow.googlepages.com/rotation.gam

As for MMF1.5: it might not be available from Clickteam anymore but I'm sure there are a lot of people who would be happy to sell their copy.

 
//

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
14th February, 2008 at 18:46:57 -

alright. thanks much. I'll dl when I get off work . hope its more of what I'm looking for than what I already got.

 
n/a

brainborg



Registered
  14/02/2008
Points
  21
14th February, 2008 at 20:05:31 -

always (arm object name) look in direction of (target name)

Hav an arm with a gun attached to the player. then press fire 1 to shoot.

 
"I vill insert ze machine in ze brain. Don't panick. This vill make your brain turn into pancakes."

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
14th February, 2008 at 20:46:35 -

no sir. you fail. go away. (thats only a possibility of 32 directions in in tgf. NOT 360 degrees.)

 
n/a

brainborg



Registered
  14/02/2008
Points
  21
14th February, 2008 at 20:51:31 -

ok. I guess i wont talk to you on this post anymore.

Image Edited by the Author.

 
"I vill insert ze machine in ze brain. Don't panick. This vill make your brain turn into pancakes."

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
14th February, 2008 at 20:52:37 -

alright. talk to you on another than? id be delighted sir. maybe? possibly? why dont you love me!?!?!

 
n/a

brainborg



Registered
  14/02/2008
Points
  21
14th February, 2008 at 20:53:48 -

it is valentines day. LOL

 
"I vill insert ze machine in ze brain. Don't panick. This vill make your brain turn into pancakes."

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
14th February, 2008 at 21:03:26 -

will...you be my....valentine? jk. i dont roll that way. unless your a chick then yes i do

anyway. thanks nim. that looks mighty handy. if i can get it to work well to angle with the mouse using that method, then ill definitely be using it. btw dont use mouse control objects in tgf. it screws with normal mouse function. other than that. thanks much.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click