ya I did that, now when i compile ( i moved a few lines) it says
    walk_rand(src,10)//walk randomly with 5 lag

for(var/mob/M in hearers(6))//Check for players

those r the two lines cuasing the error...
newwalking.dm:10:error: inconsistent indentation
newwalking.dm:12:error: bad argument definition
mob/proc/ai_check()
for(var/mob/M in hearers(6))
if(M.NPC && !M.NpcActive)
var/playercheck = 0
M.NpcActive = 1
M.ai_random_wander()

mob/proc/ai_random_wander()
while(NpcActive)
walk_rand(src,10)//walk randomly with 5 lag

for(var/mob/M in hearers(6))//Check for players
if(M.client)
playercheck = 1
if(!playercheck)
NpcActive = 0

thats the full code if u need it
Ah I see the stuff under the while (NpcActive) needs to be indented one more time so they are actually inside the while loop.
I tried that before, it was still giving me an error
mob/proc/ai_random_wander()
while(NpcActive)
walk_rand(src,10)//walk randomly with 5 lag

for(var/mob/M in hearers(6))//Check for players
if(M.client)
playercheck = 1
if(!playercheck)
NpcActive = 0

newwalking.dm:10:error: inconsistent indentation
newwalking.dm:12:error: bad argument definition
newwalking.dm:13:error: inconsistent indentation
newwalking.dm:15:error: inconsistent indentation
mob/proc/ai_random_wander()
while(NpcActive)
walk_rand(src,10)//walk randomly with 5 lag

for(var/mob/M in hearers(6))//Check for players
if(M.client)
playercheck = 1
if(!playercheck)
NpcActive = 0

with this i have only 2 errors but it is
newwalking.dm:10:error: inconsistent indentation
newwalking.dm:12:error: bad argument definition
For your mob's and objs are you doing them in other places as:

mob
proc
AlphabetSoup()


Or are they all the same in regards to being set up:

mob/proc/ai_random_wander()


Because that is what normally causes it that you use one in one area, and then switch to the other which then confuses the compiler.
im doing it as...
mob
proc
AlphabetSoup()

hmm ya i think mostly like that maybe only one (doubt it) like the other example
if I change the code to the
mob
proc
ai_random_wander()

itll make it hard, to indent the others ones cuz im not sure how many indents to make cuz it would be changed and all over the place an u help with that part?
mob
proc
ai_random_wander()
while(NpcActive)
walk_rand(src,10)//walk randomly with 5 lag

for(var/mob/M in hearers(6))//Check for players
if(M.client)
playercheck = 1
if(!playercheck)
NpcActive = 0

this is what i got..
newwalking.dm:11:error: inconsistent indentation
newwalking.dm:12:error: inconsistent indentation
newwalking.dm:14:error: bad argument definition
mob
proc
ai_random_wander()
while(NpcActive)
walk_rand(src,10)//walk randomly with 5 lag

for(var/mob/M in hearers(6))//Check for players
if(M.client)
playercheck = 1
if(!playercheck)
NpcActive = 0


Thank you so much Akando!! I kept trying but i couldn't get it :D
Did that fix it?
yes it fixed it but i have a question
Go ahead
where do i put the ai_check() proc (not like how doi code it but where do i put ai_check()?

like this?
client
North()
if(usr.controling)
for(var/mob/puppet/P in view(25))
if(!P.Frozen)
step(P,NORTH)
return
if(!usr.Moveing)
if(!usr.Frozen)
usr.ai_check()
You could do something like:

mob
monster
New()
..()
while(src)
ai_check()
sleep(50)
hmmm so like...
        testnpc
name= "random guy"
icon = 'test.dmi'
maxhealth=1000000
health = 10000000
NPC=1
New()
..()
ai_check()
..()

In response to Naruto 5292
You could do this method as well and it would work probably better.

As in the method of checking each time the player moves.

Just be aware that your going to tie a lot to the players movement which could cause a bottleneck were the player can not move because it is stuck checking the list of mobs in the area.

Where as by putting the check as directly part of the NPC and then call it every so often should help relieve that.


However, I am not to efficiency programming yet so your original way may be best. Play with them both and see which gives you more delay.
hmm ya i was also thinking that it would cuase the palyer to freeze up wehen around many npc...so the test npc would work..thanks ill try
Page: 1 2 3 4 5