The Daily Click ::. Forums ::. Klik Coding Help ::. dublicates problem again
 

Post Reply  Post Oekaki 
 

Posted By Message

Duke Highway



Registered
  11/03/2010
Points
  21
24th March, 2010 at 14:03:40 -

Hey guys,

I have the following problems:

I have three different objects (dublicates): "robot", "missile" and "direction missile". They are all differentiated by their Alterable Value A and T. When "robot" with AV A=1 shoots a missile at "robot" AV A=4, the "missile" and the "direction missile" have AV A=1 and AV T=4.

Problem (1): "direction missile" shall always look at the "robot" it was shot at, means "direction missile" AV T=4 shall look at "robot" AV A=4.
When a new instance of "direction missile" is created, the old one stops looking at the robot.

Problem (2): When "missile" is colliding with any object, the "missile" and the "direction missile" with same AV A shall be destroyed
Sometimes ALL "direction missile" are destroyed.

I think the main problem is, that I dont know how to compare EVERY instance ob "object1" with EVERY instance of "object2".
With

+ Alterable Value A "object1" = Alterable Value A "object2"
- ...

I compare all instances of "object1" only with the newest of "object2" (but I need to compare with ALL instances of "object2").
So, changing the event to

+ Alterable Value A "object2" = Alterable Value A "object1"
- ...

doesnt help me.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
24th March, 2010 at 15:24:00 -

Please give a more detailed description, or post a source file, and name your alterable values.
If you say *exactly* what you're trying to do, I could probably make an example file for you.


1.) You haven't described how you're assigning targets, so I'm going to assume it's by clicking - if not, you'll have to say.
+ Player clicks on "Robot"
-> Create "Direction Missile"
-> Direction Missile: Set "Target" to Fixed Value of "Robot"

+ Fixed Value of "Robot" = Target("Direction Missile")
-> Direction Missile: Set angle to ATan2(Y("Direction Missile) - Y("Robot"), X("Robot") - X("Direction Missile"))


2.) What's the difference between a "Missile" and "Direction Missile"?
Do they both have other alterable values? (apart from A and T)
Chances are, it doesn't matter which "direction missile" is destroyed, as long as there are always the same number of each. You could probably just say:

+ "Missile" collides with...
+ Pick "Direction Missile" at random
-> Destroy "Missile"
-> Destroy "Direction Missile"

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
24th March, 2010 at 15:45:40 -

Heres a link to the game so far. For really testing it, u need at least two computers because it is a LAN game... But maybe u can figure out whats wrong, just with the source file...

http://netload.in/datei1msKyPP9WL/Mech Assault.mfa.htm

The problems are in "Rakete" and "Kollisionen" in the first "Multiplayer" frame (its better for testing).
To see, how the missiles act, start the game, host a game, right click, point the cursor over the appearing mech, mouse wheel up till in the left upper corner is a "2" and left click.

Edited by Duke Highway

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
25th March, 2010 at 06:34:57 -

Argh! Spacing in URLS!

 
www.Solgryn.org

Image

Duke Highway



Registered
  11/03/2010
Points
  21
25th March, 2010 at 18:12:53 -

I updated the game and made an example of the problem. Also reuploaded the example... Help would be great.

http://netload.in/dateiFvjaetMMNK/Missile Example.rar.htm
(dont know how to space in urls)

Edited by Duke Highway

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
25th March, 2010 at 18:40:15 -


Originally Posted by Duke Highway
I updated the game and made an example of the problem. Also reuploaded the example... Help would be great.

http://netload.in/dateiFvjaetMMNK/Missile Example.rar.htm
(dont know how to space in urls)



%20 = space

or

just use _ in the filename instead of space =P

 
www.Solgryn.org

Image

Duke Highway



Registered
  11/03/2010
Points
  21
25th March, 2010 at 18:46:11 -


http://netload.in/dateiFvjaetMMNK/Missile%20Example.rar.htm

works, thx ^^

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
26th March, 2010 at 17:44:09 -

Finally solved the problem. Thank you Sketchy for the arctan formula. It was REALLY helpful...

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
26th March, 2010 at 18:19:01 -

Glad you solved your problems
I did download your file, but I couldn't figure it out.

 
n/a

Duke Highway



Registered
  11/03/2010
Points
  21
26th March, 2010 at 19:06:12 -

Uploaded the working example, just for the ones interested in it... (its german, but u will figure out whats new. its the only fastloop in it and the first one i ever used )

http://netload.in/dateiMYlbKcqVVb/Rakete%20Beispiel3.mfa.htm

 
n/a
   

Post Reply



 



Advertisement

Worth A Click