Link to part 1 Here!
Hey guys, it's been a while and we want to apologize for the delay on this. I have wanted to write this for a while but never had the time to sit down and do it. Today I closed my office door and told everyone to go away until it was finished, so here it is! Part 2: Scripting the hero.
This is the second step to any hero that we design internally and usually involves me since I know the ins and outs of the scripting system better than anyone else. We have to get a version of the hero working that matches the design so we can do internal 1v1/2v2 games to make sure nothing obvious breaks. We tweak it a bit and then push it to test client, but that is for the next blog.
This will be a more technical blog laying out a rough outline of our hero/mechanics system. It will also be much longer. I will put all pictures and examples of scripting in spoiler tags so you can just skip all of it if you want to.
So onto Drunken Master.
The first thing I do when starting on a hero is break down how it will work using our basic building blocks. These are projectiles, states, affectors, gagets, and modifiers. For people who don't know exactly what all of these are, here are the quick rundowns if you need them:
Now then, back to Drunken Master. The basics needed for this hero as laid out by DivA are: No mana regen, 10 per second degen, no manacost on items. Luckily removing all regen is easy since we have had to do this before for gadgets and abilities (Old Engineer Turret, for example). We just have to put this:
into his hero file and it turns all all regen for the hero. First bit solved easily. The 10 mana per second degen I debated at first if it should be in the hero's file or in a state on him based on the second ability. I ended up going with the hero file. So we ended up like this:
The final bit, items costing no mana, is something that we have never had to do before and thus will need new code added to support it. I will cover this more at the end.
The first ability, Drink, is a simple channel ability. Set up like any other (think Succ or NOMNOMDEVOURER) except instead of putting a state/disabling on someone else, you are putting one on yourself. This self-disable "ticks" every second like Succ's ult and gives him 25/50/75/100 mana based on the level. The natural degen in the hero file takes care of the rest.
The part of Drink that I needed to hook up still was him healing when it drained mana. To do this I put one of those modifiers in the Drink ability and then tweaked the mana drain in the hero's file. Together they work out to heal him when mana is taken away, but only after he has learned his second ability.
Lunge is the most complicated of all of the abilities since he has to do several things. Broken down, when he casts the ability it will bind him to a projectile (and put a state on him so he can't move or cast while he is in midair) that will zoom off towards the target. Once he gets there, it will deal an attack and then bind him to a new projectile that will orbit the target fully. While orbiting, he will still not be able to use any abilities other than Q and his target will be stunned. A modifier will be active while he is in this orbit. The modifier changes the Q into a different ability (think Bubbles shell) that will let him stop it at any time. Either ending the orbit or using the ability will push the target and deal another attack. Woo.
I hooked up the "lunge" part by copying predator's leap and heavily tweaking it to not deal damage or slow on impact, but instead spawn the second projectile and stun the target. So the impact of the lunging projectile ends up looking like this:
The circledisarm state is the "timer" for this spin, once it reaches 1.5 seconds, it hits its "impact" and goes off, doing the following:
This does the push and attack damage. The <attack /> command just does an auto attack from the source to the target, so this combined with a damage buff from the circledisarm state deals the damage of the ability. The modifier you see changes the Q ability into one that when you press it, it will unbind (stop spinning), deal an attack, push the unit, and finally get rid of the stun on the target and the disable on Drunken Master. This is what that looks like:
So that's Lunge in a nutshell. It works correctly for now but I know there will be bugs and issues as we move forward.
Stagger is, by comparison, a very basic projecile ability. When you use it, it spawns a projectile that just binds the hero and takes him 300 units forward, disjointing him in the process. The logic of the ability is quite simple:
Numb to Pain is something completely new for us and needs a bunch of code to get done. The only part of this that we can do right now is the slow resistance that Deadwood uses. To get the rest we need specific code. I take this request and the need for items to cost no mana and go over to our programmer DJ and let him know. I help him make sure he gets them down on his to-do list correctly and know they will be done in a few days, so until then Drunken Master is about as done as he will be from my end.
Oh, I almost forgot, the bonus you get on abilities when you have mana. That is done differently in checks For example, this is how it is done for the Stagger and Numb to Pain:
<onaction /> is called only once when you cast a spell, so it's a good place to do something you need to do only once at the start. Lunge works the same way generally, checking for the mana and then passing it through the projectiles that you have the mana, so apply the snare after.
That is Drunken Master scripted up and ready to go. He uses Panda's model at the moment so when DivA and Nome get around to it, I know they will add on better effects and temp models for testing. We will fill you in how our initial testing/bugfixes/iteration went and what we changed in the next blog. Also, test client time soon!
Last edited by Idejder; 06-27-2011 at 07:00 PM.
Thanks for continuing with the whole behind the scenes project.
First Page... first time ever!! yay. And sounds really cool. Very excited to see him in action!
Enjoyed the scripting. Not exactly what I would have expected or done, but then again I have never scripted anything like that at all. From the concept of the hero I expected it to be difficult (you not just on auto pilot scripting). I'd be severely interested in seeing PANDA use the moves. I thought that Panda's ultimate might be a starting point for the orbiting punch and that flurry would be heavily modified to function as the punch.
Pred's leap is getting modded EVERYWHERE! Like Parasite =].
I greatly enjoyed this dev blog and it brings a new respect for the difficulty involved (at least due to the odd nature of the hero versus previous ones). Can't wait for DJ's.