Staredit Network > Forums > Modding Assistance > Topic: Plugin help
Plugin help
Mar 10 2009, 11:37 pm
By: Biophysicist  

Mar 10 2009, 11:37 pm Biophysicist Post #1



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


(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.

Mar 11 2009, 2:10 am Corbo Post #2

ALL PRAISE YOUR SUPREME LORD CORBO

Quote
mov ecx, 0068C134
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

Mar 11 2009, 3:08 am Biophysicist Post #3



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.

Mar 11 2009, 3:17 am Corbo Post #4

ALL PRAISE YOUR SUPREME LORD CORBO

yes it does.
and yes put it in []s


Let me quote it, give me a sec.

Quote
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

Mar 11 2009, 3:25 am Biophysicist Post #5



But... My problem is that I don't know how to make SC use my code when the button is pressed...



None.

Mar 11 2009, 3:31 am Corbo Post #6

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

Mar 11 2009, 3:37 am Biophysicist Post #7



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.

Mar 11 2009, 3:41 am Corbo Post #8

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

Mar 11 2009, 5:29 am Fyrinite Post #9



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.

Mar 11 2009, 9:26 am Heinermann Post #10

SDE, BWAPI owner, hacker.

Quote
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.




Mar 11 2009, 6:43 pm Biophysicist Post #11



@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.

Mar 11 2009, 7:39 pm poiuy_qwert Post #12

PyMS and ProTRG developer

Have fun: LocUnlock v2 Source




Mar 15 2009, 5:40 pm Doodle77 Post #13



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.

Mar 15 2009, 6:26 pm Biophysicist Post #14



Yay! That is good news. So how would you tell what player x has selected? How could you find the address?



None.

Mar 15 2009, 8:22 pm poiuy_qwert Post #15

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.




Mar 15 2009, 8:33 pm Biophysicist Post #16



Actually, I'll just make each spell have a unique gas cost to equip. :)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-20. : 3:08 pm]
Sylph-Of-Space -- woah! nice! thank you!
[2024-5-20. : 4:05 am]
O)FaRTy1billion[MM] -- the setting exists, it's just hidden in a weird place
[2024-5-20. : 4:04 am]
O)FaRTy1billion[MM] -- instead change "Microtile Overlay" to "Impassable"
[2024-5-20. : 4:04 am]
O)FaRTy1billion[MM] -- er, wait, idk why i was looking for height
[2024-5-20. : 4:03 am]
O)FaRTy1billion[MM] -- below the minimap should be a thing that says "Overlay Settings" with a little + button in the corner, press the + to expand it, uncheck Use Defaults, then change "Tile Overlay" to "Height"
[2024-5-20. : 3:57 am]
Sylph-Of-Space -- Unless I'm dum (possible)
[2024-5-20. : 3:57 am]
Sylph-Of-Space -- It would be so so so nice if SCMDraft had some kind of dedicated "walkability" view for the tilesets.
[2024-5-20. : 3:53 am]
Sylph-Of-Space -- :'( dont cry for me cat-gentina
[2024-5-19. : 9:18 pm]
Ultraviolet -- 🔪🐈
[2024-5-19. : 12:34 pm]
NudeRaider -- curiosity kills the cat!
Please log in to shout.


Members Online: jjf28, 8charlottee61100rh5