User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: I need a "sight zone"

  1. #1
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I need a "sight zone"

    Hi there,

    so im bulding a canon in MMf2. For now I made multiple Duplicates [instances] of the canon with each one having a object [a square = line of sight] overlapping it so if the player is entering this area he will be shot .

    So my problem ist that i also said if the player leaves the square he should stop shooting. But if i place several isntances in a row the squares over the canons are overlaping each other [because of the order] in the place where they overlap each other only the square "counts" which is on the top of the layer. [thats beacause the player only can overlap this area ]

    Is there a way to make something like this "line of sight" square without being a object or someting like objects which has the same order number and not overlapping each other?

    So the best thing would be something light this quare (or triangle etc!) which represents a zone rather than an object is there something which can do this?

    my english ist not very good I hope you can understand my Issue.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My friend go here: http://www.castles-of-britain.com/mmf2examples.htm

    there's a source files in C-D examples that talk about distances......

  3. #3
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, I managed it with the Absolut value of the difference of the xpositions. Are there any codes for some shapes like a triangle for this method?

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can teach you how to do a "pizza slice" type Line Of Sight wich will work for each individuall cannon without using any additional objects.

    Is this what you are after?

  5. #5
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    geothefaust's Avatar
    Join Date
    Jul 2006
    Location
    Portland, OR
    Posts
    498
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by King_Cool View Post
    I can teach you how to do a "pizza slice" type Line Of Sight wich will work for each individuall cannon without using any additional objects.

    Is this what you are after?

    I would love to hear about it.

  6. #6
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    geothefaust's Avatar
    Join Date
    Jul 2006
    Location
    Portland, OR
    Posts
    498
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by King_Cool View Post
    I can teach you how to do a "pizza slice" type Line Of Sight wich will work for each individuall cannon without using any additional objects.

    Is this what you are after?
    Hi King Cool. Is this something you've already typed up somewhere, or is it something you would need to type?

  7. #7
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by King_Cool View Post
    I can teach you how to do a "pizza slice" type Line Of Sight wich will work for each individuall cannon without using any additional objects.

    Is this what you are after?
    Yes thats what Im looking for, the best would be some manually generated cornerpoits by a 1x1pixel object but a static one wuld be good too !

  8. #8
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the late reply.

    Yes PixelatedPic, i have explained this on several occasions asi can remember, maybe ill make an article about this sort of thing sometime.

    Its importaint when you do this that you use Angle values instead of direction values for your Cannons direction. If your using directions instead of Angles, you can easily get the Angle value of the Direction by multiplying the Direction with 11.25

    ...
    FIRST 'DETECTION RADIUS'
    Lets say you have 3 Cannons, and you want each Cannon to be able to detect the Player when he ventures inside their detection radiuslike this:


    ...
    Youl have to give your Cannons 1 piece of AI, in the form of an AlterableValue.
    DistanceToPlayer_
    This piece of data should be the distance between the Cannon and the Player, and you do it like this ( using the ADO extencion ):

    Allways
    - Cannon set DistanceToPlayer_ to ( ADO ) LongDist( Xcannon, Ycannon, Xplayer, Yplayer )

    ...
    To make the Cannons able to detect the Player simply do:

    If DistanceToPlayer_ is lower or equal to 100
    - Your action ( Cannon is detecting the Player )

    If DistanceToPlayer_ is greater than 100
    - Your action ( Cannon is NOT detecting the Player )

    ...
    This will make your Cannons have an invissible detection radius of 100 pixels.

    SECOND 'VIEW ANGLE'
    Lets say you have 3 Cannons, and you want each Cannon to be able to detect the Player when facing him, like this:


    ...
    Youl have to give your Cannons 1 piece of AI, in the form of an AlterableValue.
    AngleDifferenceToPlayer_
    This piece of data should be the 'absolute difference between two angles', #1 the Cannons facing angle #2 the angle between Cannons possition and Players Possition, and you do it like this ( using the ADO extencion ):

    Allways
    - Cannon set AngleDifferenceToPlayer_ to ( ADO ) DirDiffAbs( Cannon Angle, (ADO)LongDir( Xcannon, Ycannon, Xplayer, Yplayer) )

    ...
    To make the Cannons able to detect the Player simply do:

    If AngleDifferenceToPlayer_ is lower or equal to 60 / 2
    - Your action ( Cannon is detecting the Player )

    If AngleDifferenceToPlayer_ is greater than 60 / 2
    - Your action ( Cannon is NOT detecting the Player )

    ...
    This will make your Cannons have an invissible endless 60 degree detection field in the direction they are facing.

    COMBINE THE TWO
    If you combine the two detection methods you will get an invissible Pizza Slice type Line Of Sight, like this:


    ...
    To make the Cannons able to detect the Player simply do:

    If DistanceToPlayer_ is lower or equal to 100
    If AngleDifferenceToPlayer_ is lower or equal to 60 / 2
    - Your action ( Cannon is detecting the Player )

    If DistanceToPlayer_ is greater than 100
    OR ( logical )
    If AngleDifferenceToPlayer_ is greater than 60 / 2
    - Your action ( Cannon is NOT detecting the Player )

    ...
    If you increase/ reduce the Cannons 'detection radius' ( 100 in the example above ), Cannons wil get a longer/ shorter Line Of Sight.


    If you increase/ reduce the Cannons 'view angle' ( 60 in the example above ), Cannons wil get a wider/ narrower Line Of Sight.


    ...
    Hope i was able to explaing this in an understandable way ( smiley face )

    The way i explain the code and use the variables is not the most optimized or flexible way of doing it, but rather my goal for this post was to explain the basic ideas of how to achieve this sort of invissible Line Of Sight, wich i hope i have been able to do in a good way.

  9. #9
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by King_Cool View Post
    ...
    Hope i was able to explaing this in an understandable way ( smiley face )

    The way i explain the code and use the variables is not the most optimized or flexible way of doing it, but rather my goal for this post was to explain the basic ideas of how to achieve this sort of invissible Line Of Sight, wich i hope i have been able to do in a good way.

    Wow this helps alot big THX King Cool

    By the way If i actually want to publish a game do I have to buy the extensions/ license to use them like ADO seperatly?

  10. #10
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)HTML5 Export Module (Steam)
    RockyRaccoon's Avatar
    Join Date
    Jul 2012
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by K_Tetsu View Post
    Wow this helps alot big THX King Cool

    By the way If i actually want to publish a game do I have to buy the extensions/ license to use them like ADO seperatly?
    I believe it depends on the extension creator's license , usually, you can learn more in the About Section of the Properties box when you have the object selected, that will tell you if it's 'Free for Non-Commercial Use' or 'Free Use' or have a Link to the Author's Website, where you can find out, or contact the Author to find out.

    For example, the 'MoveIt' extension lists this: http://andersriggelsen.dk/ as a Website for the Author, Anders Riggelsen in the about properties box inside MMF2, where it lists his E-mail, Phone Number where you could ask him what the commercial license to use his software is, or if he even has terms for commercial use, or, browse to his clickteam page, where it says they're free for commercial use.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. "Cannot load joystick2.mfx" when "Compress the runtime" unchecked. Fine when checked.
    By DistantJ in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th September 2013, 09:44 PM
  2. Compare to the number of "x" objects in a zone acting weird?
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 2nd February 2013, 04:26 PM
  3. Issues with "Clickteam Movement Controller" and "Runtime" Object
    By jimmyorpheus in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 29th November 2011, 07:10 AM
  4. Checking for a click "outside" a zone
    By INViSAR in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th March 2011, 12:18 PM
  5. How to check "line of sight"? If object blocked?
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 7th July 2010, 08:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •