ID:177877
 
I already have one madebut it is a cheap piece of crap. You can't change your enemy's attack or defense or the gold or exp you get. So does anyone have a good battle system I could use. One that is both simple to use and understand and highly flexible.

Thanks
Codesterz wrote:
I already have one madebut it is a cheap piece of crap. You can't change your enemy's attack or defense or the gold or exp you get. So does anyone have a good battle system I could use. One that is both simple to use and understand and highly flexible.

It sounds to me like those should be simple vars to change. A battle system that isn't even that flexible is indeed a piece of crap.
Perhaps you could show us the code for your existing system and we could help you improve on it.

Lummox JR
In response to Lummox JR
Here the system is. There are a couple of errors in it but good luck.






mob/monster/slime
icon = 'monsters.dmi'
icon_state = "slime"
health = 25
maxhealth = 25

var/mob/characters/P

New()
.=..()
spawn(10)
Wander(10)

proc/Wander()
while(src)
if (P in oview(5))
step_towards(src,P)
else
step_rand(src)
for(P in view(src))
break
sleep(5)
spawn(40)
Wander()

Bump(mob/M)
if (istype(M,/mob/characters))
NPCAttack(M)
proc/NPCAttack(mob/M)


mob/monster
Move(atom/newloc)
if(!newloc) return ..() // Move(null)
if(!loc) return ..() // Move from null
if(newloc.type!=loc.type)
return 0 // don't move to any other kind of turf
return ..()


mob/monster/skull
icon = 'monsters.dmi'
icon_state = "skulls"
health = 50
maxhealth = 50

var/mob/characters/P

New()
.=..()
spawn(20)
Wander(20)

proc/Wander()
while(src)
if (P in oview(5))
step_towards(src,P)
else
step_rand(src)
for(P in view(src))
break
sleep(5)
spawn(20)
Wander()

Bump(mob/M)
if (istype(M,/mob/characters))
NPCAttack(M)
proc/NPCAttack(mob/M)
In response to Codesterz
You didn't actually show the NPCAttack() proc--just the first line of it. That's the key one to change here.

I'm curious what code base you started off with. This isn't the first time I've seen this particular wander-and-attack setup, and I have to say I'm not very impressed with it. The author split up the attack procs in a very weird way.

Lummox JR
In response to Lummox JR
It came with RPG enlightment. It's not the best but it's usefull.
In response to Codesterz
its actually from my demo, he implemented it into his. I dont know why he copied it lol

RaeKwon
In response to RaeKwon
Yes this [expletive deleted] chat is good and all but does anyone have a code for me please!!!
In response to Codesterz
Please avoid using foul language on these forums.
In response to Codesterz
For acquiring a key a little more than a week ago, you're expecting much and expressing little appreciation. Instead of impatiently requesting a battle system code,

- Try using the advanced search to find matches for "battle system" or the like, to see how others put together their own code.

- Examine the battle system demos in the developer's hub. You may find a better example to match what you are looking for. Not everyone has the same technique (at least I would certainly hope not).

- If you haven't coded before, show the forum regulars that you're willing to learn from their examples. As a beginner/novice (this is being optimistic), they have helped me quite a bit by reviewing/adjusting code and translating some of DM's help topics.

- Last but certainly not least, buy the Blue Book! =D

I would offer help with your code, however I'm using the "mob in oview(1) attack verb" until I can plot out exactly what i'd like to see in my battle system.

Best of luck,
Matic293
In response to Codesterz
this entire set of posts was extremely foul and rude.

I would have never replied when he wrote: HURRY UP!!!!

and moderator, I would have at least given the boy a warning.

Codesterz, don't expect to get very far in BYOND being incredibly rude: Look where it got me! :P
In response to Codesterz
Did I swear? I don't remember swearing! well uhh sorry!
In response to Matic293
I'd recommend using "get_step(src,src.dir)" instead of mob in oview(1). That way it will automatically attack whatever mobs are in the square you are facing, and you won't be troubled by annoying popup windows asking you to select a target in the heat of combat.