Modding Union

[en] - Modding Corner => Coding => Thema gestartet von: Mako am 9. Mai 2016, 13:46

Titel: Coding: add many heroes on a structure
Beitrag von: Mako am 9. Mai 2016, 13:46
Hi guys. I'm new on coding and i have some trouble on this thing. I wanna add at least 20 heroes on structure.

The structure is DwarvenFortressExpansion PadSideCommandSet (the expansion near the fortress where you build some stuff):

CommandSet DwarvenFortressExpansionPadCornerCommandSet
   1  = Command_ConstructDwarvenCatapultExpansion
   2  = Command_ConstructDwarvenEreborTowerTowerExpansion
   3  = Command_ConstructDwarvenHallExpansion
   4  = Command_ConstructDwarvenWallHubExpansion
End

So i think i have to:

CommandSet DwarvenFortressExpansionPadCornerCommandSet
    InitialVisible = 20
 
    1 = Command_GenericReviveSlot1
    2 = Command_GenericReviveSlot2
    ...
    20 = Command_GenericReviveSlot20
End
 

PlayerTemplate FactionDwarves
 
   BuildableHeroesMP = CreateAHero DwarvenCaptainofDale DwarvenGloin DwarvenGimli DwarvenDain RohanFrodo RohanEowyn RohanEomer GondorBoromir
   BuildableRingHeroesMP = ElvenGaladriel_RingHero
 
End

CommandButton Command_GenericReviveSlot1
Command = REVIVE
Options = HIDE_WHILE_DISABLED CANCELABLE ;Hides button while disabled.
TextLabel = CONTROLBAR:GenericReviveHero
;ButtonImage = ***Filled in automatically! No need to specify a button image.
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipGenericReviveHero
InPalantir = No
Radial = Yes
End
 
CommandButton Command_GenericReviveSlot2
Command = REVIVE
Options = HIDE_WHILE_DISABLED CANCELABLE ;Hides button while disabled.
TextLabel = CONTROLBAR:GenericReviveHero
;ButtonImage = ***Filled in automatically! No need to specify a button image.
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipGenericReviveHero
InPalantir = No
Radial = Yes
End

...

CommandButton Command_GenericReviveSlot13 ;and then i copied unitl 20th
Command = REVIVE
Options = HIDE_WHILE_DISABLED CANCELABLE ;Hides button while disabled.
TextLabel = CONTROLBAR:GenericReviveHero
;ButtonImage = ***Filled in automatically! No need to specify a button image.
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipGenericReviveHero
InPalantir = No
Radial = Yes
End
 
CommandButton Command_RingHeroReviveSlot
Command = REVIVE
Options = HIDE_WHILE_DISABLED CANCELABLE NEED_UPGRADE ;Hides button while disabled.
NeededUpgrade = Upgrade_RingHero Upgrade_FortressRingHero
TextLabel = CONTROLBAR:GenericReviveHero
;ButtonImage = ***Filled in automatically! No need to specify a button image.
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipGenericReviveHero
InPalantir = No
Radial = Yes
End
 
CommandButton Command_CreateAHeroReviveSlot
Command = REVIVE
Options = HIDE_WHILE_DISABLED CANCELABLE NEED_UPGRADE ;Hides button while disabled.
NeededUpgrade = Upgrade_AllowBuildCreateAHero
TextLabel = CONTROLBAR:GenericReviveHero
;ButtonImage = ***Filled in automatically! No need to specify a button image.
ButtonBorderType = BUILD
DescriptLabel = CONTROLBAR:ToolTipGenericReviveHero
InPalantir = No
Radial = Yes
End
But it doens't work. So i tried a simply code to change only fortresspad as this to see how ini works

CommandSet DwarvenFortressExpansionPadSideCommandSet
1  = Command_ConstructDwarvenWallHubExpansion
2 = Command_ConstructDwarvenWallHubExpansion
3  = Command_ConstructDwarvenWallHubExpansion
4  = Command_ConstructDwarvenWallHubExpansion
End

But when i start game Pad of Dwraf's fortress and single pad object still remain as this

CommandSet DwarvenFortressExpansionPadSideCommandSet
1  = Command_ConstructDwarvenCatapultExpansion
2 = Command_ConstructDwarvenEreborTowerTowerExpansion
3  = Command_ConstructDwarvenHallExpansion
4  = Command_ConstructDwarvenWallHubExpansion
End

Any ideas?
Titel: Re: Coding: add many heroes on a structure
Beitrag von: Mako am 9. Mai 2016, 15:26
Sry i wrong main topic. i got de :)
Titel: Re: Coding: add many heroes on a structure
Beitrag von: Mako am 30. Mai 2016, 17:24
Now my work is going


Ok now something is working...
But i can't recruit. I mean when i press on button it doens't do anything
 
My code:
 
Titel: Re: Coding: add many heroes on a structure
Beitrag von: FG15 am 30. Mai 2016, 17:28
I guess your object does not have a QueueProductionExitUpdat e or a ProductionUpdate.
Try adding those, such that the object can produce things.
Titel: Re: Coding: add many heroes on a structure
Beitrag von: Mako am 31. Mai 2016, 20:09
ooooo fine. An answer  :D

Tbh the problem isn't spawning but it doesn't start to recruit. Spawning maybe is later [uglybunti]
Do you know the timer when you purchase a unit/hero/upgrade?
Titel: Re: Coding: add many heroes on a structure
Beitrag von: Mako am 1. Jun 2016, 18:04
ok you are right.. i think padside hasn't this funciont. i tried with a tower and all worked.


So big thanks to you mate :)
Titel: Re: Coding: add many heroes on a structure
Beitrag von: Mako am 4. Jun 2016, 01:33
I had an error.

IDK seems that he didn't get GenericReviveSlot14..

And my Tower let me see only 12 Revive slot (but when i recruit an hero the other appears)

Here my code: