HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 [2]

Author Topic: IsInCombat Flag for E_CommonCharacter  (Read 5265 times)

Arlohian

  • General Accounts
  • *
  • Posts: 43
    • View Profile
Re: IsInCombat Flag for E_CommonCharacter
« Reply #15 on: Feb 29, 12, 07:08:59 PM »

Great and greatily confusing tutorial :P The confusion sure helped me learn more about the script language (no sarcasm, really, would like more tutorials like this because you learn so much more this way, instead of just copying code), thanks!

I managed to adapt it quite well to my own needs, not bad for my first hour with scripting in hero engine i say :D

Now whenever i use W_InCombat = true after using an ability, my regen is swapped for another for a set time. Just like vanilla version of the game that must not be mentioned, just like we all secretly want it!
Code: [Select]
method E_regenTimer_tick()
  if me.IsDead()
    return
  .
  if me.IsInCombat()
    return
  .
  if me.W_InCombat = true
    me.E_hitPoints = MiscUtils:Min( me.E_hitPoints + 1, 100 )
    me.W_manaPoints = MiscUtils:Min( me.W_manaPoints + 3, 100 )
    me.SetCombat()
   
  else
    me.E_hitPoints = MiscUtils:Min( me.E_hitPoints + 20, 100 )
    me.W_manaPoints = MiscUtils:Min( me.W_manaPoints + 20, 100 )
  .
.

method SetCombat()
  me.W_CombatTimer.initializeDefault()
  me.W_CombatTimer.fireRate = 00:00:7 //Time before normal regen kicks in
  me.W_CombatTimer.start()
.

method W_CombatTimer_tick()
    me.W_InCombat = false
    me.W_CombatTimer.stop() //No point having it count any further
.
Logged
Fledgling programmer

Zasdman

  • General Accounts
  • *
  • Posts: 5
    • View Profile
Re: IsInCombat Flag for E_CommonCharacter
« Reply #16 on: Apr 14, 12, 12:13:57 AM »

Thank you for This!
Logged

Eagleheart

  • General Accounts
  • *
  • Posts: 27
    • View Profile
Re: IsInCombat Flag for E_CommonCharacter
« Reply #17 on: Feb 26, 14, 10:39:14 PM »

ok i have tried both versions of this the OP version and the one 2 posts up and i am either missing something so stupid that i will kick my self.

so anyways i have the

E_inCombat setup in my E_CommonCharacter Dom as a field to simplify passing the info from the abilities script into the commoncharacter script.

also added the combat timer as a field like the regen timer.

but when i run the script i don't get a delay of the regen it just continues along as tho nothing is happening so i must have missed a hook someplace so anyone able to throw me a bone .

Thanks for any responses
Logged

nocake

  • General Accounts
  • *
  • Posts: 404
    • View Profile
    • BlightMMO
Re: IsInCombat Flag for E_CommonCharacter
« Reply #18 on: Apr 02, 14, 04:49:23 PM »

ok i have tried both versions of this the OP version and the one 2 posts up and i am either missing something so stupid that i will kick my self.

so anyways i have the

E_inCombat setup in my E_CommonCharacter Dom as a field to simplify passing the info from the abilities script into the commoncharacter script.

also added the combat timer as a field like the regen timer.

but when i run the script i don't get a delay of the regen it just continues along as tho nothing is happening so i must have missed a hook someplace so anyone able to throw me a bone .

Thanks for any responses

Definitely need to see some code to help you if you haven't already figured it out.
Pages: 1 [2]