Jump to content

Photo

Help with console batch scripting needed.

batch console script

  • Please log in to reply
4 replies to this topic

#1
oldbastard42

oldbastard42

    Fan

  • Premium Member
  • 373 posts

Anyone know how to force the console to process instructions in the proper order?  It seems it just makes up it's own execution order and forgets half of it's commands!

 

I'm trying to create a script to spawn some items, then add a legendary effect to them.

 

Here's a short example:

 

pt 187972 1
PickLastRef
amod 1F1DF9

 

That should spawn a Synth left leg then add the "'Sprinter's" legendary to it, but it only spawns a bog-standard leg and then forgets the rest.  If I run that script a second time, then the first spawned leg gets it's legendary!  It's like the console has constipation.

 

If I type the following directly into the console, then it works perfectly -

pt 187972 1;PickLastRef;amod 1F1DF9

 

...or is there a pause or wait command?

 

Thanks.

 

 



#2
oldbastard42

oldbastard42

    Fan

  • Premium Member
  • 373 posts

I did some online research and came up with the following:

player.additem 187972 1;player.cf "ObjectReference.AttachModToInventoryItem" 187972 1F1DF9
player.additem 187970 1;player.cf "ObjectReference.AttachModToInventoryItem" 187970 1F1DF9
player.additem 187974 1;player.cf "ObjectReference.AttachModToInventoryItem" 187974 1F4D18
player.additem 18796C 1;player.cf "ObjectReference.AttachModToInventoryItem" 18796C 1F2D3D
player.additem 18796E 1;player.cf "ObjectReference.AttachModToInventoryItem" 18796E 1F57E4
player.additem 18796A 1;player.cf "ObjectReference.AttachModToInventoryItem" 18796A 1F1C2F
player.additem 9983B 1;player.cf "ObjectReference.AttachModToInventoryItem" 9983B 0300da99

 


.....but each line has to be run individually from the console, when run as a batch file it does random stuff :(



#3
WastelandProject

WastelandProject

    Regular

  • Supporter
  • PipPip
  • 83 posts
oldbastard42, il 06 settembre 2020 - 12:06 AM, ha detto:

Ho fatto alcune ricerche online e si avvicinò con il seguente:

player.additem 187972 1;player.cf "ObjectReference.AttachModToInventoryItem" 187972 1F1DF9
player.additem 187970 1;player.cf "ObjectReference.AttachModToInventoryItem" 187970 1F1DF9
player.additem 187974 1;player.cf "ObjectReference.AttachModToInventoryItem" 187974 1F4D18
player.additem 18796C 1;player.cf "ObjectReference.AttachModToInventoryItem" 18796C 1F2D3D
player.additem 18796E 1;player.cf "ObjectReference.AttachModToInventoryItem" 18796E 1F57E4
player.additem 18796A 1;player.cf "ObjectReference.AttachModToInventoryItem" 18796A 1F1C2F
player.additem 9983B 1;player.cf "ObjectReference.AttachModToInventoryItem" 9983B 0300da99

..... ma ogni riga deve essere eseguita singolarmente dalla console, quando viene eseguita come un file batch fa cose casuali :sad:

Each command must be executed individually.

Seven individual .bat files and one command for each to run them from the console.



#4
oldbastard42

oldbastard42

    Fan

  • Premium Member
  • 373 posts

Hah!  I discovered a dirty hack to get it working by issuing just one console command :D.

 

I created two batch files, the first which adds all the equipment to the player's inventory, then I call a second batch file from the first which upgrades everything - and it works perfectly.

 

Here's the contents of the files in case anyone else needs this info:

 

I named the first file 0-add-uniform.txt -

player.additem 187972 1; /* Synth left leg added....
player.additem 187970 1; /* Synth right leg added....
player.additem 187974 1; /* Synth breast plate added....
player.additem 18796C 1; /* Synth left arm added....
player.additem 18796E 1; /* Synth right arm added....
player.additem 18796A 1; /* Synth helmet added....
player.additem 9983B 1; /* Laser pistol added....
bat 1-upgrade-uniform

....and the second 1-upgrade-uniform.txt -

player.cf "ObjectReference.AttachModToInventoryItem" 187972 1F1DF9; /* Acrobat's - 50% reduction in fall damage
player.cf "ObjectReference.AttachModToInventoryItem" 187970 1F1DF9; /* Acrobat's - 50% reduction in fall damage
player.cf "ObjectReference.AttachModToInventoryItem" 187974 1F4D18; /* Chameleon - invisible when crouching
player.cf "ObjectReference.AttachModToInventoryItem" 18796C 1F2D3D; /* Martyr's - Slows time when health less than 20%
player.cf "ObjectReference.AttachModToInventoryItem" 18796E 1F57E4; /* Cavalier's - Reduces damage by 15% while sprinting or blocking
player.cf "ObjectReference.AttachModToInventoryItem" 18796A 1F1C2F; /* Sprinter's - Increases speed by 10%
player.cf "ObjectReference.AttachModToInventoryItem" 9983B 0300da99; /* Deadeye - slows down time when aiming

You can of course name them whatever you want as long as you change the called file in the second script.

 

I run the entire operation by simply issuing one command -

bat 0-add-uniform

 

 

...and it all runs automatically.

 

I've been working on settlement cleanup scripts over the last month or so, and I'm hoping that this solution can also be used there.  I was having problems at the Starlight Drive-in diner, I wanted to delete the trashy counter top pieces and insert clean versions in their places.  It never worked properly, but using this external batch file call trick might be able to fix that - we'll see.

 

Kind regards, and keep on pushing the boundaries folks :wink:.



#5
WastelandProject

WastelandProject

    Regular

  • Supporter
  • PipPip
  • 83 posts

The secret is that command "/*" for to merge and name of second file .bat added in the first.

So with just one command for two batch file.

Great! 


Edited by WastelandProject, 09 September 2020 - 11:19 AM.






Also tagged with one or more of these keywords: batch, console, script

IPB skins by Skinbox
Page loaded in: 1.046 seconds