View Full Version : Reproducing Zerglings
Echo_8
05-10-2006, 4:54 AM
I have been trying to make units be able to produce themselves, zerglings in particular. However, no matter what I do, the button I add does nothing. It doesn't even crash the game.
I've tried:
Removing ALL requirements for zerglings
Setting the build zergling button's ReqType to ALWAYS
Set the zergling as a factory in AIII/AZ/DatEdit
Copied the stat bars of a factory building into that of the zergling
As above, except I copied the carrier'sThe last two just ended up with replacing the zergling's usual stats display with that of stim pack's research progress.
I'm still using BW 1.12b and MG 1.12b, since I only play SC singleplayer, and occasionally, LAN games with my sister.
So can anyone help me?
To be exactly clear, I want to do the following:
Have the zergling able to produce itself
Not allow the zergling to reproduce when burrowed, i.e. the button grays out/disappears
Still require the spawn pool for the production of zerglings
And another question, is there a way to make a mod, which takes advantage of MG's custom action capabilities to edit in-game data in order to add new spells, work with B.Net (or LAN games for that matter)? I've heard that simply changing it (the game data) will just desync the game.
The only way I can think of is resorting to something like WinSock to communicate the changes to the opponent before the game has the chance to desync. Which is a bad idea, since think forcing a user to open a port in their firewall just for a mod is ... is ... is just wrong. Though on a LAN, it wouldn't really matter...
DiscipleOfAdun
05-10-2006, 1:30 PM
1. Building Zerglings...Have you tried changing the flag on the zergling so that it is a building?
2. Use the same requirements as the burrow buttons.
3. Requrement has Spawning pool at the end, like normal.
Mainly the first thing is your problem.
Oh, the action's can't edit every part of memory(it's not all PAGE_READWRITE, most of it is PAGE_READONLY). But, it would work. I would put the changing code into the Always req, since it is most likely to be ran by everyone before you try to call the changed data. The problem with actions is using the offset for the currently selected unit is different on each computer...
SCR kinda' uses that principle to apply energy decrease for the Avenger. Basically, the code replaces some jumps in the original exe by using the Always req. However, since the spell relys on that offset, it desyncs multiplayer.
Good luck with this...
dark.slayer
05-10-2006, 4:40 PM
interesting thought, treating lings as buildings.
just think if you could build units using an scv or probe
Echo_8
05-11-2006, 6:33 AM
1. Building Zerglings...Have you tried changing the flag on the zergling so that it is a building?
Never thought of that... Is unit production hardcoded to only units/buildings with the Building flag?
Oh, the action's can't edit every part of memory(it's not all PAGE_READWRITE, most of it is PAGE_READONLY).
I'm using an edited exe so the PAGE_READONLY won't be too much of a problem. MemGraft has poor support of the addition of new actions so I just use it to call code I appended to the end of the exe.
I would put the changing code into the Always req, since it is most likely to be ran by everyone before you try to call the changed data. The problem with actions is using the offset for the currently selected unit is different on each computer...Does that mean that when any button is clicked on one computer, it isn't "clicked" (or rather the action is executed) on the other computers? Even if my previous sentence is wrong and the action is executed, there'd be no way of knowing who executed the action, and which unit (if that info is passed along), is there?
Also, how do the Reqs work? Is the Req Var value put into CX just like the Act Var is? Will I have to return a value, and if so, is 1 true and 0 false (I use TRUE = -1 in my code, so it's possible Blizzard used a non-standard convention too)? I really hate having to pester you with so many questions, but I'm just not one of those people who can pop open a debugger and understand what a particular block of disassembled code does. All I know of how SC works is from what little I learn off others and find on the internet.
Oh, and good luck with FireGraft. I really hope it's better than MemGraft (and if it is even possible, StarGraft).
-----------------
interesting thought, treating lings as buildings.
just think if you could build units using an scv or probeThink Replicators ;)
*Echo 8 shoves a sock in his mouth before he releases too many details
Don't want a certain Evil Company (http://www.mgm.com/) from killing my mod prematurely, especially since I've been working on it for the past few years. Aquiring meshes suitable for use is hard; making them yourself is even harder. Although, I could always call it Space Door...
Edit: As usual, fixing typos
DiscipleOfAdun
05-11-2006, 10:02 AM
I do not believe that the action tied to the button is ran on every computer. Most actions send a packet to every computer telling what type of action to exectue, the unit to execute it on, and sometimes a variable for that action.
Reqs are ran every time you select a unit and it has to display buttons. It is ran seperate on each computer. Yes, the req var is put into CX. Req actions are a little different, in as they have a retn 4 at the end, instead of just a retn. And the true/false values are 1/0(iifc). Just like any return value, they are in EAX.
Hazreihel
05-11-2006, 8:45 PM
This sounds like an awsome file. When your done can you upload it here? I'd love to play it.
Echo_8
05-12-2006, 2:11 AM
I do not believe that the action tied to the button is ran on every computer. Most actions send a packet to every computer telling what type of action to exectue, the unit to execute it on, and sometimes a variable for that action.In that case, is there a way to trick SC into sending a packet for me, and if so, how would I receive it? Or is it that the neceessary function offsets haven't been found yet?
This sounds like an awsome file. When your done can you upload it here? I'd love to play it.I've been working on it long before I've been a member of Warboards, and will be working on it for a long time more. It's far from ready for public viewing. Word of advice: Never undertake a TC alone while still at school or have other time-consuming obligations.
DiscipleOfAdun
05-12-2006, 9:53 AM
You could code it, and the places to use the packet have been found, however, I don't know them for the version you are working on. Plus, the code for both pretty much has to be a duplicate of different pieces of the assembly that SC uses...
In short, possible, but I can't help with the 1.13e offsets. I am trying to get this into FG however, but that's coming slow.
Echo_8
05-13-2006, 4:09 AM
Oh well, looks like my mod is back in hibernation for a while. With Y12 exams coming up in October, that might be a good thing.
I am trying to get this into FG however, but that's coming slow.Woohoo!!! Custom action support! It's definitely worth the wait, no matter how long.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.