Skip to content

Releases: armoha/euddraft

euddraft 0.10.2.1

02 Feb 11:41
Compare
Choose a tag to compare

[0.10.2.1] - 2025.02.03

Bugfix

  • Fix bug where EUDLoopNewCUnit would miss a unit (#132)
  • Fixed error line print functions decreasing Unit limit when CCMU
  • Fix CUnit.cast(epd, ptr=ptr) error

Improved

  • Update Python 3.12.8, update eudplib 0.80.0

euddraft 0.10.1.6

28 Dec 06:50
Compare
Choose a tag to compare

[0.10.1.6] - 28.12.2024

Bugfix

  • Fix CUnit.reset_buildq() to initialise secondaryOrder
  • Fix CUnit.flingyID (word) and Weapon.flingy (dword) data size (reported by @Chromowolf)
  • [epScript] Fixed bug where EUDFuncPtr could not be called when it was a function parameter (reported by Skywindragoon)
  • [epScript] Fix bug where setting the current upgrade level does not work and modifies temporary variables instead (reported by @GGrush-SCMapper)
  • Fixed a bug where CUnit.cast and CSprite.cast would create a trigger to copy variable (reported by @GGrush-SCMapper)
    • Fixed bug where static var with type CUnit or CSprite was initialised every time
  • Fix += value; compilation error in CUnit and CSprite
  • Fixed bug where using ptr when assigning to CUnitMember or CSpriteMember didn't work (reported by @GGrush-SCMapper)

Improved

  • Added lazy evaluation of EnumMember values

euddraft 0.10.1.5

11 Oct 12:34
Compare
Choose a tag to compare

[0.10.1.5] - 2024.10.11

Changed

  • Renamed CUnit.set_noclip/clear_noclip (report by 고래밥은맛있어)

Added

  • StringBuffer can be used as argument for format printing function (reported by Yuuki-Asuna)

Bugfix

  • epScript: allow 0 as initial value for typed local variables
  • Fix bug that caused QuickDebug map to be broken in euddraft 0.10.1.0-4 (reported by 블라인드)
  • Fix compilation error in member comparison condition of variable scdata instance (reported by furina)
  • Fix RecursionError

Improved

  • In cp read function, combine action of adding non-zero cpoffset to function call trigger

euddraft 0.10.1.4

08 Oct 15:04
Compare
Choose a tag to compare

[0.10.1.4] - 2024.10.09

Bugfix

  • Fixed bug where some triggers wouldn't execute after 4,294,967,295 game ticks (2,087 days in Fastest game), or after setting 0x57F23C to -1 (reported by snoqqqq)

Improved

  • Improve error message for format print functions when placeholders are more than arguments (reported by Yuuki-Asuna)

euddraft 0.10.1.3

05 Oct 04:03
Compare
Choose a tag to compare

Changed

  • Remove unused issueError parameter in Encode functions
  • scdata.flags.Flag = X; only takes true, false, 1, 0 or EUDVariable

Added

  • Add literal type hints for basic triggers, scdata and EUDLoopPlayer

    • Support autocomplete for "string" parameters in Python development environment
      ty1
      ty2
  • scdata: add ButtonSetMember, change CUnit.currentButtonSet to ButtonSet type

Bugfix

  • Fixed TrgUnit.rank from word to byte
  • Fixed compilation error in EUDJump(variable) (reported by 공나물)
  • Fixed build error with input map missing (listfile) (reported by 귀여미)

Improved

  • Remove '[Warning]' text in front of type errors
  • Add simple MPQ protection

euddraft 0.10.1.1

02 Oct 13:41
Compare
Choose a tag to compare

[0.10.1.1] - 2024.10.02

Bugfix

  • Fixed compilation error when turning off [freeze] protection

Improved

  • Update Korean localization

euddraft 0.10.1.0

30 Sep 14:27
Compare
Choose a tag to compare

Changelog

[0.10.1.0] - 2024.09.30

Changed

  • Rewrite mpqapi in Rust, change usage of MPQ class:
# Instantiate MPQs
mpq = MPQ.open(MPQpath)  # Open an MPQ
mpq = MPQ.create(create_path, sector_size=3, file_count=1024)  # create MPQ
# *advanced* Create an MPQ with the same content with a new sector_size
mpq = MPQ.clone_with_sector_size(MPQpath, create_path, sector_size)

# Read the MPQ internal file
file_content: bytes = mpq.extract_file(filepath)  # extract file from MPQ
# Get file names from (listfile)
filenames: list[str] = mpq.get_file_names_from_listfile()

# Add files to MPQ
mpq.add_file(name_to_use_in_MPQ, path_of_file_to_be_added, replace_existing=True)

# get/change the maximum number of files limit
maximum_number_of_files: int = mpq.get_max_file_count()
mpq.set_max_file_count(new_file_count_limit)

mpq.compact()  # defragment / compress MPQ
  • Changed MPQAddFile to also accept the path of file to be added:
    • MPQAddFile(name_to_use_in_MPQ, file_path_or_file_content)
      Because StormLib requires a file system path, it is more advantageous to enter a file path. Entering the file contents as in the old usage creates a temporary file and passes the temporary file location to StormLib, with the overhead of copying the file contents.

Bugfix

  • epScript: var globalVariable = constant_initial_value; created an empty trigger scope, causing a RecursionError when there are at least 327 of these global variables (reported by snoqqqq)
  • Fix autoupdate to not leave old files behind

Improved

  • Replace setuptools with maturin in eudplib packaging, make it easy to build eudplib
  • Optimized CUnit.check_buildq
  • Optimized LoadMap
  • Optimized number of eudplib initialisation triggers

euddraft 0.10.0.2

25 Sep 18:39
Compare
Choose a tag to compare

Changelog

[0.10.0.2] - 2024.09.26

Bugfix

  • Fixed bug in fixed line print functions; StringBuffer.printfAt, DisplayTextAt, etc. (reported by 고래밥은맛있어, 맛있는건못참아)
  • scdata: Fix compilation error in 2 byte member += (reported by 텔)
  • Fix compilation error in f_epdread_cp function (reported by 맛있는건못참아)
  • Fix compilation error when assigning 0 to CUnit variable (reported by @Chromowolf)
  • Fix f_rand returned 0 (reported by @Chromowolf)

Improved

  • Add stack trace to warning messages (reported by 콤)
  • Optimized the number of triggers in EUDByteReader.readbyte(), f_raise_CCMU(), f_getcurpl()

euddraft 0.10.0.1

23 Sep 14:23
Compare
Choose a tag to compare

Changelog

[0.10.0.1] - 2024.09.23

Bugfix

  • [MSQC] Fix mouse button event compilation error (reported by 텔)
  • Bugfix: DisplayTextAt, DisplayTextAllAt compilation error fixed (reported by @Dr-zzt)
  • Fixed bug with Korean translation text not showing up

Improved

  • Optimize f_rand() function and fix to not change CurrentPlayer
  • Added error message for invalid arguments when creating EUDVariable, EUDXVariable, EUDVArray

euddraft 0.10.0.0

22 Sep 14:32
Compare
Choose a tag to compare

Changelog

[0.10.0.0] - 2024.09.22

Changed

  • EUDArray now uses EPD by default
    • For backward compatibility with existing code, EPD(EPD of ConstExpr) returns EPD as is (with warning message)
    • Added ptrEUDArray and errorReapplyEPD flags to [main]
    [main]
    ptrEUDArray : True
    errorReapplyEPD : True
    :: If the `ptrEUDArray` flag is turned on, EUDArray will use the ptr address as before
    :: If the `errorReapplyEPD` flag is turned on, applying the EPD function to a constant EPD value will result in an error
    • If the ptrEUDArray flag is on, EPD is not calculated when array is only used in passing to or from function boundaries. When array element is accessed, EPD calculation trigger is added at array declaration on demand.
  • epScript: Added type variable feature.
    • Reference types (EUDArray, EUDVArray, epScript object (=EUDStruct), EUDStructArray, CUnit, CSprite) can only be assigned to the same type. Operations such as +=, -=, *=, /= are not supported because they can change to invalid addresses.
    • Value types (such as LocalLocale, TrgUnit, Weapon, UnitOrder, Flingy, Sprite, Image, TrgPlayer, Upgrade, Tech, etc.) supports assigment and other operations like +=, -=, ...
// Syntax
var name: Type = initialValue;
static var name: Type = initialValue;
var name1: type1, name2: type2, name3: type3 = initial1, initial2, initial3;

// Example
function onPluginStart() {
    // Link hatchery to larvae
    var hatchery: CUnit = 0;
    foreach(unit : EUDLoopPlayerCUnit()) {
        if (unit.unitType == "Zerg Hatchery") {
            hatchery = unit;
        }
    }
    foreach(unit : EUDLoopPlayerCUnit()) {
        if (unit.unitType == "Zerg Larva") {
            larva.connectedUnit = hatchery;
        }
    }
}
  • epScript: Relative Path Import Bug Fixes and Behavior Changes
    • Fixed a bug that caused modules to be duplicated every time a relative path import was made.
    • If a path can be imported with an absolute path, it will be replaced with an absolute path import.
    • Consider making the path accessible with sys.path.insert(1, path) when a parent folder prevents importing, or consider adding __init__.py when importing between files inside a folder to be recognized as a Python package.
  • Changed behavior of epScript object (=EUDMethod of EUDStruct) to not duplicate triggers for each static instance they call
  • Change cast behavior: don't copy the value, just use it as is and apply the type.
  • Simplified EUDVariable constructor: EUDVariable now only accepts an initial value as a constructor.
    • For advanced initialization options, use EUDXVariable(epd, modifier, initial value, (optional) bitmask 0xFFFFFFFF by default).
  • Fix f_getuserplayerid() and EUDLoopPlayer to return TrgPlayer type
  • Change DBString memory layout
  • Db initialized with "string" will raise error if string has a null byte in the middle
  • DBString will raise error with a \0 null byte in the middle
  • objFieldN flag won't change the maximum number of objects (=32768)

Added

  • EUDVArray supports epScript foreach loop
const varr = EUDVArray(10)(py_range(10));
foreach(x : varr) {
    printAll("{}", x);
    if (x >= 5) break;
}
// prints: 0, 1, 2, 3, 4, 5
  • scdata: Added current upgrade/tech level read/write
    • Optimized to cache epd and subp for upgrade/tech and player, so that if they are unchanged or only change them with += 1, epd and subp are not recalculated, and instead reuse the previously calculated results. (See Improved section)
// Upgrade[TrgPlayer] = New_Upgrade_Level;
const infantryWeapon = Upgrade("Terran Infantry Weapon");
foreach(player : EUDLoopPlayer()) {
   infantryWeapon[player] = 1;
}

// const upgrade_level = Upgrade[TrgPlayer];
printAll("current Terran Infantry Weapon level for P1: {}", infantryWeapon[player]);

// Tech[TrgPlayer] = new Tech level;
var spiderMines: Tech = "Spider Mines";
spiderMines[P1] = 1;

// const hasResearched = Tech[TrgPlayer]; // return 1 if tech is non-zero
once (Tech("Stim Pack")[P1]) {
    printAll("Red researched stim pack.");
}
  • scdata: Added TrgUnit members:
    • TrgUnit.unitBoundsLT
    • TrgUnit.unitBoundsRB
    • TrgUnit.unitBoundsL
    • TrgUnit.unitBoundsT
    • TrgUnit.unitBoundsR
    • TrgUnit.unitBoundsB
  • Added UnitGroup.length (suggested by 쥬뱅)
  • EUDLightBool can be initialized with True (suggested by @Chromowolf)
  • Added suppressWarnings flag on [main] (suggested by Ultraviolet)
    • This suppresses every warnings in Python
    • EUD Editor 2 has longstanding issue of not distinguishing warning and error. You can workaround this issue with suppressWarnings flag.
  • Added simple obfuscation to constant strings for print functions

Bugfix

  • Fixed <, > for EUDVariable (reported by 고래밥은맛있어)
  • epScript: fixed incorrect line number on error (reported by @Chromowolf)
  • (armoha/eudplib#28) fixed infinite loop in EUDLoopRange(start, end) when start == end (contributed by 고래밥은맛있어)
  • Fixed constant CUnit instance e.g. CUnit(EPD(0x59CCA8))
  • Fixed EUDStruct.cast could return None when subclass overrides __init__ without _from parameter
  • Fixed bug where Python warning messages were not printed
  • Fixed bugs with CUnit(constant), CSprite.from_ptr (constant)

Improved

  • Improved epd and cp read functions to share their triggers
  • Performance improvements for EUDVArray, PVariable, f_repmovsd_epd, etc.
  • Fixed $L and setloc_epd to also warn of location name misspellings
  • Added compilation error when string count exceeds 65535
  • Improved ConstExpr division compile error message
  • scdata: Improved error message for UnsupportedMember
  • scdata: added caching to improve performance with ArrayMember
    • When accessing a non-4-byte member, if the variable is unchanged, it will reuse the previously calculated result instead of recalculating epd, subp.
    • scdataInstance += 1; is specialized to update all cache values, so cache invalidation and recalculation does not occur.
var unit: TrgUnit = dwrand() % 228;
// (1)
unit.maxShield = 10000;
unit.elevation = 1;

unit = dwrand() % 228;
// (2)
unit.maxHp = 10000 * 256;
// (3)
unit.hasShield = false;

/*
ArrayMember of the scdata instance wrapping EUDVariable will cache derived values for members whose stride is not 4 bytes.
All non-4-byte-stride member accesses will perform a cache check condition and update derived values if the value has changed.

Because unit uses 1-byte (elevation, hasShield) and 2-byte (maxShield) members, the  cache check condition detects a value change at (1), and every derived values are updated; unit / 4, unit % 4, unit / 2 and 2*(unit % 2).
(member usages affect globally to every usages, even retroactively)
`var unit` is unchanged between unit.maxShield and unit.elevation, so unit.elevation does not run update for derived values.

`unit`'s value has changed at (2) ,but unit.maxHp is a 4-byte member, so it does not run perform a cache check condition.
unit.hasShield access at (3) will perform a cache check condition and may update derived values.
*/

// The cache is associated with the wrapped variable, not the scdata instance.
// If cast interprets the same variable as multiple types, the bitmask range can be extended by the largest type.
var v = 23;  // 0x17
const p = TrgPlayer.cast(v);
P12.cummulativeMineral = 9999;
// TrgPlayer's bitmask is 0xF
// If that's all we've written, we'll print out the cumulative gas for P8 (playerID=7)
printAll("{}", p.cumulativeGas);  

// If we cast variable v to a TrgUnit, and access a non-4-byte-stride member,
// the bitmask of variable v is expanded from 0xF (TrgPlayer) to 0xFF (TrgUnit) globally:
const u = TrgUnit.cast(v);  
printAll(u.gasCost, 200);

// This acts globally, so,
// The above printAll("{}", p.cumulativeGas); will print 9999,
// which is P24's cumulative gas = P12's cumulative minerals.
  • Miscellaneous bug fixes and improvements