Note that there are some explanatory texts on larger screens.

plurals
  1. POif %variable% ==, not working
    text
    copied!<p>So I am making an RPG, Pokemon style fighting game (with movie characters) to test my skills, I obviously need more work. It is a batch (.bat) file, I am using notepad++. The "<code>Katniss</code>" part does work, while the other three don't work. The <code>%char%</code> (character) is set previously and the Katniss works so it can't be a problem there. The problem is something with the "<code>if</code>" statement I think. Here is a fragment of the code, I would have the whole thing but it's around 400 lines and I've narrowed it down to this section using <code>pause</code>s. </p> <pre><code>`:character2 cls REM --------------------------------------------------Characters aren't working here if %char% == Katniss set hp=100 set mattack1=Knife set rattack1=Arrow set rattack2=Fire Arrow set rattack3=Explosive Arrow set block1=Bow Block set armr=2 set energy=140 set m1enc=50 set m1hpd=25 set m2enc=25 set r1hpd=20 set r1enc=65 set r2hpd=50 set r2enc=110 set r3hpd=75 set r3enc=140 set bk1md=5 set bk1ec=50 set defense=2 goto corc if %char% == Gandalf set hp=120 set mattack1=Staff set mattack2=Sword set mgttack1=Fireball set mgttack2=Blast set mgttac2=Staff set block2=Magic Shield set block3=Sword set armr=0 set energy=100 set m1hpd=15 set m1enc=40 set m2hpd=40 set m2enc=90 set mg1hd=45 set mg1ec=100 set mg2hd=10 set mg2ec=25 set mg3hd=5 set mg3ec=25 set bk1md=5 set bk1ec=80 set bk2md=25 set bk2ec=100 set bk3md=3 set bk1ec=45 set defense=0 goto corc` </code></pre> <p>I tried Yahoo Answers but the person didn't read the full question and said I needed to set <code>%char%</code>.</p> <p>----<strong><em>Answer</em></strong> Turned out it was the <code>(</code></p> <pre><code>) </code></pre> <p>thing, I missed a few and that prevented the variable from being set but the <code>""</code> had nothing to do with it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload