Jump to content


Photo

adding spell book power to CAH debugging

cah spell book spellbook power createahero create a hero

  • Please log in to reply
7 replies to this topic

#1 platinumshadow

platinumshadow
  • Members
  • 38 posts

Posted 24 April 2014 - 10:45 PM

so my game won't crash on startup with this code, and i can select the power in character creation
but when i summon the CAH into the game, the game crashes. please help me fix this. ty
 
i used these 2 tutorials. 
 
adding spellbook power to a hero
 
adding a hero ability to CAH
http://www.the3rdage...item-15?addview adding a hero ability to CAH
 
//createaheroupgrades.inc - from scratch
Upgrade Upgrade_CaHSunFlare
Type = OBJECT
End
 
//createaheropowers.inc -first block from scratch using template of other powers
//the first block of code was enough to make the game not crash at startup
//middle block from system.ini
//the third block i copied most of it from the earthshaker power. i added it hoping that it wouldn't crash at all :(
//still crashes after i summon the CAH :(
Behavior = UnpauseSpecialPowerUpgrade ModuleTag_CAHSunFlareEnabler
SpecialPowerTemplate = SpecialAbilityCAHSunFlare
TriggeredBy = Upgrade_CaHSunFlare
End


Behavior = OCLSpecialPower ModuleTag_CAHSunFlare
SpecialPowerTemplate  = SpecialAbilityCAHSunFlare
OCL                   = OCL_SpecialPowerSunflare
CreateLocation        = CREATE_AT_LOCATION
AvailableAtStart   = Yes
AttributeModifierAffects = ANY +INFANTRY +CAVALRY +MONSTER -HERO ENEMIES
ReEnableAntiCategory = Yes
AttributeModifierWeatherBased = Yes 
WeatherDuration = SPELL_SUNFLARE_DURATION
ChangeWeather = SUNNY
End


Behavior = WeaponFireSpecialAbilityUpdate ModuleTag_CAHSunFlareEnablerUpdate
SpecialPowerTemplate    = SpecialAbilityCAHSunFlare
SpecialWeapon = SunflareWeapon
WhichSpecialWeapon = 3 ; Corresponds to SPECIAL_WEAPON_THREE
StartAbilityRange = 1.0
SkipContinue = Yes
UnpackTime = 2000 ; Trigger on frame 60 (of 100)
PackTime = 1333 ; Remaining 40 frames (of 100)
MustFinishAbility = Yes
End
 
//commandbutton.ini from commandbutton.ini
CommandButton Command_CAHSunFlare
Command = SPECIAL_POWER
    SpecialPower = SpecialAbilityCAHBookSunFlare
Options = NEED_TARGET_POS 
TextLabel = CONTROLBAR:Sunflare
    ButtonImage = SBGood_Sunflare
ButtonBorderType = ACTION
DescriptLabel = CONTROLBAR:TooltipSunflare
    RadiusCursorType = SunflareRadiusCursor
    CursorName = AttackObj
  InPalantir   = Yes


CreateAHeroUIAllowableUpgrades   = Upgrade_CreateAHero_ClassIstariWizard
CreateAHeroUIMinimumLevel   = 8
CreateAHeroUIPrerequisiteButtonName = None
CreateAHeroUICostIfSelected   = 1000


End
 
//createaherospecialpowers.ini from specialpower.ini (i removed two lines of code from original per tutorial instructions)
SpecialPower SpecialAbilityCAHSunFlare
Enum = SPECIAL_SPELL_BOOK_SUNFLARE
RadiusCursorRadius = SPELL_SUNFLARE_EFFECT_RADIUS
ReloadTime = 180000 ;SPELL_RECHARGE_TIME_TIER_4 ;// in milliseconds
ViewObjectDuration = SPELL_SUNFLARE_VIEW_OBJECT_DURATION
ViewObjectRange = SPELL_SUNFLARE_VIEW_OBJECT_RANGE
InitiateAtLocationSound = SpellSunflareMS
End

deleted lines from specialpower.ini

Flags = WATER_OK RESPECT_RECHARGE_TIME_DISCOUNT
RequiredSciences = SCIENCE_Sunflare

i'm 80% sure that the game is crashing because the code in createaheropowers.inc is incomplete/incorrect


Edited by platinumshadow, 25 April 2014 - 01:12 AM.


#2 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,438 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 24 April 2014 - 11:27 PM

Could you provide a link to that tutorial you followed?


T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#3 platinumshadow

platinumshadow
  • Members
  • 38 posts

Posted 25 April 2014 - 01:03 AM

i used these 2 tutorials. 
 
adding spellbook power to a hero
 
adding a hero ability to CAH
http://www.the3rdage...item-15?addview adding a hero ability to CAH
 
updated original post

Edited by platinumshadow, 28 April 2014 - 07:16 PM.


#4 platinumshadow

platinumshadow
  • Members
  • 38 posts

Posted 28 April 2014 - 07:15 PM

will someone help me please



#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 28 April 2014 - 10:23 PM

Try changing the specialpower enumerator, and are you sure that the:

AvailableAtStart = Yes

should be yes? If im not mistaken it should be No, because the CaH doesnt start with it enabled :p


Ridder Geel

#6 platinumshadow

platinumshadow
  • Members
  • 38 posts

Posted 29 April 2014 - 04:55 AM

Try changing the specialpower enumerator, and are you sure that the:

AvailableAtStart = Yes

should be yes? If im not mistaken it should be No, because the CaH doesnt start with it enabled :p

what would i change the enum to? i tried something like SPECIAL_CAH_SUN_FLARE and it crashed at startup

 

also i put it as the 5th power my hero has. however when he loads it's just blank. then the game crashes. there's no icon even though i selected the power


Edited by platinumshadow, 29 April 2014 - 05:02 AM.


#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 29 April 2014 - 04:24 PM

Choose an existing enumerator, that is not used for a spellbook power, which works similarly to what the sunflare does :p


Ridder Geel

#8 platinumshadow

platinumshadow
  • Members
  • 38 posts

Posted 01 May 2014 - 05:30 PM

still doesn't work lol. i give up lol. thx for your time






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users