{"id":201,"date":"2007-04-02T02:29:12","date_gmt":"2007-04-02T06:29:12","guid":{"rendered":"http:\/\/www.rakkar.org\/blog\/?p=201"},"modified":"2007-04-02T02:29:12","modified_gmt":"2007-04-02T06:29:12","slug":"angelscript-integrated-in-half-a-day","status":"publish","type":"post","link":"https:\/\/rakkar.org\/blog\/index.php\/2007\/04\/02\/angelscript-integrated-in-half-a-day\/","title":{"rendered":"AngelScript integrated in half a day"},"content":{"rendered":"<p>\t\t\t\tI <a HREF=\"http:\/\/www.rakkar.org\/blog\/?p=133\">wrote about<\/a> <a HREF=\"http:\/\/www.angelcode.com\/angelscript\/\">AngelScript<\/a> a while back yet never had a reason to put it in the code up until today.  This morning I was thinking about how to go about a general effects system for my game and concluded that the only thing flexible enough was either code or script.  I specify effect files in XML settings, and those can&#8217;t refer to code (easily) so that left me with script.  Plus this is really one of those rare times when scripting makes good sense:<\/p>\n<p>1. Used in a limited fashion that won&#8217;t require much debugging<br \/>\n2. Extensible by modders in a situation where I don&#8217;t want to give out the source code<br \/>\n3. No better solution.  I could make a full-fledged editor if I had the time and money, but I don&#8217;t.<\/p>\n<p>I started on this about noon, went out for a good chunk of the day, and finished integrating it into the game now.  I also created a sort of script instance system, where a script module (one or more related script files) is treated as a mini-program, with a per-tick update function, and a query function to indicate when the program was done.  The script manager automatically handles tracking the pointers, and I did a pretty good job with the architecture the first time through for once, partly because my wife made me get the laundry and that 5 minutes away from the computer helped me solve problems in my head before I spent a lot of time coding.  So this instance system will be perfect for effects as they update every tick doing stuff, and end after some amount of time.<\/p>\n<p>I think it&#8217;s pretty good work that in one day I went from the vague problem of how to implement effects, to a working script framework for it.\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wrote about AngelScript a while back yet never had a reason to put it in the code up until today. This morning I was thinking about how to go about a general effects system for my game and concluded that the only thing flexible enough was either code or script. I specify effect files [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/201"}],"collection":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":0,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"wp:attachment":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}