{"id":112,"date":"2011-12-03T23:02:34","date_gmt":"2011-12-04T06:02:34","guid":{"rendered":"http:\/\/chazix-scripts.com\/?p=112"},"modified":"2013-06-02T00:28:01","modified_gmt":"2013-06-02T07:28:01","slug":"dungeon-crawler-rts-controller","status":"publish","type":"post","link":"https:\/\/chazix-scripts.com\/?p=112","title":{"rendered":"Dungeon Crawler \/ RTS Controller"},"content":{"rendered":"<p><a href=\"http:\/\/u3d.as\/content\/chazix-scripts\/dungeon-crawler-rts-controller\/2tV\"><img loading=\"lazy\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2013\/06\/new_icon_2_24.png\" alt=\"DC\/RTS Controller\" title=\"Dungeon Crawler \/ RTS Controller\" width=\"100\" height=\"100\" class=\"alignleft wp-image-86\" \/><\/a>The <a href=\"http:\/\/u3d.as\/content\/chazix-scripts\/dungeon-crawler-rts-controller\/2tV\">DC\/RTS Controller<\/a> is designed to act as either a Dungeon Crawler or RTS System, meaning that the way the camera acts is in a bird&#8217;s eye, top down view. Such that in a Dungeon Crawler there is usually only one active controllable object, but in an RTS you usually have many controllable objects.<\/p>\n<p>The present features of the camera allow you to move it around in various ways. Such as, with the <strong class=\"variable\">W<\/strong>, <strong class=\"variable\">A<\/strong>, <strong class=\"variable\">S<\/strong>, and <strong class=\"variable\">D<\/strong> keys you can move it&#8217;s location forward, left, backward or right. With the <strong class=\"variable\">Q<\/strong>, and <strong class=\"variable\">E<\/strong> keys the camera&#8217;s rotation will pivot around counter-clockwise or clockwise, zooming in and out with the <strong class=\"variable\">mouse wheel<\/strong> is also supported. A toggle key: <strong class=\"variable\">Space Bar<\/strong> by default has also been implemented to allow for activation of the camera to move toward a selected controllable object if it isn&#8217;t near it, as well as make the camera follow that object. <!--more--><\/p>\n<p><a href=\"http:\/\/u3d.as\/content\/chazix-scripts\/dungeon-crawler-rts-controller\/2tV\"><img loading=\"lazy\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2013\/06\/main_dcrts_system.png\" alt=\"DC\/RTS System\" title=\"Dungeon Crawler \/ RTS System\" width=\"485\" height=\"389\" class=\"aligncenter size-full wp-image-266\" \/><\/a><iframe loading=\"lazy\" width=\"640\" height=\"360\" src=\"http:\/\/www.youtube.com\/embed\/LKA8-zR5xbE?feature=player_detailpage\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>\nThis package comes with individual class object handlers to allow you to sort between the various objects: <strong class=\"variable\">ControlObjHandler<\/strong>, <strong class=\"variable\">CreatureHandler<\/strong>, and <strong class=\"variable\">NPCHandler<\/strong>. With these you can attach the handler to a specific object to be able to receive and execute desired behavior, whether it&#8217;s controllable, a creature or an interactive npc.<\/p>\n<p>In terms of the <strong class=\"variable\">ControlObjHandler<\/strong>, they&#8217;re the main focus, the main player or player units. The behavior that they contain when you toggle them with a <strong class=\"variable\">mouse click<\/strong> first selects the single unit if it isn&#8217;t selected. From there any mouse click on anything besides another Control Object will toggle that unit to move to that location, such that a light indicator <strong class=\"variable\">Selection Toggle<\/strong> appears at the location of where you clicked momentarily. While a Control Object is toggled and if you press the toggle key: <strong class=\"variable\">Space Bar<\/strong> by default, the camera will snap to, and follow that selected unit. At that point the behvaior of <strong class=\"variable\">Q<\/strong> and <strong class=\"variable\">E<\/strong> also changes, such that it&#8217;ll rotate around the selected unit counter-clockwise or clockwise upon being pressed.<\/p>\n<p><a href=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2011\/12\/MultiSelectMovement.png\" rel=\"lightbox-112\"><img loading=\"lazy\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2011\/12\/MultiSelectMovement-300x187.png\" alt=\"Multi Selection System\" title=\"MultiSelectMovement\" width=\"300\" height=\"187\" class=\"alignleft size-medium wp-image-304\" srcset=\"https:\/\/chazix-scripts.com\/wp-content\/uploads\/2011\/12\/MultiSelectMovement-300x187.png 300w, https:\/\/chazix-scripts.com\/wp-content\/uploads\/2011\/12\/MultiSelectMovement.png 419w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/a>As of <strong class=\"variable\">version 1.3<\/strong>, a multiple object selection system has been added to the RTS side of this Controller. This allows you to select and be able to control more than one <strong class=\"variable\">ControlObjHandler<\/strong> at a time. You&#8217;re able to select the objects by either <strong class=\"variable\">dragging your mouse<\/strong> and drawing a box around the objects, or adding them in one at a time by using the <strong class=\"variable\">Add Additional Key: Left Alt<\/strong> by default. Once they&#8217;re selected you can move them by selecting a location to move them to with the <strong class=\"variable\">Left Mouse Button<\/strong>.<\/p>\n<p><strong class=\"variable\">Version 1.4<\/strong>, it&#8217;s purpose is mainly about the <strong class=\"variable\">GridGenerator<\/strong>, which this generates grid squares a long the xz plane, taking into account a min and max slope value. To determine a slope, within this current version, the sloped object must be parallel with either the x or z axis.<\/p>\n<p><iframe loading=\"lazy\" width=\"584\" height=\"329\" src=\"http:\/\/www.youtube.com\/embed\/5wtkAfRiSQ4?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p><strong class=\"variable\">Version 1.5<\/strong> introduces the <strong class=\"variable\">PathFinder<\/strong> class which utilizes the <strong class=\"variable\">GridGenerator<\/strong> class from version 1.4. It uses the A* path finding algorithm for determining the best path between an initial <strong class=\"variable\">GridSquare<\/strong> and final <strong class=\"variable\">GridSquare<\/strong>, it can also take in a Unity3D Transform Object for reference on who to send the calculated path tiles to once the path has been calculated. The <strong class=\"variable\">PathFinder<\/strong> also calculates the path in a separate thread for increased performance.<\/p>\n<p><iframe loading=\"lazy\" width=\"584\" height=\"329\" src=\"http:\/\/www.youtube.com\/embed\/_Ii1Y1rgQmo?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p><strong class=\"variable\">Version 1.6<\/strong> implements the <strong class=\"variable\">Grid Object Creation System<\/strong>. This system also utilizes the <strong class=\"variable\">GridGenerator<\/strong> class from version 1.4. It contains the class object: <strong class=\"variable\">Object Creation GUI Controller<\/strong> that is attached to the <strong class=\"variable\">Main Camera<\/strong>. <a href=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2013\/06\/GridObjectCreationGUI.png\" rel=\"lightbox-112\"><img loading=\"lazy\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2013\/06\/GridObjectCreationGUI-300x232.png\" alt=\"Grid Object Creation GUI Controller\" width=\"300\" height=\"232\" class=\"alignleft size-medium wp-image-609\" srcset=\"https:\/\/chazix-scripts.com\/wp-content\/uploads\/2013\/06\/GridObjectCreationGUI-300x232.png 300w, https:\/\/chazix-scripts.com\/wp-content\/uploads\/2013\/06\/GridObjectCreationGUI-387x300.png 387w, https:\/\/chazix-scripts.com\/wp-content\/uploads\/2013\/06\/GridObjectCreationGUI.png 398w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> From this script you are able to set the attributes that make up your <strong class=\"variable\">Grid Object Creation System<\/strong>: Rows, Columns, The Main Grid Generator that is used, The Icons (Default: 50&#215;50 pixels) that make up the Grid Objects to build, The Time Values for how long it will take to build one of the Grid Objects, The Unity3D Prefab objects that contain the <strong class=\"variable\">GridObject<\/strong> script that represents the individual Grid Objects, The Unity3D Layer to ignore when building a Grid Object, The <strong class=\"variable\">Creation Method<\/strong> that is used (Either: <strong class=\"variable\">Master<\/strong> or <strong class=\"variable\">Observer<\/strong>) and finally the Material that is used to draw the <strong class=\"variable\">GridSquare<\/strong> objects bellow the Grid Object.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The DC\/RTS Controller is designed to act as either a Dungeon Crawler or RTS System, meaning that the way the camera acts is in a bird&#8217;s eye, top down view. Such that in a Dungeon Crawler there is usually only &hellip; <a href=\"https:\/\/chazix-scripts.com\/?p=112\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[27,12,11,14,29,13,15,9],"_links":{"self":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts\/112"}],"collection":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":61,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}