CraftTweaker

CraftTweaker

151M Downloads

Script running out of priority order.

D0CTOR-ZED opened this issue ยท 8 comments

commented

What happens:

Script with priority 7 is running before scripts with larger numbers. In this instance, 7, 100, 11, undefined, 9, 1, -1

What you expected to happen:

I would expect 7 to occur between 9 and 1.

Script used:

There are multiple scriptsin priority.zip:
https://www.dropbox.com/sh/tdme0vrwrdunc5k/AACWVrx9CNA2eVKipRBu4bXya?dl=0

crafttweaker.log file:

Tested using 7.1.0.126:
https://pastebin.com/Bsy0ZnFP
Testing using 7.1.0.129:
https://pastebin.com/sKUsjNsb (same results)


Environment:

  • Minecraft Version: 1.16.5
  • Forge Version: 30.0.14
  • CraftTweaker Version: tried both 1.16.5-7.1.0.126 and 1.16.5-7.1.0.129
  • Are you using a server: No

Game log:

latest.log: https://pastebin.com/HgW9EYc9

commented

Have you had any luck in reproducing?

commented

Enough had changed that making the old scripts run properly would involve rolling back to versions that it didn't make sense. Sorry, I should have closed this then.

commented

After some investigation it was found that having a function definition in your script:

function doThing() as void {}

would cause your script to be ran before others.

I believe this was your issue, so it should be fixed now.

commented

So we haven't been able to reproduce this, and no one else has reported it.

Are you able to reproduce on the latest version?

commented

Operating system?
Please can you zip your scripts folder and upload it here as well

commented

I'm running ubuntu 20.04, using the latest CraftTweaker.

So I downloaded the scripts you posted above in the dropbox, I removed all files that didn't have priority in their text and everything is loaded as expected.

[06:56:43.998][DONE][CLIENT][INFO] Started loading Scripts for Loader 'crafttweaker'!
[06:56:44.162][DONE][CLIENT][INFO] Loading file: functions.zs
[06:56:44.163][DONE][CLIENT][INFO] Loading file: food_tags.zs
[06:56:44.163][DONE][CLIENT][INFO] Loading file: building_gadgets.zs
[06:56:44.163][DONE][CLIENT][INFO] Loading file: furnace.zs
[06:56:44.164][DONE][CLIENT][INFO] Loading file: jei.zs
[06:56:44.164][DONE][CLIENT][INFO] Loading file: conflicts.zs
[06:56:44.164][DONE][CLIENT][INFO] Loading file: builders_addition.zs
[06:56:44.164][DONE][CLIENT][INFO] Loading file: IE.zs
[06:56:44.194][DONE][CLIENT][INFO] PRIORITY 100
[06:56:44.195][DONE][CLIENT][INFO] PRIORITY 11
[06:56:44.195][DONE][CLIENT][INFO] PRIORITY undefined
[06:56:44.195][DONE][CLIENT][INFO] PRIORITY undefined
[06:56:44.196][DONE][CLIENT][INFO] PRIORITY 9
[06:56:44.196][DONE][CLIENT][INFO] PRIORITY 7
[06:56:44.196][DONE][CLIENT][INFO] PRIORITY 1
[06:56:44.196][DONE][CLIENT][INFO] PRIORITY -1
[06:56:44.197][DONE][CLIENT][INFO] Finished loading Scripts!

For reference, by default scripts have a priority of 10, so that is why undefined is between 11 and 9.

I've uploaded the scripts fodler and would appreciate if you can run them on your machine and see what the results are.

scripts.zip

commented

Still happens with version 7.1.0.347. Based on the order that the scripts write to the crafttweaker log, the priority 7 script is executing prior to the others. The log shows the output from priority 7, 100, 11, unassigned, 9, 1, -1. The list where it mentions which script files load is listed in proper priority order, but the first lines after that are the priority 7 script.

commented

Initial test with just those scripts has the scripts executing in proper order. When I have some time, I'll see if I can track down what was causing the previous issue.