Staredit Network

Staredit Network -> UMS Assistance -> Shield Batteries
Report, edit, etc...Posted by Mune'R0x on 2006-11-23 at 22:26:45
Okay, so I'm making a map and it has a shield battery in it. I if there was a way you could change the energy cost that the Shield Recharge costs, or if you could disable it or make it cost minerals at all. I've been tweaking with the Unlabled/Unused techs in SCMD2 but nothing has been found. Wondering if you guys know anything about it?
Report, edit, etc...Posted by Lord_Agamemnon(MM) on 2006-11-23 at 22:46:59
Unless I'm mistaken, you'd need a mod, and I don't think even modders can do it. Shield Batteries are nasty to mod...
Report, edit, etc...Posted by Voyager7456(MM) on 2006-11-24 at 09:11:34
I don't think it's possible... according to DatEdit the Recharge Shields order doesn't use any weapon or technology for its targeting/energy requirement data.
Report, edit, etc...Posted by Mune'R0x on 2006-11-24 at 09:33:45
Damn. I was really hoping I could change it. Oh well. It'd be cool if you could change it.
Report, edit, etc...Posted by Heimdal on 2006-11-24 at 21:06:10
You could probably use a EUD trigger to detect the shield battery's energy level...
Report, edit, etc...Posted by NerdyTerdy on 2006-11-24 at 22:40:59
Heimdal are you saying a trigger that when it detects when the shield battery gets to 199 energy (and makes sure you have minerals) it adds 1 to the energy and subtracts a mineral or however much you want it to cost?
Report, edit, etc...Posted by DT_Battlekruser on 2006-11-24 at 23:22:03
Yes, that would be totally plausible given that you know the Shield Battery's LocalID, which would mean it would have to be preplaced. If you started needing to do it to any Shield Battery that gets built, you would start having more problems.

>>Mapping Assistance
Report, edit, etc...Posted by NerdyTerdy on 2006-11-24 at 23:42:49
I think usually when you use shield batteries (except melee) they're preplaced.
Report, edit, etc...Posted by mockdead on 2006-11-25 at 02:18:55
QUOTE(Lord_Agamemnon(MM) @ Nov 23 2006, 11:46 PM)
Unless I'm mistaken, you'd need a mod, and I don't think even modders can do it.  Shield Batteries are nasty to mod...
[right][snapback]593886[/snapback][/right]


If you know how to Program, and know how Starcraft uses it's memory, you can mod anything.
Report, edit, etc...Posted by DT_Battlekruser on 2006-11-25 at 03:15:00
Only if "knowing how to program" means ASM knowledge, and in those cases you'd seriously almost be better off writing your own game engine from scratch so you have a workable standard source code to toy with.
Report, edit, etc...Posted by Mune'R0x on 2006-11-25 at 20:34:00
Umm, so is there any way you could actually do this? And can you show me or something?
Report, edit, etc...Posted by DT_Battlekruser on 2006-11-25 at 22:02:48
Can you know the LocalID of the Shield Battery (i.e. is it preplaced), or does this have to work for any Shield Battery that gets built during the course of the game?
Report, edit, etc...Posted by Mune'R0x on 2006-11-26 at 01:04:49
It can be preplaced ones. But what is a LocalID?
Report, edit, etc...Posted by Heimdal on 2006-11-26 at 02:54:21
That's not very good terminology, dtbk. What he means is the index in the unit array. This is usually only possible for preplaced units, and you can find it out in lots of ways:
* if you know the order the unit was placed
* hex editing
* scmtoolkit

Once you know the index in the unit array, you can calculate the offset in memory of where that unit's energy counter will be. Then you find out how far it is from the deaths table (for EUD conditions) or resources table (for my newfangled EPR conditions). Once you know that, you create a Deaths or Accumulate conditions with some crazy parameters that will detect said energy value.
Report, edit, etc...Posted by Mune'R0x on 2006-11-26 at 02:56:32
Make a test map where it takes away 1 mineral for every 1 energy used from the SB. Me love you long time if you do!
Report, edit, etc...Posted by Heimdal on 2006-11-27 at 23:54:51
I'm on it.

Whew, that was fast.

It's not exactly what you asked for, but it should get you far enough along. There's a shield battery on the map and a dragoon with no shields. There are two triggers, one that fires when the shield battery's energy is at least 200, and one when it's at least 100. Recharge the dragoon's shield and you can see it in action.

How to use it: Like DTBK said, you have to find the index in the unit array of the shield battery you want to test. For me, I made it the first unit on the map. If you get SCMToolkit and scroll through the unit list, I believe it will tell you the index of each unit.

The player you need to use for the first unit's (index 0) energy is 30486. Each unit is 336 bytes, so take the unit index for your shield battery and multiply it by 84 (336/4) and add that to 30486. This is the player you need to use for the accumulate condition.

Now, the energy value is in the high-order byte at this address. So whatever energy value you're testing for, you need to multiply it by 256^3, or 16777216 when you write it in the trigger. If the value you're testing for is greater than 127, you'll cause an overflow in starforge if you use the raw value - you need to make it unsigned by subtracting 256^4, or 4294967296.

And...that just about wraps it up. Let me know if you have any questions.

ADDITION:
I hate to double post, but since my last update was an edit I'm worried that you might not have seen it, and this thread is in danger of being knocked off the first page.

That, and I updated the map to do something more along the lines of what you originally asked for. The tough part is that the shield battery's energy goes down much faster than the trigger cycle, so just detecting 199 energy doesn't really work. Right now I have it set to subtract 10 minerals when the energy becomes at most 190. This still isn't entirely accurate because you can recharge 300 units of shield with 100 minerals (it should be a 2:1 ratio). In any case you'll probably want to tweak the minerals:shield ratio anyway, so getting this perfect doesn't matter since you'll just change the scaling factor.

Here's the updated map: [attachmentid=21874]

EDIT #4: Wow, apparently you can't double post even if you try. Since the files have the same name I'm adding the link to the ADDITION above.
Report, edit, etc...Posted by Mune'R0x on 2006-11-28 at 19:26:14
Oh, this is pretty cool. Thanks. Now I just gotta add this near-pointless effect into a map.
Report, edit, etc...Posted by deaden on 2006-11-28 at 21:22:33
Thanks! this will be very helpful for the spell system im trying to design, where I detect the casting of in game spells which will then trigger game made spells...

EDIT:
Hmm....I have the custom lst files to use invalid unit values, but not invalid player values.....wont let me use p30486 for example. Also, were would be a good place to start for a newbie looking to learn the structure of the .scx/.scm for hex editting purpouses?
Report, edit, etc...Posted by Striker X 22 on 2006-12-02 at 01:52:58
stop scaring the kids, heimdal... you're being too smart/knowledgeable/useful.

but yeah, i'm with deaden, maybe i should start looking into the higher complexities of map making to free myself from blizzards constraints a bit more... but i'm afraid i'd have to start lower =P
Next Page (1)