Im trying to develop my first game and i was wondering if anyone could point me in the way for any of the following please, thanks very much.
-Skill gain
-Skill level requirements
-Skill item requirements
-Float layers
-Sturdy attacking system
-Magic/Ranged
I have looked through the demos but nothing seems to work. Im not trying to have everything handed to me either, i just wanted to see if anyone could help
ID:164471
Jun 2 2007, 8:56 pm
|
|
Jun 6 2007, 10:44 am
|
|
There is a demo called skillgain..... I heard it's really good. Oh and if you haven't even done ANYTHING on DM, Zilal's tutorial rocks!
|
flocSkill gain is simple: just set up a variable, and use it. What matters is what you do with that variable.
mob Now, as for the equipment system, and skill requirements, here's a basic way of doing it: mob "Basic" is relative. While we have long type paths now, things become a bit more organized. Everything that's an item can be picked up and dropped. Everything that's equipment can be equipped. Everything that's a weapon can also be equipped (but, more specifically, it becomes your weapon). Everything that's a sword requires sword skill (even if the requirement is 0). One thing I neglected, however, is not being able to drop equipped items. A pretty straightforward requirement, of course. But, because I use Move() in get() and drop(), we can make things a bit easier for us. Move() will call Exit(), Enter(), Exited(), and Entered(). Exit() and Enter() need to both return 1 before anything can move out or in. So, we can change mob/Exit() to prevent people from dropping their weapon: mob Or, alternatively, automatically unequip it: mob The more experienced of you will notice a problem right now: equip() is being used as a proc, but it has usr all over it. Because usr should not be used in procs, we have a conundrum. There are two simple solutions, though: 1) create seperate equipping/unequipping proc(s) 2) make equip() proc-friendly We'll go with 2. Because we know that the weapon has to be in usr (set src in usr) when using it as a verb, we know that the weapon's loc will always be the player, when being used as a verb. Similarly, because you can only equip weapons you have in your inventory, the loc of the weapon will also always be the player. So, we can use loc instead of player. However, because loc will be of type atom, we have to define a new variable of type mob, and set it equal to loc (and make sure it IS a mob, because it always SHOULD be) equip() Now, we have a bunch of information, but what we're lacking is an actual combat SYSTEM. What use is damage and attack speed without a way of using them? mob If you play World of Warcraft, the system is ripped from it. Click on a mob to start attacking it, move in range to actually hit it. And, of course, we need something to hit. So let's set up a couple monsters, as well as the player type. player Now, because I kept on making changes as I wrote this up, some of these blocks of code might be different from what my final version is. So, at the risk of a horde of kids copying-and-pasting it (which, I suppose, is better than the alternative of them copying-and-pasting something else, something else SINISTER), I'll just plop the whole thing down here: mob Now, I realize this isn't addressing all of your questions. However, working from what I've given you, there's a very easy way to make a ranged weapon (it involves changing the attackloop proc, as well as adding a range variable to weapons). Making a goblin that'll use a ranged weapon is trickier: the AILoop() is going to have to figure out what the goblin's using, and act accordingly. Finally, skill gain is the trickiest, because it's a vague idea. Best I can say is that you create a proc for weapons, swingweapon(). Then, it'll be overridden for swords and axes and maces. In there, it will possibly increase the skill. Then, call weapon.swing() in the attack() proc (after checking to make sure weapon isn't null, of course). Other issues is that the AI routine is a bit dull. They could take a step randomly when they don't see someone. However, best of all would be for them to completely freeze when nobody is looking. No point doing things when nobody is around to see it. However, this means that when a player moves around, they'll need to check for enemies nearby, and activate their AI routine. This is tricky, of course, and you shouldn't NEED to worry about it unless if you have a lot of monsters to worry about. [edit]Forgot to change obj/item/equipment/weapon/sword/equip() (and axe and mace) to not use usr. Fixed that. [edit2]Whoops! "locate(target)" should've just been "target." In addition, the call to attackloop() needed to be spawn()ed off. These kept the AILoop() from actually working. I fixed them. In addition, the AILoop() should've been spawned off (this was keeping goblins from getting weapons). Finally, Move(null) doesn't work. It should be loc = null. |