Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Combat and Weaponry

Hello, new to the forums and trying to learn how to use Twine. I've learned some of the basics, but wanted to ask how to implement combat mechanics. I don't know if a thread for this already exists, if there is, I'd appreciate a link to it. Also, practicing some code for weaponry from another guy in the forum who's threads I read (Thanks for being so awesome Sharpe) and I wanted to get some input if I did it correctly,
<<set $Axe = {
WpnName: "Axe",
Skill: $AxeSkill,
WpnDamage: Math.floor(($AxeSkill * 0.5) + 3)
}>>
The question here is whether I did the WpnDamage: Math.Floor(($AxeSkill * 0.5) + 3) right or should it be handled differently?

Comments

  • Don't have much time at all to answer this, but don't set damage in the weapon. Reason: it will only set once per game, then stay the same. You'll want to re-figure the damage every hit/attack. So, the damage code will be in another passage, like a combat passage or however you're going that.

    Have you looked at my example RPG? Take a look: http://twinery.org/forum/index.php/topic,1474.0.html

    That's version 0.2 for Sugarcane, the default header that you're probably using. There's also a 0.3 out there that's a lot easier to read, but it's for SugarCube. If you're using SugarCube, get it: http://twinery.org/forum/index.php?action=dlattach;topic=1591.0;attach=218

    I have a 0.4 just about ready, which is loads better and has tons and tons of comments in the code, but my work on it has been sadly interrupted.
  • Sharpe wrote:

    Don't have much time at all to answer this, but don't set damage in the weapon. Reason: it will only set once per game, then stay the same. You'll want to re-figure the damage every hit/attack. So, the damage code will be in another passage, like a combat passage or however you're going that.

    Have you looked at my example RPG? Take a look: http://twinery.org/forum/index.php/topic,1474.0.html

    That's version 0.2 for Sugarcane, the default header that you're probably using. There's also a 0.3 out there that's a lot easier to read, but it's for SugarCube. If you're using SugarCube, get it: http://twinery.org/forum/index.php?action=dlattach;topic=1591.0;attach=218

    I have a 0.4 just about ready, which is loads better and has tons and tons of comments in the code, but my work on it has been sadly interrupted.


    Thanks for the reply! Sorry for my late reply, my internet connection has been really wonky lately. And yeah, I am currently using Sugarcane, I haven't tried SugarCube yet. I'll take a look and learn from your example for Sugarcane first.
  • Just making sure you know, the link I provided earlier is to the old version. The new version is here: Example Turn-Based RPG (Pre-Alpha v. 0.4)
Sign In or Register to comment.