Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Mindustry v7 #3

Closed
Nester23 opened this issue Aug 13, 2021 · 8 comments · Fixed by #4
Closed

Update to Mindustry v7 #3

Nester23 opened this issue Aug 13, 2021 · 8 comments · Fixed by #4

Comments

@Nester23
Copy link

There are new sensors, blocks, units and even a few new instructions in the game that aren't supported.

@Antyos
Copy link
Owner

Antyos commented Aug 16, 2021

Do you know of where I can find a complete list of the new blocks, units, commands, etc.? I can't seem to find a comprehensive changelog of v7.

Early on, I made the design decision of only supporting syntax highlighting for built-in blocks/units which I have since regretted. I plan on changing this so that all @names will be highlighted, enabling support for future versions as well as mods.

@Nester23
Copy link
Author

Do you know of where I can find a complete list of the new blocks, units, commands, etc.? I can't seem to find a comprehensive changelog of v7.

I know that there's an official changelog in the official Mindustry GitHub page, but I'm not sure if there is a full list of changes for logic sensors/types and all that anywhere.
I can try to make it myself, so download an older version of Mindustry and compare it with the current one, but I'm not sure about blocks, since there would be more of them in the future.

@Nester23
Copy link
Author

Nester23 commented Aug 18, 2021

I can try to make it myself, so download an older version of Mindustry and compare it with the current one.

So here's the list of features I found missing:

Sensor changes

  • Added new sensors:
@progress
@timescale
@size
@dead
@range
@boosting
@controller

изображение

  • @commanded is deprecated:
    изображение

Operation changes

  • Replaced atan2 with angle and dst with len:
    изображение
  • Added operations asin, acos, atan:
    изображение
  • Added strictEqual to both operations and jumps:
    изображение

New instructions

Wait:

изображение

Lookup:

изображение
изображение

New constants

  • @tick
  • Lookup constants:
@unitCount
@itemCount
@liquidCount
@blockCount
  • Controlled sensor constants:
@ctrlProcessor
@ctrlPlayer
@ctrlFormation

изображение

Jump labels

  • Now jumps can point to labels:
sensor copper container1 @copper

jump isEnabled_true equal isEnabled true
op greaterThanEq isEnabled copper 100 #Copper >= 100
jump exit_elseIf always 0 0

isEnabled_true:
op greaterThanEq isEnabled copper 50 #Copper >= 50

exit_elseIf:
control enabled unloader1 isEnabled 0 0 0

изображение

So, this is about all I can remember and find right now, maybe there's some constant missing? idk, but I hope this helps.
new stuff.txt

@Antyos
Copy link
Owner

Antyos commented Aug 18, 2021

This is a great help, thank you!

Antyos added a commit that referenced this issue Aug 19, 2021
Add: angle, len, asin, cos, atan, strictEqual
Deprecated: atan2, dst
Antyos added a commit that referenced this issue Aug 19, 2021
Antyos added a commit that referenced this issue Aug 19, 2021
Add:
tick
blockCount, unitCount, itemCount, liquidCount
ctrlProcessor, ctrlPlayer, ctrlFormation,
Antyos added a commit that referenced this issue Aug 19, 2021
Antyos added a commit that referenced this issue Aug 19, 2021
jump_labels use scope 'entity.name.function.mlog' for consistency with
other assembly languages, such as 13xforever/x86_64-assembly-vscode
@Antyos
Copy link
Owner

Antyos commented Aug 20, 2021

I have made a number of changes to the grammar for Mindustry v7, as you outline above:

Changes

Added

  • Operators: strictEqual, asin, acos, and atan
  • Commands: wait and lookup
  • At-names: @tick, @blockCount, @unitCount, @itemCount, @liquidCount, @ctrlProcessor, @ctrlPlayer, @ctrlFormation
  • Other at-names will still be highlighted
  • Jump labels syntax

Replaced

  • atan2 and dst with angle and len, respectively

Deprecated

  • At-names: @commanded
  • Operators: atan2, dst (not technically deprecated in-game)

Screenshot

image

Going forward

I have a few questions/concerns about releasing the update--

Mindustry v7 is still in Beta as of now. If I publish these changes to the extension now, I am unsure how it will affect users still playing v6. This is especially true for the deprecated variable @commanded.

Officially, it seems like atan2 and dst are still supported in the source code, however I am unsure if they will remain that way. As it seems like Anuken wants people to use angle and len, I decided to classify the other two as deprecated.

One possibility is making a language pack for each version of the game, but I'm not sure that I like that idea.

Do you know which (if any) of these changes have been implemented in the current stable release of Mindustry? (I haven't been playing it lately)

Antyos added a commit that referenced this issue Aug 20, 2021
@Nester23
Copy link
Author

Which (if any) of these changes have been implemented in the current stable release of Mindustry?

Most of them are implemented to the stable version of Mindustry including deprecation of @commanded and replacement of atan2 and dst.

The additions Mindustry v7 brings are wait and lookup plus asin, acos, and atan, operations, but supporting them shouldn't interfere with anything,

@Antyos
Copy link
Owner

Antyos commented Aug 20, 2021

Perfect! I'll try and get a new release out later today!

@VladisS-Vostok2000
Copy link

VladisS-Vostok2000 commented Feb 27, 2023

omg this is most useful post. I used my own c# programm to make labels-like jumps...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants