Jun 15 2012, 1:51 pm
|
|
Your entire battle system errors out on me. keep getting like 18 errors, I even tried copy and paste instead of writing it out. And I still get those errors.
|
In response to Dokujin
|
|
Dokujin wrote:
Your entire battle system errors out on me. keep getting like 18 errors, I even tried copy and paste instead of writing it out. And I still get those errors. Did you indent it? |
In response to Dokujin
|
|
Could you specify what the errors are? It's difficult to debug code without knowing what's wrong.
|
is this the right way to make npc's attack? if not can you tell me what is it?
mob/Enemies Attack() flick("Attack",src) for(var/mob/M in get_step(src,src.dir)) var/Damage=max(0,src.Str-M.Def) view(M)<<"[src] hit [M] for [Damage] Damage!" M.TakeDamage(Damage,src) TakeDamage(var/Damage,var/mob/Attacker) src.HP-=Damage src.DeathCheck(Attacker) DeathCheck(var/mob/Killer) if(src.HP<=0) if(src.client) world<<"[Killer] Killed [src]!" src.HP=src.MaxHP src.loc=locate(5,5,1) else Killer<<"You Killed [src] for [src.Exp] Exp" Killer.Exp+=src.Exp Killer.LevelCheck() del src Red_Guy icon='spider zombie.dmi' Level=1 Exp=5 MaxHP=100 Str=10 Def=5 Green_Guy icon='rat zombie.dmi' Level=2 Exp=20 MaxHP=150 Str=20 Def=10 |
You have to use <dm></dm> tags to make the code appear correctly.
As for your question, there is no specific way to make NPCs attack. You have to decide how you want to do it. |
mob/Enemies |
In response to Ishtylercc
|
|
There's no usr in your CombatAI() proc, and oview()'s Center defaults to usr. Change it to oview(src).
And make sure your players are of the type /mob/player. |
im not a good coder at all so what would it be? this?
mob/Enemies |
In response to Ishtylercc
|
|
I didn't mean add usr to the proc, I meant to say that usr is null. Since oview() defaults to center around usr, it's building a list of nothing around nothing.
|
In response to Goodiesohhi
|
|
Goodiesohhi wrote:
how do I make good npcs like the ones who kill bad guys i have no idea but i wish i knew |
Falacy, what if you had a mob thats widespead across the maps. What if you wanted them to respawn back in the original place that they were supposed to respawn back to?
for instance Rogue NPC = 100 of them instead of having only one spawn point, how can you make it to where they all spawn in their original source locations they were put on the map? |
if(src!=killer) So something like this then? |
No. New() is called when something is created. You don't call it yourself. I recommend looking at the Guide and Reference and back off of the naruto rips.
|
TakeDamage(var/Damage,var/mob/Attacker) i get a damage error with this TakeDamage(var/Damage,var/mob/Attacker) can anyone help |
In response to Wildcanine
|
|
What error are you receiving?
|