Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Jul 2011
Offline Last Active Mar 24 2013 04:33 PM

#4949240 Attack Scripting?

Posted by on 14 June 2012 - 12:44 PM

LUA does the job fine.

If you absolutely must define your own language, I suggest reading up on parsing: http://en.wikipedia.org/wiki/Parsing
Then, you can make your own pseudo-language that is simply used for your game and therefore easily usable:

Filename: ChainLightning.spell

"Chain Lightning"
required $caster $power $cost
decrease MANA of $caster by $cost
select $a in range(4,$caster)
select $b in range(1,$a)
select $c in range(1,$b)
damage $a by $power
damage $b by [$power/2]
damage $c by [$power/4]

This type of language is easily parsable and readable by the average non-programmer. The disadvantage is the strictness of the syntax and lack of power, obviously.