Rrtaya_tsamsiyu
13 years ago
how do i make a button that switches a unit's commandset?
one soul at a time
Sponsor
acidbrain
13 years ago
Here  is some info...
Panem et kirkinses
Rrtaya_tsamsiyu
13 years ago
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)
one soul at a time
Annihilationzh
13 years ago
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.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Rrtaya_tsamsiyu
13 years ago
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.
one soul at a time
NewNightmare
13 years ago
From GLA worker:
  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
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:
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
Again, clone, and edit to fit in context.
Make sure you add them to your commandsets.
Annihilationzh
13 years ago
You don't need to create new upgrades for this. You can use the existing ones.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Rrtaya_tsamsiyu
13 years ago
ive been trying to get this to work, but it wont so far. does the CommandSetUpgrade behavior even exist in regular Generals?
one soul at a time
Annihilationzh
13 years ago
you can't use newnightmare's code in generals. You have to use acidbrain's code.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Mobius-1
13 years ago
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.
:)
Rrtaya_tsamsiyu
13 years ago
thanks, ill check it out
one soul at a time
NewNightmare
13 years ago
Mobius-1 please read the whole thread b4 replaying 🙂
Annihilationzh
13 years ago
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.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Rrtaya_tsamsiyu
13 years ago
im doing this on a regular generals unit. and i dident find what you were talking about in the worker's INIs, mobius :/
one soul at a time
Mobius-1
13 years ago
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.....
Rrtaya_tsamsiyu
13 years ago

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.


lol, its ok
one soul at a time