Eastern Warrior – Day 6

In this post, I will write about:

  • Skill Effect
  • Damage
  • Character Stat


Skill Effect

For my case, I extended Projectile for all of my effects. By doing this, whether the skill effect is for sword or magic is not important already. Because, I can easily change the speed of the projectile and attach the effect skeletal mesh to it. In addition, it can have a lot of other function that a projectile object has. Although I don’t use much of them, but I found some quite handy, such as LifeSpan, Speed, InitProjectile( Vector Direction, Pawn MyInstigator), etc.



To cause the damage to collision actor, it’s quite easy. Just 2 lines of code:

simulated function ProcessTouch(Actor Other, Vector HitLocation, Vector HitNormal)



I guess that’s it. UDK supports quite well for these functions.


Character Stat

So in order to create the stat record for each character, I create a class called CharacterStat. It acts as a heart and stored inside the Pawn Object, for both Player and Bot.

Why I called it a heart? Cause I don’t want it to execute any active control function. The brain or the PlayerController will handle all the control. The heart will just passively beat, and beat until it dies.

In addition, by separating the CharacterStat object, I can use this actor to create several Archetypes to store the starting Stat of each enemy type, so it can be easily adjusted in UDK Editor.

I initially planned to reference the stat system of Diablo III. So my stat will start with 4 basic attributes: Strength, Dexterity, Intelligence and Vitality. Quite classic though.

Here the video:

You can see I already done a basic AI to follow the player, I will improve it and explain more in the next post 😀