[frl]myke 14 Posted April 1, 2010 Hi folks, i'm doing something and i'm not sure if i did it correct. Don't say "try it out" as it will take some time unless the work will be ready even only for test, so i guess i get faster answers (also if it takes a few days) if i put it in here. Basically it is about #define and based simple math formula with defines. #define warheadHit 20 #define warheadIndirectHit 8.5 #define warheadIndirectHitRange 1 #define warhead 9.4 hit = "warhead * warheadHit"; indirectHit = "warhead * warheadIndirectHit"; indirectHitRange = "warhead * warheadIndirectHitRange"; These are just small snippets so yes, i know there is class cfgAmmo stuff missing, but this is not the topic here so i've posted only the relevant parts. As you see, i've defined some constants and used them to do simple multiplications with it. I just need to know if it's done correctly or not. Thanks for your time and happy easter.:D Share this post Link to post Share on other sites
sickboy 13 Posted April 1, 2010 (edited) Defines are not replaced inside strings that are double quoted. I think it should either be: hit = warhead * warheadHit; or: hit = __EVAL(warhead * warheadHit); Edited April 1, 2010 by Sickboy Share this post Link to post Share on other sites
[frl]myke 14 Posted April 1, 2010 Thanks Sickboy. Could you explain the __EVAL a little more? I'm not familiar with this kind of programming and in the BIWIKI there isn't any useful (at least for me) explanation. Share this post Link to post Share on other sites
Evil_Echo 11 Posted April 1, 2010 __EVAL forces the line to be evaluated at preprocess time. That way your math expression gets interpreted and the result used instead. Share this post Link to post Share on other sites
TRexian 0 Posted April 1, 2010 That's awesome! Biki info: http://community.bistudio.com/wiki/Config_Parser :) Share this post Link to post Share on other sites
[frl]myke 14 Posted April 1, 2010 @TRexian i knew this site but for me with no programming knowledge beyond sqs/sqf scripting and surplus not being native english, this page could be written in traditional chinese aswell. Share this post Link to post Share on other sites
TRexian 0 Posted April 1, 2010 hehe Would be cool if google translate could work on code... :D Share this post Link to post Share on other sites
granQ 293 Posted April 1, 2010 heheWould be cool if google translate could work on code... :D haha, awesome idea :) Share this post Link to post Share on other sites