I need a way to cancel upgrades at a particular unit, without affecting any other unit, when I don't know where the unit is or even which type of unit it is. (So, basically, if the player tries to research something, the upgrade instantly cancels researching.) Does anyone have any ideas? Note that the units in question are mobile and there can be up to 100 (more if the player uses Mind Control a lot).
EDIT: Is there any way to create a unit in iscript? If so, I could put a create unit command into the unit's "working" animation and center a location on that unit.
EDIT2: Okay, there's been some confusion in the shoutbox about this, so I'll try to explain moar guder. Basically, I need a bunch of buttons (at least 7, probably a lot more) that have no effect when clicked on, but that the game can detect when one is clicked (triggers) and do stuff. The only way I could think of to do this is to repurpose a bunch of upgrade buttons and figure out when one is clicked by mineral loss detection. The problem is, pressing the button makes the upgrade's level go up by 1, which means that each button can only be used 255 times. Therefore, I need some way to make the upgrade stop automatically. I know about using Give Units to halt an upgrade, but the problem is figuring out WHICH unit to Give. The units are mobile, and all units (except a few special ones) will need a set of these buttons.
Alternatively, if anyone has a better control idea, I'd be glad to hear it. (Building units wouldn't work, because the units aren't buildings and I can't make them buildings for technical reasons.)
Oh, is there any way to create a unit with iscript? If so, I could just put a create unit command in the "Working" block (the one that plays when a unit is researching or building units and stuff like that). I doubt this a lot, but w/e.
Post has been edited 4 time(s), last time on Jan 27 2009, 9:09 pm by TassadarZeratul.
None.
Give the building to neutral then back again?
None.
Give the building to neutral then back again?
It's modding.
Please report errors in the Staredit.Network forum.
Not buildings... And the problem is figuring out WHICH unit to give. I can't give all of them, or the player's whole army will lose their orders.
EDIT: Okay, there's been some confusion in the shoutbox about this, so I'll try to explain moar guder. Basically, I need a bunch of buttons (at least 7, probably a lot more) that have no effect when clicked on, but that the game can detect when one is clicked (triggers) and do stuff. The only way I could think of to do this is to repurpose a bunch of upgrade buttons and figure out when one is clicked by mineral loss detection. The problem is, pressing the button makes the upgrade's level go up by 1, which means that each button can only be used 255 times. Therefore, I need some way to make the upgrade stop automatically. I know about using Give Units to halt an upgrade, but the problem is figuring out WHICH unit to Give. The units are mobile, and all units (except a few special ones) will need a set of these buttons.
Alternatively, if anyone has a better control idea, I'd be glad to hear it. (Building units wouldn't work, because the units aren't buildings and I can't make them buildings for technical reasons.)
Oh, is there any way to create a unit with iscript? If so, I could just put a create unit command in the "Working" block (the one that plays when a unit is researching or building units and stuff like that). I doubt this a lot, but w/e.
Post has been edited 3 time(s), last time on Jan 27 2009, 9:09 pm by TassadarZeratul. Reason: Grammar fail
None.
You're gonna need locations.
Try running AIScripts on them? If not, ya, give to a player and back. Also, there are MUCH easier ways to do this. Use unit morphs and locations to detect when upgrades happen.
None.
Unit morphs: No can do... I'd actually hit the unit slot limit if I did that, believe it or not.
Giving to a player: The problem is figuring out WHICH UNIT TO GIVE.
Anyway, what AI script? And wouldn't I have the same problem of not knowing which unit to run the script on?
None.
Oh. There's no way to detect what unit is undergoing an upgrade unless you feeling like getting your hands dirty with ASM.
None.
Well, only one unit can be "upgrading" at any given time, so I could use EUDs to find which unit it is by checking which unit is currently selected... (The "upgrade" menu isn't available when more than one unit is selected.) Then the problem is centering a location on the currently selected unit...
Oh, how does one do ASM injection? I could learn assembly, but I don't know how to use it in a mod.
None.
There's an address in the unt node that is set to true if a unit is upgrading and I believe there may be one for which upgrade is being researched.
Post has been edited 2 time(s), last time on Jan 27 2009, 10:49 pm by A_of-s_t.
Quote from name:TassadarZeratul
Well, only one unit can be "upgrading" at any given time, so I could use EUDs to find which unit it is by checking which unit is currently selected... (The "upgrade" menu isn't available when more than one unit is selected.) Then the problem is centering a location on the currently selected unit...
Oh, how does one do ASM injection? I could learn assembly, but I don't know how to use it in a mod.
FG doesn't have the ASM plugin yet(!), but if you feeling going back to the good ol' days of modding, and use StarGraft, here's a short ASM tutorial.
http://www.campaigncreations.org/starcraft/stardraft/asm.shtml
None.
Or just make a plugin in C++ which allows inline ASM.
I'm new at this, remember? How does one make plugins?
EDIT: Can one use both Stargraft and Firegraft?
None.
It's complicated. First you need a C++ compiler, than knowledge of C++ and ASM. Then you get the poper formats for making a plugin. Then you write out all the code after finding the right addresses. After than, you can plug it in with FG and then check if it works.
Check here for what can be done with plugins:
http://bwapi.googlecode.com/svn/EDIT: Can one use both Stargraft and Firegraft?
No, they are for different versions of SC last time I checked. SG for version 1.13f or something and FG for 1.15.0/1.
Where can I get said "formats"?
EDIT: Damn...
None.
Quote from name:TassadarZeratul
Where can I get said "formats"?
EDIT: Damn...
Look in the link I gave you. Either that or ask one of the five other people that know how to make plugins: farty, poiuy_qwert, DoA, Doodle, Heinermann.
I believe I also have the plugin specs for FireGraft somewhere. And if you find can find Pie_Sniper, I'm 90% he did some ASM just two patches ago.
None.
It's complicated. First you need a C++ compiler, than knowledge of C++ and ASM. Then you get the poper formats for making a plugin. Then you write out all the code after finding the right addresses. After than, you can plug it in with FG and then check if it works.
Check here for what can be done with plugins:
http://bwapi.googlecode.com/svn/EDIT: Can one use both Stargraft and Firegraft?
No, they are for different versions of SC last time I checked. SG for version 1.13f or something and FG for 1.15.0/1.
SG is for 1.08, the reason all the old mods were 1.13f is because there was a memgraft version that could import .pats made in stargraft.
Thanks for all the help guys. I know to do this now, yay!
But, I have another question about ASM in SC... I'd like to set it up so that every few seconds, each unit has 1 HP added if it has > 100 shields. How would you recommend doing this?
None.
Set up a loop to check every unit. Check its Shield, if true, then add 1 hp. Move to next unit.
I'd use a trigger edit plugin for that.
What I don't understand is how I'd get the loop into SC... If I have the ASM, how do I make it run as part of SC's main loop?
And what does a trigger edit plugin have to do with this? (Honest question, I don't understand...)
None.