Jump to content

Batch files execute differently than typed commands?


MasterMagnus

Recommended Posts

If I type this command from the console it works properly (having created the matching global in FO4 edit).

 

if 6 == getglobalvalue "HG01_LoadID"; player.isessential; endif;

Console shows:

GetGlobalValue >> 6.00

IsEssential >> 0.00

Exactly as it should.

 

But when I run this command in a batch file it does not work.

Running a batch file with only this command (the console shows)

bat battest

> if 6 == getglobalvalue "HG01_LoadID"; player.isessential; endif;

Mismatched if/else/endif block starting on line 1.

Mismatched if/then/else block.

 

Are there documented differences on what happens from a Batch file as opposed to typing in commands? Is the syntax for If/Then/Else/Endif different when running a batch than when typing from the console?

 

Any help is much appreciated.

 

Link to comment
Share on other sites

  • 1 year later...

Bump.

I have the exact same problem and I really would like to find a solution. See reddit post for reference (has my load order). Is there still no solution? This seriously doesn't seem right. I've seen other people post their batch files with if-statements in a separate post here and they don't get this mismatched error that we get.

Link to comment
Share on other sites

This is mortifyingly depressing given how much potential there would be for hotkeys otherwise:

 

What's mentioned above doesn't work for calling script using the bat <filename> for some reason, it'll only "accept" it if you use prid in front but doesn't work at all. Not sure of how much use this will be to people due to this, but I thought I'd share it at least. "While" or commands like that doesn't seem to exist. - source

 

Edited by Frikster
Link to comment
Share on other sites

  • 2 years later...

looks like neither of you are doing it exactly as shown. the documentation at the link Frikster provided says: "if <condition>; <todo if true>; elseif <condition>; <todo elseif true>; else; <todo if false>; endif". i'm not seeing elseif or else in either of your if-statements.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...