{"id":1261,"date":"2010-05-13T23:10:33","date_gmt":"2010-05-13T12:10:33","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=1261"},"modified":"2010-05-13T23:12:15","modified_gmt":"2010-05-13T12:12:15","slug":"figured-it-out","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2010\/05\/13\/figured-it-out\/","title":{"rendered":"Figured it out"},"content":{"rendered":"

Finally worked out the proper way to set up my action bars. \u00a0Sadly, it’s not quite the way they’re set up right now.<\/p>\n

The old system, the one that was in use for v1 and v1.1 looked like this: \u00a0[Button]. \u00a0That is, the interface button itself did everything; \u00a0it checked for being clicked on, it modified the game world in reaction to the player’s clicks, etc. \u00a0This resulted in most buttons in the UI needing to be coded separately, since they all performed different functions.<\/p>\n

The newer system currently looks like this: \u00a0[Button] –“command”–>[Script System]–>[Effect]. \u00a0So the button sends a simple text command to a scripting system, which interprets the command and then takes action (typically hiding\/showing a UI, changing the cursor function, etc). \u00a0This is nice in that every Button is now the same, only varying in what string they send to the scripting system. \u00a0It also makes a very nice divide between UI code and functional code. \u00a0The problem with this approach is that it’s forward-communication-only; \u00a0that is, there’s no way for the system that’s actually doing the work to communicate back to the original button, to tell it that the operation has completed, or that it’s not legal right now.<\/p>\n

The new new system that I’ve worked out is similar to the above, but instead looks like this: \u00a0[Button]->[Power]->[Effect]. \u00a0Every Button points to a “Power”, and that “Power” then talks to something that can actually take action in the game. \u00a0This means that I still have fully generic buttons, a standard set of “Power” functionality (being enabled\/disabled\/recharging\/etc), and the game-effecting code over in the various Effects that the “Powers” know how to perform. \u00a0This approach also allows us to have multiple buttons bound to the same power, and have them all function properly (when the power is activated, all buttons bound to it will hilight, they’ll all show it on cooldown after it’s been used, etc).<\/p>\n

Once that’s done, I can then trivially make it so that powers can be activated from a script, instead of from a button click, and have all the buttons bound to that power actually behave properly.<\/p>\n

I’m starting on implementing this adjustment now.. \u00a0hope to have it finished and working sometime tomorrow!<\/p>\n","protected":false},"excerpt":{"rendered":"

Finally worked out the proper way to set up my action bars. \u00a0Sadly, it’s not quite the way they’re set up right now. The old system, the one that was in use for v1 and v1.1 looked like this: \u00a0[Button]. \u00a0That is, the interface button itself did everything; \u00a0it checked for being clicked on, it…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[24,25],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-kl","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1261"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=1261"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1261\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=1261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=1261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=1261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}