Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Writing to SC's memory with extended units!
Writing to SC's memory with extended units!
Aug 7 2012, 3:17 am
By: Biophysicist
Pages: < 1 2 3 4 510 >
 

Aug 10 2012, 12:51 am Biophysicist Post #41



Yah, I know. :P I just tested it to make sure and then posted it here so others would know.



None.

Aug 10 2012, 2:49 am Oh_Man Post #42

Find Me On Discord (Brood War UMS Community & Staredit Network)

SEN's wiki seems pretty barebones...




Aug 10 2012, 3:06 pm Biophysicist Post #43



Going to get that wiki set up today. I mean seriously, the wiki will be so set up it'll be like something that was set up a lot.

New findings:

Interceptors can be changed to other unit types. An Inteceptor changed to a Tassadar/Zeratul Archon worked normally, but had TZ's stats and weapon, and presumably would be targeted as a land unit. An Interceptor changed to an Observer launched normally and could Detect but was not cloaked and did not attack. (This is unsurprising, but I was unsure if it would launch.) An Interceptor changed to a Carrier crashed when trying to attack.

A Medic turned into a Larva morphed without crashing. It did not die when off Creep. A Zergling turned into a Hydralisk also morphed without crashing. I did not test an Overlord/Mutalisk, but know from modding experience that that would not crash.

There exists an entry in the unit struct, +0xC0, which indicates how many Spider Mines a Vulture has. Writing to this address gives a Vulture (or Raynor Vulture) more mines. (In my tests, I used a Raynor Vulture at index 1367, and killed Unit 3904 for player 198.)

Changing a Nuclear Missile, as launched from a Silo, is useless, with two exceptions. They still act just like regular Nukes if launched by a Ghost, including the damage at the end, and they look like Nukes, ofc. The first use of this is that the changed Nuke will have the vision of the new unit ID, presumably including any Detection. The other, and probably more useful, use is that the Nuke can receive orders, and if it does then it will stop its usual launch sequence and behave like a regular unit. The launching Ghost, however, will remain frozen if he hadn't unfrozen yet. The unit will be permanently invulnerable, which cannot be disabled by a trigger.

A Xel'Naga Temple transformed into a Mineral Field is vulnerable, but for some reason cannot be mined from. If selected during the transformation, it apparently leaves its HP bar behind, permanently, even after dying. Theory: This has to do with the Mineral Field normally not having an HP bar.

Glave Wurm will not bounce to units for extended players.

Post has been edited 3 time(s), last time on Aug 10 2012, 4:33 pm by Biophysicist.



None.

Aug 10 2012, 4:49 pm jjf28 Post #44

Cartography Artisan

How to 'Target' an address:

we know that 48*ID + 4*P + 5808992 = Address (decimal)

If we want to solve for combinations of ID and Player#'s for a specific address, the math gets sticky fast... what we can do, however, is solve for the max and min ID's you could use for that address.

Code
Min ID = Ceiling[ ( A - 5810016 ) / 48 ]
Max ID = Floor[ ( A - 5808996 ) / 48 ]

Ceiling means you round the number up to the nearest integer, Floor means down to the nearest integer

Then you can plug in each possible ID and your address into the following equation to calculate the player numbers
Code
Player # = ( Address - 48*ID - 5808992 ) / 4


ex:

I want to target 0x006556E4 for network latency, convert this to dec and it's 6641380
Min ID = Ceiling[ ( 6641380 - 5810016 ) / 48 ] = Ceiling[ ( 831364 ) / 48] = Ceiling[17320.1] = 17321
Min ID = 17321

Max ID = Floor[ ( 6641380 - 5808996 ) / 48 ] = Floor[ ( 832384 ) / 48] = Floor[17341.3] = 17341
Max ID = 17341

Now I can start plugging ID's in to calculate the player # combo's...
Player # = ( 6641380 - 48*17321 - 5808992 ) / 4 = 245
Player # = ( 6641380 - 48*17322 - 5808992 ) / 4 = 233
... and so on and so fourth ...
Player # = ( 6641380 - 48*17341- 5808992 ) / 4 = 5

Giving me combinations:
ID:17321, P:245
ID:17322, P:233
... ...
ID:17341, P:5

Since working unitID's are rare, if you have ID's between ID1585 through ID13478, you should probably calculate indexes you can edit, rather than trying to find a combo for a specific unit. Programs are being built to perform these rather tedious calculations as we speak!



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Aug 10 2012, 4:51 pm Kaias Post #45



I suppose I should share more of what I've learned.

Changing a unit into a goliath or tank turret (or their hero variants) will crash the game. This means that if you try to ID shift a unit passed the tank turret it will crash first. You can circumvent this, however, by killing the units all at the exact same time to "jump" over the offending unit ids. The easiest way to do this, I found, was to use Lurkers (firebats and seige tanks for splash weren't doing any damage).

Shifting passed id 228 causes the game to crash (unfortunately).

ID shifting also works as another way to do the Power-up Glitch. You can shift a powerup into other ids and then pick it up to show graphics that weren't intended to be shown. This method has the advantage of being able to shift into units that are normally invalid or crash (like Zerg Marker, or Cave-in) or can't be made via triggers (Start Location) which the Hallucinated method doesn't work for. It has the disadvantage of not being able to reach any id below ~120. Example, if you shift a powerup into an Independent Command Center, picking it up will show "Eldfire":

Other examples (addon connector and protoss beacon overlay):


If you pick up a powerup and then shift the powerup, the graphic will not change. You can shift a held powerup passed id 228 without it crashing. It will crash, however, if you kill the worker holding the extended unit (I suppose this depends on the extended unit).

Critters shifted to regular units no longer JYD. Critters shifted to buildings still JYD but you can't order them around. Units shifted to critters JYD. You can give most [men] scarabs and intercepters just fine (by making them into reavers and carriers). High Templars have an attack animation (because of Tassadar), and so can be make into an attacking unit just fine.



None.

Aug 10 2012, 4:58 pm Biophysicist Post #46



Quote
Changing a unit into a goliath or tank turret (or their hero variants) will crash the game. This means that if you try to ID shift a unit passed the tank turret it will crash first. You can circumvent this, however, by killing the units all at the exact same time to "jump" over the offending unit ids. The easiest way to do this, I found, was to use Lurkers (firebats and seige tanks for splash weren't doing any damage).
Theory: A turret that is attached to a Goliath/Tank can be shifted to another type of turret.

What is the Power-Up Glitch?



None.

Aug 10 2012, 5:03 pm Kaias Post #47



Quote from Biophysicist
Quote
Changing a unit into a goliath or tank turret (or their hero variants) will crash the game. This means that if you try to ID shift a unit passed the tank turret it will crash first. You can circumvent this, however, by killing the units all at the exact same time to "jump" over the offending unit ids. The easiest way to do this, I found, was to use Lurkers (firebats and seige tanks for splash weren't doing any damage).
Theory: A turret that is attached to a Goliath/Tank can be shifted to another type of turret.

What is the Power-Up Glitch?
http://doodle77.dyndns.org/staticsen.php?st=10451

I just tried shifting a Tank turret (that was attached to a tank) and it crashed.

Post has been edited 1 time(s), last time on Aug 10 2012, 9:48 pm by Kaias.



None.

Aug 10 2012, 6:16 pm Biophysicist Post #48



Writing to offset +0x98 of a transition unit (Egg, Lurker Egg, or Cocoon) that is morphing normally increases the unit ID of the unit that will come out of the transition. It also changes the remaining build time based on the build time of the new unit. (If a unit is exactly half-finished and changes to a unit ID that takes four seconds to train, it will finish training two seconds after the swap.) Cancelling the morph will refund the cost of the new unit. There is, however, an important issue with the Lurker Egg, which will not finish the morph unless operation cwal is on. Likewise, if the new unit's build time is significantly shorter than the old unit's, the morph will also not finish. I cannot promise that the morph will not look silly.

Writing to offset +0x98 of a building, Carrier, or Reaver that is training a unit does /not/ change the unit that will be trained. It does, however, alter the build time, refund cost, and queue icon. This could be used for a Chrono Boost-esque ability.

Writing to offset +0x9C of a build, Carrier, or Reaver that has three units in its queue changes the build time, refund cost, and queue icon of the third unit in the queue. When the third unit is finally trained, it will be the unit indicated by the queue icon. (I queued five Infested Terrans, then increased this address for the ICC. The third unit changed icon, etc, to Infested Kerrigan, and an Infested Kerrigan indeed trained.) Offset +0x9E does the same for the fifth queued unit.

Writing to any of these offsets for units that are upgrading does weird stuff, though it's conceivable that I did something wrong. More research here is needed, if the pun may be excused.

Post has been edited 2 time(s), last time on Aug 10 2012, 6:28 pm by Biophysicist.



None.

Aug 11 2012, 4:22 pm Biophysicist Post #49



Double-post ftw. >.> I'll be using http://neoeud.wikia.com to document stuff now, and will make a new thread once I get a significant amount of information on it.

Also, http://neoeud.wikia.com/wiki/Iscript may interest some of you guys.



None.

Aug 11 2012, 8:23 pm Chia-Tyrant Post #50



Just in case anyone might find this useful, you don't need to use deaths to achieve the same results. Just preplacing unit ID 4586 for player 199 will also modify unit index 1367 (e.g. turn a marine into a vulture if there are 2).

If that unit were to die, be removed or be given to another player (unfortunately, unit ID 4586 cannot, unlike unit ID 3900) then the marine could theoretically revert back to its original form.

I'm sure everyone knows this already but you can modify address 4*Player+48*UnitID+5776160 (where player=1 for player 1) just by preplacing that unit.

Attachments:
PEU test.scm
Hits: 20 Size: 56.6kb



None.

Aug 11 2012, 8:41 pm Biophysicist Post #51



Quote
I'm sure everyone knows this already but you can modify address 4*Player+48*UnitID+5776160 (where player=1 for player 1) just by preplacing that unit.
Oh! No, I don't think anyone here did. That's pretty cool. This equation might also help us find units that don't crash... I'd guess that at least some of our crashes are from extended units writing to areas of memory that shouldn't be written to.

Quote
If that unit were to die, be removed or be given to another player (unfortunately, unit ID 4586 cannot, unlike unit ID 3900) then the marine could theoretically revert back to its original form.
That /would/ be awesome, if it works. Can it not be killed/given by triggers?

EDIT: Important: That's 5776160 in decimal, right? You should convert it to hex to avoid confusion.

Post has been edited 2 time(s), last time on Aug 11 2012, 9:08 pm by Biophysicist.



None.

Aug 11 2012, 9:20 pm jjf28 Post #52

Cartography Artisan

Seems evident that chia-tyrant's formula is from this
Code
00582324     1.16.1     Win     All Unit Counts Table


I don't think we've been giving most of these proper attention:
Code
00582324     1.16.1     Win     All Unit Counts Table
00584DE4     1.16.1     Win     Completed Unit Counts Table
005878A4     1.16.1     Win     Killed Unit Counts Table
0058A364     1.16.1     Win     Death Table Start

They're probably all useful :)



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Aug 11 2012, 9:32 pm Biophysicist Post #53



Tried using P199:3900 in chia-tyrant's map. Marine stayed a Marine. (And yes, he's at the right index, unless I mathed wrong.)



None.

Aug 11 2012, 9:49 pm staxx Post #54



Wow! This works on non expansion as well all bow down to the great chia-tyrant!



None.

Aug 11 2012, 10:04 pm jjf28 Post #55

Cartography Artisan

Quote
Tried using P199:3900 in chia-tyrant's map. Marine stayed a Marine. (And yes, he's at the right index, unless I mathed wrong.)

Worked for me, calculated it to index 1465

Attachments:
PEU 3900.scm
Hits: 13 Size: 56.81kb



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Aug 11 2012, 10:06 pm Biophysicist Post #56



Oh, that would be why. >.> I mathed wrong.

EDIT: Loaded map modified to give Vultures 40000 damage. The Marine turned into a Vulture on start as expected. When I killed a P199:3900 with it, the Vulture turned into a Ghost. :D

Attachments:
MorphBack.scx
Hits: 12 Size: 56.86kb

Post has been edited 1 time(s), last time on Aug 11 2012, 10:11 pm by Biophysicist.



None.

Aug 11 2012, 11:11 pm Chia-Tyrant Post #57



Retrogradable upgrades! Woohoo! :D

Edit: Unit ID 690 is a scourge that can be killed, much like unit ID 3900. By preplacing one for player 220, you increase the value at address 48*690+4*220+5787104=5821104 by one. In hexadecimal, 5821104 is 0058D2B0. According to this and that, it's the address for terran armor upgrades.

By killing the unit, the value goes down by 1, thereby reducing the marine's armor by 1.

Attachments:
PEU test.scm
Hits: 15 Size: 51.7kb



None.

Aug 11 2012, 11:18 pm Biophysicist Post #58



Hm. This is quite cool. :D But you'd have to make sure that the DC isn't somewhere harmful...

Can extended units be Given by triggers? I don't know if SCMDraft supports it, but could you do it with a hex editor?



None.

Aug 11 2012, 11:39 pm Kaias Post #59



By modifying an address with an extended unit but not an extended player (P1-P12), we should be able to modify the value back and forth using give, right?



None.

Aug 11 2012, 11:40 pm Biophysicist Post #60



Assuming we can Give extended units, that would be presumable. I'd test, but... I'm not thrilled about poking triggers with a hex editor.



None.

Options
Pages: < 1 2 3 4 510 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
Please log in to shout.


Members Online: Moose