I need someone who knows how to make plugins to help me. I'm trying to set it up so that the following ASM code runs when a certain button is pressed. I was thinking of overwriting the Liftoff button (if that is possible and makes sense), but if there is a better way to do this, please tell me.
TZ's nooby asm crap
BITS 32
push ebx
push ecx
push cx
push dx
mov ecx, [0068C134]
mov ebx, [ecx]
mov ebx, [ebx + 0xc1]
cmp dword ebx, 0
je mudkip
mov ebx, [ecx]
mov ebx, [ebx + 0xc2]
jmp mudkip
mudkip:
mov cx,dx
add [ebx], dx
pop cx
pop dx
pop ecx
pop ebx
ret
(Also, anyone who knows ASM: Are there any obvious errors? It's supposed to add the value in register CX to the value at offset +0xC1 if the value there is equal to 0, otherwise add the value in register CX to the value at offset +0xC2.)
Post has been edited 2 time(s), last time on Mar 11 2009, 3:39 am by James Buchanan.
None.
ALL PRAISE YOUR SUPREME LORD CORBO
Is that supposed to be a memory offset or a number?
Other than that the tutorial on campaign creations is rather useful. Basically the action variable of the button pressed is stored in CX. You'd need to compare when CX is your wanted action variable and execute your action =/
fuck you all
That's supposed to be the address for the currently selected unut in the unit table (or w/e), not a number... Should that be "mov ecx, [0068C134]"?
Anyway, what I really need help with is making a button excecute this code. If someone could explain how to do this, I'd really appreciate it... Keep in mind that TZ sux and doesn't understand smart people words, though. (The tutorial on Campaign Creations doesn't explain how to do this.)
None.
ALL PRAISE YOUR SUPREME LORD CORBO
yes it does.
and yes put it in []s
Let me quote it, give me a sec.
One Last Tid-Bit
For now, this is going to be it. There's a lot more, but its too unorganized to show to the public as of yet.
The final note that I'll leave you with is this: when you call a stargraft action, recall that you can give SG an Act Var (action variable). When Starcraft calls your button code, this Act Var is actually on the CX register when your code starts. So you can use that variable to create some versatile actions. For example, this example will add X to a units' Hitpoints, where X is the Act Var that was input in that particular button:
PUSH EBX
MOV EBX,[68d310h]
ADD [EBX+09h],CX
POP EBX
RET
Since CX holds the value that was in the Act Var, we added that value to the current hitpoints. Simple.
The memory offset if for 1.07 so don't try to be clever and use it.
Post has been edited 1 time(s), last time on Mar 11 2009, 3:26 am by Corbo.
fuck you all
But... My problem is that I don't know how to make SC use my code when the button is pressed...
None.
ALL PRAISE YOUR SUPREME LORD CORBO
Make another word like AX a value of youractvar of the button then PUSH CX then compare them and if CX is the same as AX (where you inserted your act var for the pressed button) jump to your code. As simple as that. You should REALLY read the tutorial.
Don't lie. You haven't read it. If you had you'd know that there's a part on how to even run the code insert it in stargraft and even what compiler to use.
fuck you all
I have too read it. The problem is I can't get StarGraft to work, nor do I want to use it if I can avoid it.
(If you want proof that I have read it, at one point, he says "parasite status - I'll get back to you on this one" or something like that.)
None.
ALL PRAISE YOUR SUPREME LORD CORBO
You can always just make a stupid .dll in c++ that it's actually nothing but a line that goes like
ASM_ and then your asm code follows.
You'd have to check on this one cause I barely remember what was the actually function. Besides, you're better of believing someone that has actually made a plugin before *cough*iseeuherepoiuy*cough*
fuck you all
That will be a non-multiplayer action if you do that. Because that currently selected unit is only on the computer the button is pushed on, and only that computer knows the button is pushed.
None.
SDE, BWAPI owner, hacker.
I was thinking of overwriting the Liftoff button (if that is possible and makes sense), but if there is a better way to do this, please tell me.
You can add a new button. They're pointers to functions anyway.
Post has been edited 1 time(s), last time on Mar 11 2009, 9:31 am by Heinermann.
@DoA: I know, but that doesn't actually matter... (Don't ask why, it would take a long time to explain.)
@above: More details on how to do that, please?
Oh, I might have a workaround that doesn't need button stuff, but I'd probably need to modify a trigger action to make it work. Is that easier than modifying a button?
EDIT: Actually, come to think of it, I'd probably need to do that either way...
Post has been edited 1 time(s), last time on Mar 11 2009, 6:59 pm by James Buchanan.
None.
PyMS and ProTRG developer
Quote from name:DiscipleOfAdun
That will be a non-multiplayer action if you do that. Because that currently selected unit is only on the computer the button is pushed on, and only that computer knows the button is pushed.
Unit selections are shared between players (for example, play team melee, or devilesk's Egg Ball).
None.
Yay! That is good news. So how would you tell what player
x has selected? How could you find the address?
None.
PyMS and ProTRG developer
The selection groups are shared, but the button being pressed isn't shared. You would have to make the button action send a packet or something to all the other players.
Actually, I'll just make each spell have a unique gas cost to equip.
None.