Jump to content

Console Commands and Bat files


psychohampster

Recommended Posts

So I'm trying to make a bat file to place 100's of objects (ammo containers) onto a massive amount of shelves I've placed. I've calculated the position of all of them, and created a bat file to make them, select them, and then move/rotate them properly. However when running a bat file I can't seem to select the item I just created appropriately. Ie...

If you manually type in the following commands everything works.

 

Player.placeatme 60cb4 (ammo box)

plr (pick last created ref)

gsr (get selected ref)

OUTPUT : {newly created ref}

 

However if you batch them

Player.placeatme 60cb4 (ammo box)

plr (pick last created ref)

gsr (get selected ref)

OUTPUT : {00000000} (nothing selected)

even though the RefID in the middle of the console is correct it will not manipulate the new item at all.

 

Any other ideas?

 

Link to comment
Share on other sites

I've run some experiments using your batch there and I think I've figured out the problem.

 

When executing a batch file the console doesn't wait for one command to complete before commencing the second.

 

When you're running the batch file, it executes the command plr and starts searching for the last created reference before the object has finished being created, which means that it is unable to find a reference.

 

If you're entering the commands naturally your typing speed slows it down enough that each command has a chance to finish before the next one is run.

 

Unfortunately I don't know a solution to the problem.

Link to comment
Share on other sites

I've run some experiments using your batch there and I think I've figured out the problem.

 

When executing a batch file the console doesn't wait for one command to complete before commencing the second.

 

When you're running the batch file, it executes the command plr and starts searching for the last created reference before the object has finished being created, which means that it is unable to find a reference.

 

If you're entering the commands naturally your typing speed slows it down enough that each command has a chance to finish before the next one is run.

 

Unfortunately I don't know a solution to the problem.

 

Make an AutoHotkey script ;) You can set delays there.

Link to comment
Share on other sites

 

I've run some experiments using your batch there and I think I've figured out the problem.

 

When executing a batch file the console doesn't wait for one command to complete before commencing the second.

 

When you're running the batch file, it executes the command plr and starts searching for the last created reference before the object has finished being created, which means that it is unable to find a reference.

 

If you're entering the commands naturally your typing speed slows it down enough that each command has a chance to finish before the next one is run.

 

Unfortunately I don't know a solution to the problem.

 

Make an AutoHotkey script :wink: You can set delays there.

 

Good idea. I'll try that. Only problem I'm having is slow down with AHK not properly registering send methods in FO4. (Or any direct x game)

Link to comment
Share on other sites

  • 6 years later...
  • Recently Browsing   0 members

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