[I7]Tracing a Report on Translation: Failed Error

I’ve done a few unpublished (outside of friends at least) IF games before and I decided to ramp things up a bit. I want to include combat in this next one but I’m running into a weird issue with the I7 compiler.

The combat system itself is heavily influenced by the D&D rulesets.

Below is the error followed by the block of code in general. Even after pasting the entire code into Notepad++ I still cannot figure out where Inform is getting the error from. The only thing I can think of at this point is I’m getting programmer’s blindness, so I’m turning to the internet for help!

The Error:

Problem. The phrase or rule definition 'To make (attacker - a person) strike a blow against (defender - a person)'   is written using the 'colon and indentation' syntax for its 'if's, 'repeat's and 'while's, where blocks of phrases grouped together are indented one tab step inward from the 'if ...:' or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can't determine the structure. The first phrase going awry in the definition seems to be 'if the instrument is a weapon'  , in case that helps. 

The code:

To make (attacker - a person) strike (defender - a person): if the attacker is the player, say "You attack "; otherwise, say "[The attacker] attacks "; if the defender is the player, say "you, "; otherwise, say "[the defender], "; let the damage done be the hit dice of the attacker; let the armament be nothing; if the attacker wears a weapon: let the damage done be the hit dice of the armament; say "with [the weapon worn by the player]"; otherwise: say atkType of the attacker; change the AC to die roll 1d20; say ", making an attack roll (1d20) of [AC] "; let DC be the defense of the defender; if AC = 1; if the armament is a weapon; [attacker wields weapon on crit failure] if the attacker is the player; say "You completely botch your attack! You deal [run paragraph on]"; let hits be damage done; let hits be the hits divided by 2; say "[hits] [paragraph run on]"; if the hits is 1, say "point of damage to yourself!"; otherwise say "points of damage to yourself!"; otherwise: say "[the attacker] botches their attack! They deal [run paragraph on]"; let hits be damage done; let hits be the hits divided by 2; say "[hits] [paragraph run on]"; if the hits is 1, say "point of damage to themself!"; otherwise say "points of damage to themself!"; otherwise: [attacker is unarmed on crit failure] let hits be 1; if the attacker is the player; say "You deal 1 damage to yourself!"; otherwise: say "[the attacker] deals 1 damage to themself!"; stop; if AC <= DC; [2 to whatever DC is] say " - Miss!"; stop; if AC > DC; say "- hit, doing [damage done] damage: "; let hits be the roll of damage done; stop; if AC = 20; say "- a critical hit! You deal [paragraph run on]"; let hits be damage done; let hits be the hits multiplied by 2; say "[hits] of damage!"; make the defender take hits points of damage.

You have

if AC = 1;

which should end with a colon rather than a semicolon. Ditto for the two “if” lines immediately after that.

By the way, which version of Inform 7 are you using? The latest one has a bug that causes an internal error for mistakes like that, so it might be helpful to know if you’re using an earlier version. And welcome to the forum!

The if statements require a colon between head and body. More to the point, the error message is actually appropriate: you’re using the colon and indentation syntax

if x: stop;

side by side with if statements that use a comma delimiter. And even if you change the semicolons to the proper colons, one-liner if statements can’t be used inside colon-and-indent if statements.

Since the code relies on definitions not present in the block you posted, it’s tricky to give any more assistance than that. For future reference, it may be helpful to post complete examples of your problem, i.e. snippets that compile.

One tip for simplifying your code: if you’re using a recent version of I7 you can say “[The attacker] [attack] … and [deal] … damage.” It will conjugate the verbs appropriately if you define them as “To attack is a verb. To deal is a verb.”

Additionally, inline if statements are still viable in colon-and-indentation syntax. Thus, you could do something like this:

say "You completely botch your attack! You deal [hits] point[if hits is not 1]s[end if] of damage to yourself!"

and it would work inside a nested if statement.