i like this a lot but im having a problem adding custom skills. I would add in a skill give it to player but I seem to not understand the whole Bind_key function. bind_key("q", abilities[1]) the 1 number? What is it linked to. how do I find the number for my own custom abilities I add to the game? Thanks
Hi, sorry if starting a new thread is inconvenient, but I feel like it's better than clogging up the general thread. Other people might have similar questions regarding bind_key and list/abilities, so separation is plus there too.
What you're seeing in /demo/mobs.dm is below new_character
// give the player some attacks
abilities += new /Ability/MeleeAttack()
abilities += new /Ability/Cleave()
abilities += new /Ability/Poison()
abilities += new /Ability/Fireball()
abilities += new /Ability/ShootArrow()
// and a crafting ability
abilities += new /CraftingAbility/MakeSword()
// Bind MeleeAttack and Cleave to the 1 and 2 keys.
// The on-screen ability bar will automatically be
// updated to show these key bindings.
bind_key("1", abilities[1])
bind_key("2", abilities[2])
// bind the crafting ability to 6.
bind_key("6", abilities[6])
First lets break apart bind_key(k, Ability/ability) and then I'll point out how he added the abilities to list/abilities.
bind_key("*/key you're binding to*/", abilities/*this is a list!*/[*/num/spot of ability you want to bind from list/abilities*/])
You can look in player-abilities.dm to find bind_key, and list/abilities = list() but first let me point out the order of the abilities += new. They take the order of 1-6, and after that, when you ability += new it will be 7, then 8, etc. So, if you're not giving the ability to a player at creation there, your custom ability will be abilities[7] and so on. I hope this helps.