Jump to content


Photo

Coding: add many heroes on a structure


  • Please log in to reply
13 replies to this topic

#1 Mako

Mako
  • Members
  • 77 posts

Posted 02 May 2016 - 11:37 AM

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


Edited by Xan Mako, 02 May 2016 - 01:17 PM.


#2 Mako

Mako
  • Members
  • 77 posts

Posted 02 May 2016 - 03:34 PM

Or just tell me how add an hero to a barrak :sad2:



#3 Mako

Mako
  • Members
  • 77 posts

Posted 03 May 2016 - 10:32 AM

I made a simple commandset 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
 
I'm following this topic http://forums.revora...o-the-barracks/ that is very usefull. It is the base of what i want to do.


#4 Mako

Mako
  • Members
  • 77 posts

Posted 08 May 2016 - 01:45 PM

Bump



#5 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 24 May 2016 - 11:59 PM

I am a bit rusty ..so I can't quote exact code script .
The castles and Citadels are really the only structure you should add a hero to .
Instead of 20 , just try adding ONE ; in playertemplate.ini in your mod files .
Then increase until you can't .
20 is TOO MUCH ...I know a limit can be reached .
There are also issues with re-build , some heroes do not show up .

If you want 20 heroes , code them as single units by removing their respawn module and giving them single unit health modules
Duplicate and Rename them like AragornHeroSingleUnit to not clash with the normal code .
Give them Experience codes for leveling .
Check a Troll or berserker for reference .
Then add the code to limit the number to 1 (max simultaneous type )
Then you can add them to the Baracks etc

#6 Mako

Mako
  • Members
  • 77 posts

Posted 27 May 2016 - 10:21 AM

Ok this can work but is a huge work for a simple thing. I'm not interested at respawn.
I just wanna add heros, at command set.
 
Limit of spot are 32 as i know so 20 isnt' so huge if i don't use respawn
 
And btw i have some proble only change dwarvenpadside


Edited by Xan Mako, 27 May 2016 - 10:27 AM.


#7 Mako

Mako
  • Members
  • 77 posts

Posted 30 May 2016 - 09:28 AM

Ok now something is working...
But i can't recruit. I mean when i press on button it doens't do anything

Untitled.jpg
 
My code:
 

Spoiler

 

 

@Pasidon i will credit cause i use your map.ini <3



#8 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 30 May 2016 - 02:34 PM

Hero list doesn't work properly in map.ini ( i know from my own experience)


2qm3dd5.jpg


#9 Mako

Mako
  • Members
  • 77 posts

Posted 31 May 2016 - 03:47 PM

I can't believe on what you said :C I NEEEEEEEED IT!



#10 Mako

Mako
  • Members
  • 77 posts

Posted 01 June 2016 - 08:39 PM

Maybe solved: a problem was that padside aren't a structure where you can recruit units. I use tower and for some heroes work.. now i will make some test but essentially i don't have to use padside (or if i use them i have to fix but is a bit boring). :) thanks to all



#11 Mako

Mako
  • Members
  • 77 posts

Posted 03 June 2016 - 11:30 PM

I had this error :C

 

IDK seems that he didn't get GenericReviveSlot14..

 

Here my code:

 

Spoiler

Attached Thumbnails

  • Untitled.jpg


#12 Kwen

Kwen

    Vileartist

  • T3A Staff
  • 4,865 posts
  • Location:Korea I wish
  • Projects:It'sa secreeet
  •  T3A's First N00b
  • Division:BFME
  • Job:T3A Expert
  • Donated

Posted 04 June 2016 - 03:15 PM

Does that command exist in commandbutton?

                           https://www.twitch.tv/vileartist - Yes shameless self-promotion

          ----------------------------------------------------------------------------------------------------------------------

                            "Old modders never die, they just fade away" ~ Hostile


#13 Mako

Mako
  • Members
  • 77 posts

Posted 04 June 2016 - 06:38 PM

CommandButton Command_GenericReviveSlot14
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_GenericReviveSlot15
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

 

No.. I added at bottom of map.ini. Not sure that works :C

 

And still remain the problem that i see only 12 commandbutton


Edited by Xan Mako, 04 June 2016 - 06:39 PM.


#14 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 04 July 2016 - 02:58 PM

see if they appear when removing the hide-while-disabled option :p


Ridder Geel




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users