The Daily Click ::. Forums ::. Klik Coding Help ::. How do yo use the move safely 2 object?
 

Post Reply  Post Oekaki 
 

Posted By Message

Smirnoff



Registered
  14/05/2009
Points
  356

VIP MemberI am an April Fool
23rd August, 2009 at 22:28:43 -

I asked this in my previous thread, but it went unanswered. There is an article here about the object, but is outdated and the example file is no longer available.

I am looking to use it with 360 degree aiming. Basically, just firing an object from the end of a gun at the same angle as the gun, toward the target reticle. How would I accomplish this?
I am just looking into a working 360 aim/firing system. Most posted here don't take into account that the speed of the bullets affected how they will collide with obsticles/enemies. I tried using a fastloop and while it works better, still doesn't work 100% of the time.

 
Image

Smirnoff



Registered
  14/05/2009
Points
  356

VIP MemberI am an April Fool
26th August, 2009 at 07:30:47 -

I see that like myself, others do not know how to use this object.

 
Image

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
26th August, 2009 at 19:38:17 -

Using Fastloops or Move Safely will give you exactly the same effect and will work 100% of the timeif done correctly, the only difference is that Move Safely is a much easier option, however I don't have any experience with it myself sorry

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
26th August, 2009 at 19:54:27 -

I have just experimented with the object and have worked out what you need to do!

When you press fire, create the bullet object and also:
move safely->add to protection (bullet) [set the step distance here, 1 being most accurate]
move safely->prepare safety
bullet->move (Your code, set the position of the bullet off the screen in the direction it should move)
move safely->commence safety procedure

Now you can add the condition 'move safely->On Safety' and add the bullet collision events as this is the point at which the bullet is moving.

I hope this helps you!!

P.S. There are example files for this object in your MMF directory

Edited by Klikmaster

 
n/a

Smirnoff



Registered
  14/05/2009
Points
  356

VIP MemberI am an April Fool
27th August, 2009 at 21:04:20 -

Perhaps you could explain the fastloop solution to me. How should I set it up so that the bullet will move fairly fast and have pixel perfect collision?

 
Image

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!
27th August, 2009 at 22:13:11 -

• Always
→ Start fastloop "Move", "#Steps" times

• On Loop "Move"
→ set X_Pos("bullet") to X_Pos("Bullet") + (Cos(Angle("Bullet")) * (Velocity("Bullet") / #Steps))
→ set Y_Pos("bullet") to Y_Pos("Bullet") - (Sin(Angle("Bullet")) * (Velocity("Bullet") / #Steps))
→ set Bullet: X position to X_Pos("Bullet")
→ set Bullet: Y position to Y_Pos("Bullet")

• On Loop "Move"
• Bullet overlaps < qualifier >
→ Kaboom!


It's not technicallly "pixel-perfect" (unless #Steps >= Velocity), but it's good enough, and potentially faster.
As with the MoveSafely extension, the fewer steps you use, the more efficient and less precise it is.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click