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

Possible LUA Editing/Modding Code Guide/Reference for Stratagus (WC1, WC2, SC1, etc) + Evidential Plans of Working (Pre-)Releases for Starcraft1/Stargus #436

Open
jkun-stargus-sc1gus-2020s opened this issue Mar 28, 2023 · 5 comments

Comments

@jkun-stargus-sc1gus-2020s
Copy link

jkun-stargus-sc1gus-2020s commented Mar 28, 2023

PLEASE NOTE I'M NOT TREATING THE ISSUES PAGE LIKE REDDIT OR ANYTHING LIKE A FORUM THREAD WELCOME OR NOT

Hi, just to remind you (mr. @timfel) and mr. volz (@andreas-volz) regarding some things to inform you two for.
I am very sorry about my attempted installs of Stargus last year ago (Wargus/stargus#53 to Wargus/stargus#53 (comment)) sadly, do you have any possible modding reference (like a LUA code or ruleset reference) for any Stratagus games; like Warcraft1 (aka. War1gus), Warcraft2 (War2gus) alongside Starcraft1 (aka. Stargus and others.

And i could not find any while looking around at the War1gus files after installing both War1&2gus (War1gus & Wargus) on my laptop computer from years ago.

Such as:

  1. LUA via Notepad/NP++, VS Code or other, required of the engine alongside their scripts, game-configurations, etc.
  2. Different Types of Codes, like AttackSpeed: AnyNumeral for Units, GetPlayerData(GetThisPlayer(), "Resources", "gold/minerals/lumber/gas/etc", AnyNumeral) for Salvage/Sell/Recycle/etc. Building Buttons or any kind of code-types for units, buttons, spells/abilities, armor, weapons, upgrades, etc.
  3. Spriting with Artwork-Image-Editing Tools like GIMP (probably used for sprites for the 90s Xcom games via OpenXCom/OpenXComExtended), Photoshop, Aeseprite/Libresprite and/or any other kinds (except MS Paint, Paint.net, etc.) recommendingly
  4. Color Palettes, recommended for custom units, buttons, missiles, et cetera. (Like OpenXcom mods required different types of palettes comparingly)
  5. Custom Doodads and Tilesets, like a custom Forest World tileset for SC1 via Stargus out of the Badlands, Jungle and/or IceWorld tilesets.
  6. Custom Spells and Abilities, like Chain Lighting Bolt for Conjurer/Mage (WC1/WC2) and Protoss Spellcasters (SC1), and/or Abduct (Transport Enemy Units including Enemy Workers) for Zerg Overlord (SC1) or any kind
  7. Possibilities for Creating Custom Races, requires any .lua files to make custom races. (e.g Dwarves and/or Elves for WC1 or WC2, or Demons for WC2)

Speaking of that and Starcraft1 to Stargus.
I started editing the War1gus balancing.lua files to make an edited of the Salvage Town Hall to be more a like a "Sell Buildings" option in the old C&C games for Gold/Minerals along with Lumber & Vespene Gas in order to so.
That i was trying to apply to all buildings except Roads and Walls, that I cannot salvage sell sadly.
Plus I don't know how to modify the salvage/sell cost for it based on how high or low the building/structure health will be.

Original Salvage Ability Code

-----------------------------------------------------------------------
-- Town hall salvage buttons (ORIGINAL VERSION)
-----------------------------------------------------------------------

local orcSalvageIcon = CIcon:New("icon-orc-town-hall-salvage")
orcSalvageIcon.G = CPlayerColorGraphic:New("contrib/graphics/ui/orc/icon-orc-salvage-th.png", 27, 19)
orcSalvageIcon.Frame = 0

DefineButton( { Pos = 4, Level = 0, Icon = "icon-orc-town-hall-salvage",
  Action = "button", Value = 1,
  Description = "Salvage this town hall for gold to rebuild somewhere else.",
  Key = "v", Hint = "SAL~!VAGE",
  ForUnit = {"unit-orc-town-hall"} } )
  
DefineButton( { Pos = 2, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "esc", Hint = "~<ESC~> - CANCEL",
  ForUnit = {"unit-orc-town-hall"} } )

DefineButton( { Pos = 1, Level = 1, Icon = "icon-orc-town-hall-salvage",
   AlwaysShow = true,
   Action = "callback", Value = function(townHall)
	if ((GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-orc-town-hall") < 2) and (GetPlayerData(GetThisPlayer(), "Resources", "wood") < GetUnitTypeData("unit-orc-town-hall", "Costs", "wood"))) then
         AddMessage("Refusing to salvage town hall, not enough wood to rebuild!!!")
         return
	end			
      DamageUnit(-1, townHall, GetUnitVariable(townHall, "HitPoints"))
      SetPlayerData(GetThisPlayer(), "Resources", "gold",
                      GetPlayerData(GetThisPlayer(), "Resources", "gold") + GetUnitTypeData("unit-orc-town-hall", "Costs", "gold"))
   end,
   Allowed = "check-units-or", AllowArg = {"unit-peon"},
   Description = "Confirm salvaging of this Town Hall. YOU NEED AT LEAST 1 PEON!",
   Key = "s", Hint = "~!SALVAGE CONFIRM",
   ForUnit = {"unit-orc-town-hall", "unit-orc-blackrock-spire"} } )

----------------------
local humanSalvageIcon = CIcon:New("icon-human-town-hall-salvage")
humanSalvageIcon.G = CPlayerColorGraphic:New("contrib/graphics/ui/human/icon-human-salvage-th.png", 27, 19)
humanSalvageIcon.Frame = 0

DefineButton( { Pos = 4, Level = 0, Icon = "icon-human-town-hall-salvage",
  Action = "button", Value = 1,
  Description = "Salvage this town hall for gold to rebuild somewhere else.",
  Key = "v", Hint = "SAL~!VAGE",
  ForUnit = {"unit-human-town-hall"} } )
  
DefineButton( { Pos = 2, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "esc", Hint = "~<ESC~> - CANCEL",
  ForUnit = {"unit-human-town-hall"} } )

DefineButton( { Pos = 1, Level = 1, Icon = "icon-human-town-hall-salvage",
   AlwaysShow = true,
   Action = "callback", Value = function(townHall)
	if ((GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-human-town-hall") < 2) and (GetPlayerData(GetThisPlayer(), "Resources", "wood") < GetUnitTypeData("unit-human-town-hall", "Costs", "wood"))) then
         AddMessage("Refusing to salvage town hall, not enough wood to rebuild!!!")
	return
	end
      DamageUnit(-1, townHall, GetUnitVariable(townHall, "HitPoints"))
      SetPlayerData(GetThisPlayer(), "Resources", "gold",
                        GetPlayerData(GetThisPlayer(), "Resources", "gold") + GetUnitTypeData("unit-human-town-hall", "Costs", "gold"))
   end,
   Allowed = "check-units-or", AllowArg = {"unit-peasant"},
   Description = "Confirm salvaging of this Town Hall. YOU NEED AT LEAST 1 PEASANT!",
   Key = "s", Hint = "~!SALVAGE CONFIRM",
   ForUnit = {"unit-human-town-hall", "unit-human-stormwind-keep"} } )

Edited/Modified Version of the Salvage Town Hall Ability

-----------------------------------------------------------------------
-- Town hall salvage buttons (MODIFIED VERSION)
-----------------------------------------------------------------------

local orcSalvageTownHallIcon = CIcon:New("icon-orc-town-hall-salvage")
orcSalvageTownHallIcon.G = CPlayerColorGraphic:New("contrib/graphics/ui/orc/icon-orc-salvage-th.png", 27, 19)
orcSalvageTownHallIcon.Frame = 0

DefineButton( { Pos = 4, Level = 0, Icon = "icon-orc-town-hall-salvage",
  Action = "button", Value = 1,
  Description = "Salvage this town hall for gold to rebuild somewhere else.",
  Key = "v", Hint = "SAL~!VAGE",
  ForUnit = {"unit-orc-town-hall"} } )
  
DefineButton( { Pos = 2, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "esc", Hint = "~<ESC~> - CANCEL",
  ForUnit = {"unit-orc-town-hall"} } )

DefineButton( { Pos = 1, Level = 1, Icon = "icon-orc-town-hall-salvage",
   AlwaysShow = true,
   Action = "callback", Value = function(townHall)
      DamageUnit(-1, townHall, GetUnitVariable(townHall, "HitPoints"))
      SetPlayerData(GetThisPlayer(), "Resources", "gold",
                      GetPlayerData(GetThisPlayer(), "Resources", "gold") + GetUnitTypeData("unit-orc-town-hall", "Costs", "gold"))
      SetPlayerData(GetThisPlayer(), "Resources", "wood",
                      GetPlayerData(GetThisPlayer(), "Resources", "wood") + GetUnitTypeData("unit-orc-town-hall", "Costs", "wood"))
   end,
   Allowed = "check-units-or", AllowArg = {"unit-peon"},
   Description = "Confirm salvaging of this Town Hall. YOU NEED AT LEAST 1 PEON!",
   Key = "s", Hint = "~!SALVAGE CONFIRM",
   ForUnit = {"unit-orc-town-hall", "unit-orc-blackrock-spire"} } )

----------------------
local humanSalvageTownHallIcon = CIcon:New("icon-human-town-hall-salvage")
humanSalvageTownHallIcon.G = CPlayerColorGraphic:New("contrib/graphics/ui/human/icon-human-salvage-th.png", 27, 19)
humanSalvageTownHallIcon.Frame = 0

DefineButton( { Pos = 4, Level = 0, Icon = "icon-human-town-hall-salvage",
  Action = "button", Value = 1,
  Description = "Salvage this town hall for gold to rebuild somewhere else.",
  Key = "v", Hint = "SAL~!VAGE",
  ForUnit = {"unit-human-town-hall"} } )
  
DefineButton( { Pos = 2, Level = 1, Icon = "icon-cancel",
  Action = "button", Value = 0,
  Key = "esc", Hint = "~<ESC~> - CANCEL",
  ForUnit = {"unit-human-town-hall"} } )

DefineButton( { Pos = 1, Level = 1, Icon = "icon-human-town-hall-salvage",
   AlwaysShow = true,
   Action = "callback", Value = function(townHall)
      DamageUnit(-1, townHall, GetUnitVariable(townHall, "HitPoints"))
      SetPlayerData(GetThisPlayer(), "Resources", "gold",
                        GetPlayerData(GetThisPlayer(), "Resources", "gold") + GetUnitTypeData("unit-human-town-hall", "Costs", "gold"))
      SetPlayerData(GetThisPlayer(), "Resources", "wood",
                      GetPlayerData(GetThisPlayer(), "Resources", "wood") + GetUnitTypeData("unit-human-town-hall", "Costs", "wood"))
   end,
   Allowed = "check-units-or", AllowArg = {"unit-peasant"},
   Description = "Confirm salvaging of this Town Hall. YOU NEED AT LEAST 1 PEASANT!",
   Key = "s", Hint = "~!SALVAGE CONFIRM",
   ForUnit = {"unit-human-town-hall", "unit-human-stormwind-keep"} } )

Therefore in a possible way of coding all this;
What kind of Town Hall Health before salvaging/selling the structure at reduce gold/minerals & lumber/gas cost will be like;
A: 100% health for 1000 gold/minerals to 700 lumber/gas salvage/sell costs
B: 50% health for reduced gold/minerals & lumber/gas salvage/sell costs
C: 10% health for highly reduced gold/minerals & lumber/gas sell costs, e.g 50 gold/minerals, no lumber/gas or 0 g/m to 0 l/g
D: 0% = death/destroyed meaning no gold/minerals & lumber/gas sell costs

PLUS One last thing;

When you guys have a possible chance to update the master-builds of Stargus (like 3.3.0 to 3.3.3 or 3.3.4) or do a possible release of Stargus 3.x.x for custom mapping, modding, and other sort of things before Starcraft1 turns 25 on the 31st of March to the 1st of April.
Though I do not think version 2.4 of SC1gus of that might be modding-to-custom-unit-making friendly only at some point now, sooner or later afterwards. :-
Since i have some samples of the LUA files (the scripts) from the 3.3.0 pre-release builds on my computer, they are probably missing .lua files, like Arbiters for Protoss, Spider Mines for Terran Vultures, and alongside a "weapons.lua" file while checking on some of the files via NP++ confirmingly.
Stargus_Missing_Files_Names_Info_etc.zip
But before I go on, heres some images alongside mockups of potential customs (like units), well just Terran units instead of buildings or Zerg and/or Protoss units via the StarEdit you guys like.
Therefore thanks in advance by the way! ~J-Kun (feruenzerujkun)
Starcraft1gus_CommandCardMenu_Difference
TerranMarine_ShotgunInsteadOfRifle
Starcraft1ImageMockupHell_1
Starcraft1ImageMockupHell_2
Starcraft1ImageMockupHell_3_4_before_after
DumbCraft1_part1
DumbCraft1_part6_final40_before_after

@andreas-volz
Copy link
Contributor

I'd really like to comment something helpful, but I'm not sure if I get your major question of this right. Are you able to join discord and discuss your points in a more dialog way?

@jkun-stargus-sc1gus-2020s
Copy link
Author

jkun-stargus-sc1gus-2020s commented Jun 5, 2023

I'd really like to comment something helpful, but I'm not sure if I get your major question of this right. Are you able to join discord and discuss your points in a more dialog way?

@andreas-volz
sorry for the late "last months" reply to answer, mr. volz, I was pretty much busy with random things lately, but therefore I couldn't do (or share) any more Starcraft1 mockup shots (as forgot or forgetted) to do today or last weeks via PaintDotNet after ChaosLauncher rather.
Though I would like to be able to join the Discords (any of the WC1&2gus to SC1gus discords) alongside the sacegine-dev-discord channels, sad thing is; I might have to work on my own Discord acc for all this instead of the one I'm using to deal with a single friend of my online past half-a-decade ago (late 2017) it seems likely.

Giving an "Able to Join (your/Timfel's) Discord a Try" thing could help, that way I can either move from Github (the issues pages of either repository) so that I can see if I can be able to share and place my SC1 (itself, StarEdit, DatEdit v1.5d, SCMdraft, et cetera) mockup images and other works there (on any of the channels or DMs you/we use) eventually.

But man I wish I could take a peek at SC1's dat/tbl/etc. files or any of kind SC1 (1.15, 1.16, 1.whatever, etc.) game data files via the use of Notepad++ and any other apps/programs similar to that of NP++, like a miracle for the use of making customs via duplicating (instead of the replacing) the original SC1/BW units maybe. V_V
zzz#StupidGithubStupidMe___x1
units.dat (Terran Marine, Terran Firebat, Terran Siege Tank, Zerg Zergling, Zerg Hydralisk, Protoss Units, etc.)
zzz#StupidGithubStupidMe___x2
weapons.dat (Gauss Rifle, Grenade Launcher, Protoss Psi Blades, Zerg Creature Claws, Photon Cannons, etc.)
zzz#StupidGithubStupidMe___x3
upgrades.dat (Terran Infantry Weapons and Armor, Terran Ground/Air/Sea Vehicle Weapons and Armor, Zerg Attacks and Carapace, Protoss Armor and Weapons, other upgrades, etc.)
zzz#StupidGithubStupidMe___x3
techdata.dat ( possibly Research/Technologies, Abilities or anything else probably? )

@andreas-volz
Copy link
Contributor

Don't spend the effort to understand those files. I did this in very deep with lot of reverse engineering. To get the big picture of my analysis check the Wiki from my branch. (I didn't yet merge the wiki):
https://github.com/andreas-volz/stargus/wiki/Dat-Files-Architecture

Also please read the "kaitai" source files for a understanding of the starcraft file format:
https://github.com/Wargus/stargus/tree/master/src/kaitai

Meanwhile I understood nearly all fields and parsed them into startool. Just iscript.bin isn't yet finished as this is the most difficult part.

@andreas-volz
Copy link
Contributor

Use the online editor on http://kaitai.io/ and with use of my kaitai files just take a look into the data. It's easy :-)

@jkun-stargus-sc1gus-2020s
Copy link
Author

jkun-stargus-sc1gus-2020s commented Jun 28, 2023

Don't spend the effort to understand those files. I did this in very deep with lot of reverse engineering. To get the big picture of my analysis check the Wiki from my branch. (I didn't yet merge the wiki): https://github.com/andreas-volz/stargus/wiki/Dat-Files-Architecture

Also please read the "kaitai" source files for a understanding of the starcraft file format: https://github.com/Wargus/stargus/tree/master/src/kaitai

Meanwhile I understood nearly all fields and parsed them into startool. Just iscript.bin isn't yet finished as this is the most difficult part.

Use the online editor on http://kaitai.io/ and with use of my kaitai files just take a look into the data. It's easy :-)

@andreas-volz
Late thanks; since you shared me a link to it after I downloading the files (.ksy = kaitai) from some of the repo pages last weeks (a while ago) to see if either that or the SC1 .dat files are changeable or editable at least.

Since I tried, I couldn't (edit any of this while looking into the SC1 data lines and sections of it) because I would not think any of the lines, texts and/or numerals for it are thoroughly editable on the online or offline Kaitai editor they seemed:
z#KaitaiScreenshot

Then if like changing the values from 227/228 to different value for any expanded values.
e.g (see image below);
DatEdit - 1 5d - SoundsTab - MockupTest

1143 or other (seen in mockup image of DatEdit 1.5d. instead of any version compatible with 1.16.1 dat files) :\

But; speaking of which, i gotta go handle some things, like dealing with some more mockup images, or maybe do whatever I'm doing outside of Github or Reddit (i have my own reddit acc) like Diablo1 (via BB or TheHell2Mod) or other after waking up in bed after going to be at night while waiting.
Thus I feel a worried about Discord unletting me make an account last night, where I can join Timfel's servers and your servers, same with t-g2's sacengine Discord server containing a "How get Sacrifice working on Windows 10 via CD version", due to phone number requirements preventing people who are sensitive-to-but-not-interested-in phone numbers and SMS from getting their main or alt DCRD acc without one in a very sad-but-disappointing way for them. :(

Then if that's case; then I might share you and tf a ZIP file attachment containing some any% completed mockup images along with some other things (like a single thing-v-thing comparison images, probably something the BW cmdicons, and a couple other things) without the need of Discord (if that won't probably let me make my own account on there) instead of just sending you more images after replying, hope the viewing, checking/reading and but looking might soothe us well. :')

view and check on them after downloading attachment below; if not, let me know IF it I directly can share the images contained there hopefully after;
MockupImages_Comparisons_a_couple_extra_things.zip

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

No branches or pull requests

2 participants