Posted by: Rrtaya_tsamsiyu - Monday, September 17, 2012 4:11:31 PM
how do i make a button that switches a unit's commandset?
Posted by: acidbrain - Monday, September 17, 2012 4:40:41 PM
[url=http://www.zerohourmods.com/community/viewtopic.php?f=10&t=43]Here[/url] is some info...
Posted by: Rrtaya_tsamsiyu - Monday, September 17, 2012 4:44:28 PM
thanks. and i had a feeling it might be an upgrade type of deal, but im not sure how to make upgrades yet either lol (havent tried making them yet)
Posted by: Annihilationzh - Monday, September 17, 2012 5:14:52 PM
Are you asking about generals or zero hour?
The method linked appears to be for generals (I remember CommieDog talking about this method once, as I've never bothered modding generals). For zero hour, you can copy the worker's fake/real commandset switch, which is much less of a pain.
Posted by: Rrtaya_tsamsiyu - Tuesday, September 18, 2012 5:18:28 AM
Generals. but tut seems to be using ZH (although i think it will still work in generals) because the commandset text your supposed to copy has 14 for the slot number, and Generals only has 12 slots in its commandsets.
Posted by: NewNightmare - Tuesday, September 18, 2012 5:53:16 AM
From GLA worker:
[code=plain] Behavior = CommandSetUpgrade ModuleTag_14
TriggeredBy = Upgrade_GLAWorkerFakeCommandSet
RemovesUpgrades = Upgrade_GLAWorkerRealCommandSet
CommandSet = GLAWorkerFakeBuildingsCommandSet
End
Behavior = CommandSetUpgrade ModuleTag_15
TriggeredBy = Upgrade_GLAWorkerRealCommandSet
RemovesUpgrades = Upgrade_GLAWorkerFakeCommandSet Upgrade_GLAWorkerRealCommandSet
CommandSet = GLAWorkerCommandSet
End[/code]
Just clone all upgrades above in upgrade.ini, and give them your own names so you can recognize them, and substitute the rest of the code (commandsets).
Make sure to make moduletags unique, or WB will keep crashing.
Then the buttons:
[code=plain]CommandButton Command_UpgradeGLAWorkerFakeCommandSet
Command = OBJECT_UPGRADE
Upgrade = Upgrade_GLAWorkerFakeCommandSet
TextLabel = CONTROLBAR:UpgradeGLAWorkerFakeCommandSet
ButtonImage = SUFakeToggle
ButtonBorderType = UPGRADE ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipUpgradeGLAWorkerFakeCommandSet
End
CommandButton Command_UpgradeGLAWorkerRealCommandSet
Command = OBJECT_UPGRADE
Upgrade = Upgrade_GLAWorkerRealCommandSet
TextLabel = CONTROLBAR:UpgradeGLAWorkerRealCommandSet
ButtonImage = SUFakeToggle
ButtonBorderType = UPGRADE ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipUpgradeGLAWorkerRealCommandSet
End[/code]
Again, clone, and edit to fit in context.
Make sure you add them to your commandsets.
Posted by: Annihilationzh - Tuesday, September 18, 2012 5:29:50 PM
You don't need to create new upgrades for this. You can use the existing ones.
Posted by: Rrtaya_tsamsiyu - Wednesday, September 26, 2012 12:01:53 PM
ive been trying to get this to work, but it wont so far. does the CommandSetUpgrade behavior even exist in regular Generals?
Posted by: Annihilationzh - Thursday, September 27, 2012 6:41:45 AM
you can't use newnightmare's code in generals. You have to use acidbrain's code.
Posted by: Mobius-1 - Friday, September 28, 2012 10:52:37 PM
Hi there - are you still trying to make this work?
I recently did this very thing for my own personal mod, and after the debugging bumps it's really simple. The game already has this: the GLA worker has the ability to switch command sets. All you need to do is copy/follow that code for your own use. If you need details, I can show you what I did.
:)
Posted by: Rrtaya_tsamsiyu - Friday, September 28, 2012 10:55:13 PM
thanks, ill check it out
Posted by: NewNightmare - Saturday, September 29, 2012 8:51:29 AM
Mobius-1 please read the whole thread b4 replaying :)
Posted by: Annihilationzh - Saturday, September 29, 2012 2:25:18 PM
Mobius advice is useless if you're not using zero hour.
I'm not just being intentionally negative here. Acidbrain's link is the only way to do this.
Posted by: Rrtaya_tsamsiyu - Monday, October 1, 2012 2:02:44 AM
im doing this on a regular generals unit. and i dident find what you were talking about in the worker's INIs, mobius :/
Posted by: Mobius-1 - Monday, October 1, 2012 8:01:06 PM
Rrtaya_tsamsiyu -
I'm sorry, I totally missed the fact that this was not for Zero Hour. I'll check what I did to see if its the same for both games; I don't know if it will be. I suppose I was too eager to help.
Newnightmare, Annihilationzh,
Feel free to continue helping me in the topic I started.....
Posted by: Rrtaya_tsamsiyu - Tuesday, October 2, 2012 2:07:36 AM
[quote] I'm sorry, I totally missed the fact that this was not for Zero Hour. I'll check what I did to see if its the same for both games; I don't know if it will be. I suppose I was too eager to help. [/quote]
lol, its ok