Jump to content


Photo

Question about "Converting a Normal Hero Power to a CaH Special Power"


Best Answer Ridder Geel, 25 January 2015 - 03:25 PM

Ghehe, well you also need to create a specialpower ;) (createaherospecialpowers.ini)

//------------------------------------------------------------------------------
SpecialPower SpecialAbilityCreateAHeroHawkStrike_Level1
    Enum         = SPECIAL_AT_VISIBLE_OBJECT
    ReloadTime     = 45000
    PublicTimer     = No
;;    ObjectFilter = CRIPPLE_STRIKE_OBJECT_FILTER
End

And then in the specialpower things change

SpecialAbilityCreateAHeroCrippleStrikeRanged_Level1

to

SpecialAbilityCreateAHeroHawkStrike_Level1

 

Obviously you also need to edit the lotr.str thing to add strings eh ;)

Go to the full post


  • Please log in to reply
16 replies to this topic

#1 Chubby

Chubby
  • Members
  • 10 posts

Posted 21 January 2015 - 07:20 PM

Hello everyone :crazed:

I've been playing BFME2 & RotWK for a long time, but only two months ago i started using mods (currently using RJ mod, it rocks) and right now i've been reading some tutorials related with codding etc. The one i've been applying mostly was the Solinx guide about: Converting a Normal Hero Power into a CaH Special Power. The guide is awesome and i managed to create 2 new leadership upgrades for my CaH system, but right now i'm trying to create new powers like Legolas Hawk Strike and since i'm still a beginner when it comes to code, i'm stuck on the createaheropowers.inc.

 

On his example of the tutorial he changed ModuleTag, SpecialPowerTemplate and the TriggeredBy values:

;;; PASSIVE OUTLAW LEADERSHIP;;;
	Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CaHOutlawLeadershipEnabler
		SpecialPowerTemplate = SpecialAbilityCaHFakeLeadership2
		TriggeredBy = Upgrade_CaHOutlawLeader
	End
	Behavior = SpecialPowerModule ModuleTag_CaHOutlawLeadershipUpdate
		SpecialPowerTemplate	  = SpecialAbilityCaHFakeLeadership2
		UpdateModuleStartsAttack  = No
		StartsPaused = Yes
	End	
	Behavior = AttributeModifierAuraUpdate ModuleTag_CaHOutlawLeadership
		StartsActive	= No;If no, requires upgrade to turn on.
		BonusName		= EomerPassiveOutlawLeadership
		TriggeredBy		= Upgrade_CaHOutlawLeader
		RefreshDelay	= 2000
		Range			= 200
		AllowSelf		= Yes
		ObjectFilter	= ANY +CAVALRY +INFANTRY -STRUCTURE -BASE_FOUNDATION -DOZER
	End

But the Legolas one doesn't have the TriggeredBy and on top of that the spell works with SpecialWeapon, which he said on his tutorials that requires some more editing. Could someone give me some guidance? :smile2ap:

 

For starters that's my main problem, i think if i get it right once i won't be bothering you guys with this again! :wink_new:

 

Thanks in advance, cheers,

Chubby.



#2 Chubby

Chubby
  • Members
  • 10 posts

Posted 23 January 2015 - 02:03 PM

Bump



#3 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 24 January 2015 - 12:05 PM

Well what have you tried, if anything?

It is practically the same as looking at any other specialweapon power thing, and using that as base instead of the leadership :p


Ridder Geel

#4 Chubby

Chubby
  • Members
  • 10 posts

Posted 24 January 2015 - 04:36 PM

I tried converting Hawk Strike from Legolas to a CaH special power, but like i said it doesn't have TriggeredBy so i can't go to the next step which is adding the code in createaheroupgrades.inc on Solinx tutorial. I'm really a noob when it comes to codding, but if you could guide me with one example like Hawk Strike (for example) i would be really appreciated.



#5 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 25 January 2015 - 12:22 PM

Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroHawkStrikeEnabler_Level1
    SpecialPowerTemplate = SpecialAbilityCreateAHeroCrippleStrikeRanged_Level1
    TriggeredBy             = Upgrade_CreateAHeroCrippleStrikeRanged_Level1
End

Behavior = SpecialPowerModule ModuleTag_CreateAHeroHawkStrikeStarter_Level1
    SpecialPowerTemplate     = SpecialAbilityCreateAHeroCrippleStrikeRanged_Level1
    UpdateModuleStartsAttack = Yes
    StartsPaused             = Yes
//    InitiateSound             = LegolasVoiceModeHawkStrike
End
Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_CreateAHeroHawkStrikeRangedUpdate_Level1
    SpecialPowerTemplate = SpecialAbilityCreateAHeroHawkStrike_Level1
    SkipContinue         = Yes

    UnpackTime             = 1500    //Pull out arrow
    PackTime             = 1000    //back to idle
    BusyForDuration                = 1000    
    
    AwardXPForTriggering = 0    
    StartAbilityRange     = 400.0
    ApproachRequiresLOS            = Yes
    
    SpecialWeapon         = LegolasHawkStrike
    WhichSpecialWeapon     = 4
End
 

 

You will need to make a button similar to the cripple strike (ranged) ability, and that should work.


Ridder Geel

#6 Chubby

Chubby
  • Members
  • 10 posts

Posted 25 January 2015 - 02:03 PM

I was able to create the power! I made a hero, choosed the spell and when i was about to leave the CaH system into the main menu to test it on a skirmish, the game stops working and needs to shut down. Maybe i screwed up some step, enlighten me:

 

createaheropowers.inc

//--------------------------------------------------------------------------    
// CaH HAWK STRIKE
//--------------------------------------------------------------------------   
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CreateAHeroHawkStrikeEnabler_Level1
    SpecialPowerTemplate = SpecialAbilityCreateAHeroCrippleStrikeRanged_Level1
    TriggeredBy             = Upgrade_CreateAHeroCrippleStrikeRanged_Level1
End

Behavior = SpecialPowerModule ModuleTag_CreateAHeroHawkStrikeStarter_Level1
    SpecialPowerTemplate     = SpecialAbilityCreateAHeroCrippleStrikeRanged_Level1
    UpdateModuleStartsAttack = Yes
    StartsPaused             = Yes
//    InitiateSound             = LegolasVoiceModeHawkStrike
End
Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_CreateAHeroHawkStrikeRangedUpdate_Level1
    SpecialPowerTemplate = SpecialAbilityCreateAHeroHawkStrike_Level1
    SkipContinue         = Yes

    UnpackTime             = 1500    //Pull out arrow
    PackTime             = 1000    //back to idle
    BusyForDuration                = 1000    
    
    AwardXPForTriggering = 0    
    StartAbilityRange     = 400.0
    ApproachRequiresLOS            = Yes
    
    SpecialWeapon         = LegolasHawkStrike
    WhichSpecialWeapon     = 4
End

CommandButton.ini

;-------------------------------------------------------------------------
CommandButton Command_CreateAHero_HotW_CaHLegolasHawkStrike_Summoned
    Command                = SPECIAL_POWER
    SpecialPower            = SpecialAbilityCreateAHeroCrippleStrikeRanged_Level1
    Options                = UNMOUNTED_ONLY NEED_TARGET_ENEMY_OBJECT
    TextLabel            = CONTROLBAR:CreateAHeroHawkStrike
    ButtonImage            = HSLegolasHawkStrike
    CursorName            = Bombard
    InvalidCursorName        = GenericInvalid
    ButtonBorderType        = ACTION
    DescriptLabel            = CONTROLBAR:ToolTipCreateAHeroHawkStrike
    InPalantir            = Yes
    AutoAbility            = Yes
    ;UnitSpecificSound        = LegolasVoiceModeHawkStrike
    DisableOnModelCondition     = WEAPONLOCK_SECONDARY

    CreateAHeroUIAllowableUpgrades        = Upgrade_CreateAHero_ClassArcher
    CreateAHeroUIMinimumLevel            = 1
    CreateAHeroUIPrerequisiteButtonName    = None
    CreateAHeroUICostIfSelected = 400
End

What do you think?

Btw, thanks for your patience, i owe you.

 

(Edit: I FORGOT SOMETHING! When i go into the CaH system the name of the power,  it's description and command name is missing. Ex: "MISSING: 'CaH:Command_CreateAHero_HotW_CaHLegolasHawkStrike_Summoned_Name')


Edited by Chubby, 25 January 2015 - 02:20 PM.


#7 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 25 January 2015 - 03:25 PM   Best Answer

Ghehe, well you also need to create a specialpower ;) (createaherospecialpowers.ini)

//------------------------------------------------------------------------------
SpecialPower SpecialAbilityCreateAHeroHawkStrike_Level1
    Enum         = SPECIAL_AT_VISIBLE_OBJECT
    ReloadTime     = 45000
    PublicTimer     = No
;;    ObjectFilter = CRIPPLE_STRIKE_OBJECT_FILTER
End

And then in the specialpower things change

SpecialAbilityCreateAHeroCrippleStrikeRanged_Level1

to

SpecialAbilityCreateAHeroHawkStrike_Level1

 

Obviously you also need to edit the lotr.str thing to add strings eh ;)


Edited by Ridder Geel, 25 January 2015 - 03:26 PM.

Ridder Geel

#8 Chubby

Chubby
  • Members
  • 10 posts

Posted 26 January 2015 - 02:06 AM

You sir...are a genious, a life saver and a formidable teacher. Everything is working perfectly.

I learned a lot and the add strings extra was the cherry on the top.

 

Thank you so, so, so much.

Regards and love,

Chubby.



#9 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 26 January 2015 - 01:21 PM

No problem, feel free to ask more questions in the forums if you get stuck :D


Ridder Geel

#10 Chubby

Chubby
  • Members
  • 10 posts

Posted 26 January 2015 - 04:05 PM

Ridder, sorry one last question :p

I remember something i tried once, converting a spell book into a CaH special power. I tried out with Stampede and everything was working smooth, i managed to create the power then i made a hero, choosed the spell and went into a skirmish and what happen was that i couldn't cast it anywhere, i got a print, check this out:

 

http://s21.postimg.o.../Sem_T_tulo.png

 

I assume it's something related with createaheropower.inc:

//--------------------------------------------------------------------------    
// CaH STAMPEDE
//--------------------------------------------------------------------------
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_StampedeUnpause
     SpecialPowerTemplate                = Stampede
     TriggeredBy                         = Upgrade_Stampede
End

Behavior = OCLSpecialPower ModuleTag_OCLStampede
    SpecialPowerTemplate 		= Stampede
    OCL					= OCL_RohanStampedeSummoning
    CreateLocation			= CREATE_AT_LOCATION
    StartsPaused                    	= Yes
End

If not...createaherospecialpower.ini:

//------------------------------------------------------------------------------
SpecialPower Stampede
	Enum			= SPECIAL_SPELL_BOOK_FLOOD
	RadiusCursorRadius	= 175
	ReloadTime		= 180000 ; in milliseconds
	ViewObjectDuration 	= 10000
	ViewObjectRange	 	= 200
;	InitiateAtLocationSound	= SpellFloodMS

End

and commandbutton.ini (made it level 1 for test purposes):

;-------------------------------------------------------------------------
CommandButton Command_CreateAHero_HotW_Stampede 
    Command			= SPELL_BOOK
    SpecialPower		= Stampede
    Options			= NEED_TARGET_POS 
    TextLabel			= CONTROLBAR:CreateAHeroStampede
    ButtonImage			= ASRohanStampedeButton
    ButtonBorderType		= ACTION
    DescriptLabel		= CONTROLBAR:CreateAHeroTooltipStampede
    RadiusCursorType		= FloodRadiusCursor
    CursorName			= AttackObj
    InvalidCursorName		= GenericInvalid
    InPalantir   		= Yes

    CreateAHeroUIAllowableUpgrades        = Upgrade_CreateAHero_ClassHeroOfTheWest
    CreateAHeroUIMinimumLevel            = 1
    CreateAHeroUIPrerequisiteButtonName    = None
    CreateAHeroUICostIfSelected = 1000
End

What you think?



#11 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 26 January 2015 - 06:59 PM

The enum can't be SPECIAL_SPELL_BOOK_FLOOD.

Make it the same as some other summon spell's enum, which is not used in the spell book (Isn't there one in the CaH?) :p


Ridder Geel

#12 -SilverBane-

-SilverBane-

    Inactive Noob

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

Posted 27 January 2015 - 06:47 PM

The commandbutton Command cant be SPELL_BOOK. It must be SPECIAL_POWER.


2qm3dd5.jpg


#13 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 27 January 2015 - 07:29 PM

Oh wow I overlooked that one as well :p So yes what he said, and possibly what i said :p


Ridder Geel

#14 Chubby

Chubby
  • Members
  • 10 posts

Posted 31 January 2015 - 02:02 PM

Worked like a charm, once again thanks!

 

I had another idea of doing something else, since it's still under this topic theme i decided to put it here (hope i'm not going against any forum rule or something :p

 

I've been reading the lore and i wanted to make Poisoned Javelins for my custom heroe Eol the Dark Elf, so, my idea was to use Throw Spear from CaH Special Power (or Eomer's Throw Spear) and add the poison effect and damage after the spear landed, sort of like how Wormtongue's "Backstab" ability works.

 

So, if it's not that complicated where should i start? :wink_new:



#15 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 31 January 2015 - 02:34 PM

Its simply changing weapons and the damage they do:

http://www.the3rdage...tem-282?addview

Damage over time nugget is what you want to look into ;)


Ridder Geel

#16 Chubby

Chubby
  • Members
  • 10 posts

Posted 02 February 2015 - 12:58 AM

Once again, worked perfectly, managed to create a spell that combines Spear Throw with the Poison Attack DoT Nugget, really cool. Thanks a lot.

 

Btw, right now i'm reading a tutorial about how Mount/Dismount works (http://www.the3rdage...?apage=313#page) in order to add it to Corrupted Man, Elves and maybe Servants of Sauron, but would be really sweet if their mount could be a warg or a wolf.

 

Also, I've been reading some Special Power tutorials, but still got no clue how could i be able to add Toogle Weapon to Heroes of the West and Servants of Sauron classes, do you know any tutorial/guide related with this matter?


Edited by Chubby, 03 February 2015 - 07:42 PM.


#17 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 02 February 2015 - 06:08 PM

There aren't really tutorials on that, its more or less something you figure out how to do after modding several powers and looking at a toggle from another unit.


Ridder Geel




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users