ID:173133
 
you guys give stuff like tutorial and demos witch i have looked at all i need a is so a monster can walk up to a player then attack them!!!
Chronical wrote:
you guys give stuff like tutorial and demos witch i have looked at all i need a is so a monster can walk up to a player then attack them!!!

http://www.byondscape.com/ascape.dmb/Deadron.2002-0112/

And

http://developer.byond.com/hub/Deadron/WalkingClicking

And

http://developer.byond.com/hub/Deadron/CombatSystem
still no help damit i need a npc attack and follow player code
In response to Chronical
Chronical wrote:
still no help damit i need a npc attack and follow player code

Sure.
mob/npc
New()
spawn() AI()

proc/AI()
while(src)
var/mob/M
for(M in oview(src))
if(M.client)
M << "Guess what! Nobody's going to just hand you code!"
sleep(10)
M << "Why not try an example from one of those tutorials and ask \
for help if you get stuck?"

return
sleep(5)
Whoops, that doesn't actually attack or follow the player. Yet in more ways than one it gives you a way to get started.

Lummox JR
In response to Chronical
(I would just like to say sorry for putting words in your mouth Deadron, but this is what I see from your post.)

The point of Deadron giving you the links to those two resources, was so that you can look over them yourself and learn to do it on your own. He is trying to help without handing you "The Code" on a silver platter.

He sent you to the byondscape article, because he feels that you are coming about asking for help in the completly wrong manner, and I agree with him. If you were to have read over the article, your reply to Deadron's response, might have been more civilized, resulting in people willing to help you when that you have gotten some coding done, and run into problems within it.

(Once again I appologize if this is not what you meant Deadron.)

--§--
In response to Deadron
Deadron wrote:
Chronical wrote:
you guys give stuff like tutorial and demos witch i have looked at all i need a is so a monster can walk up to a player then attack them!!!

http://www.byondscape.com/ascape.dmb/Deadron.2002-0112/

And

http://developer.byond.com/hub/Deadron/WalkingClicking

And

http://developer.byond.com/hub/Deadron/CombatSystem


lol... for some reason I read the whole page which is brought up if you click the 1st link. ^_^ Just sucked my attention into it.
In response to Lummox JR
Lummox JR wrote:
Chronical wrote:
still no help damit i need a npc attack and follow player code

Sure.
mob/npc
> New()
> spawn() AI()
>
> proc/AI()
> while(src)
> var/mob/M
> for(M in oview(src))
> if(M.client)
> M << "Guess what! Nobody's going to just hand you code!"
> sleep(10)
> M << "Why not try an example from one of those tutorials and ask \

>>i undersatnd that code stupid and ya they should hand it over
> for help if you get stuck?"
> return
> sleep(5)
Whoops, that doesn't actually attack or follow the player. Yet in more ways than one it gives you a way to get started.
Lummox JR
In response to Chronical
How obnoxious.
Chronical wrote:
you guys give stuff like tutorial and demos witch i have looked at all i need a is so a monster can walk up to a player then attack them!!!

Try Kappa the Imp's attack system, run it and you'll see players approach the character, so there is obviously a code for it.

http://developer.byond.com/hub/KappatheImp/ AttackLevelingSystem

~~SSJ4_Gohan_Majin
In response to Chronical
Chronical wrote:
i undersatnd that code stupid and ya they should hand it over

Nope, you don't understand that code at all. If you did, you'd have learned something from it instead of still insisting--with an insult, at that--that people hand you code. In fact it takes very very little understanding, indeed the bare minimum, to realize that such code wouldn't simply plug into whatever project you were working on; it'd have to be built for it.

But if you understood what I'd posted in the least, you'd notice the structure of that loop and what it signifies. It's key to understanding how to make an NPC do anything on its own. It wouldn't take any effort at all, just a token effort to grasp that code, to see that this is the beginning of a solution. And all you need to do is decide what should go in that loop.

So if you'd even bothered to try learning something here, you would have. Instead you're so focused on the idea that someone should give you a handout that you won't try to work with what they will give you. I say again, no one is just going to hand you code. If you're not willing to learn from what you see here and work through problems yourself with help (rather than not working at all), then you're just wasting our time and yours by posting here.

Lummox JR
In response to SSJ4_Gohan_Majin
Except for the fact that that is, you know, an absolute horrible example, because it uses usr in procs. It should be removed from the hub and nobody should ever try to learn anything from it.
Chronical wrote:
you guys give stuff like tutorial and demos witch i have looked at all i need a is so a monster can walk up to a player then attack them!!!

Personally I hate this kind of posts.

"I NEED"

"!!!!"

-_- Just take time to write it and the "I WANT, I NEED ,GIVE ME! NOW!" method aint a attitude thats really appriciated by most people, atleast I dont . .

Anyways, good luck on the coding.

Greetz Fint
Chronical, I want you to look at the little blue column to your left. RIGHT-click on Tutorials, and click "Open in New Window", then repeat for Demos. Go through EVERY single Tutorial and Demo that has ANYTHING to do with "NPC", "Battling", "Battle", "Attack", "RPG", "Fighting", "System". Read every single line of EVERY Tutoiral and Demo that involves those words. Then, come here and try to rephrase your question.

Also, if you have MSN Messenger, add "[email protected]" and if you have any newbie code problems ask him. If he doesn't know the answer he has over 20 contacts from BYOND, and at least 1 of them will definately know the answer.

~Ease~

Phrase of the day : "We were all Newbie's once. That is, all except Lummox Jr!"
In response to Ease
Ease that was definately pointless, immature, and rude.
//Here is something that... may... help. I'm not even sure about 1/6 of the stuff on dm or whatever, but it makes me feel better to know that, i'm better than you 8-] no offence.

mob //mob, amazing...
monster //mob/monster
icon = 'NPC.dmi'//icon
proc //define that we are setting a proc
stepping() //name proc?
sleep(10) //wait 1 second
for(var/mob/m in view()) // we'll use the var "m" for all mobs in view
if(m.client) //if m is an actual person
if(get_dist(src,m) <= 1) //if they are 1 space away
src.dir = get_dir(src,m) //monsters direction is now facing m
step(src,src.dir) //monster steps in monsters direction
src.stepping() //repeat this
else //if they are more than 1
step_to(src,m) //let's get closerrrr
src.stepping() //repeat
Bump(mob/m) //bumping into a mob, or m
if(m.client) //if m is person
step(m,src.dir) //sort of a... push?
m<<"[src] just nailed you. RAWR!!!" //messege
Move() //when a mob moves
if(src.client) //is moving thing is a person
for(var/mob/monster/m in view()) //m = all monsters in view
m.stepping() //call stepping to m


// yea even though i suck at coding thatll be fine and if it isnt its better than anything anybody else has giving ya, right?
In response to Yolloogy
Point is - we COULD just whip something up for him. But, he won't understand it, he'll just come to grasp that there's a, "code" for everything. And, he'll continually come back asking for, "this code and that code, or what's the code to do this?" get my drift? As the old saying goes...
"you give a man a fish, you feed him for a day - you teach a man to fish, you've fed him for a lifetime".
In response to Goku72
Don't you tell me what my point is, Goku. I did that out of sheer generosity.
In response to Yolloogy
You didn't help him, though. You're just teaching him that if he's steadfast in his unwillingness to learn anything, he'll eventually get what he wants.
In response to Garthor
Did anybody ask your bloody opinion?
In response to Yolloogy
That wasn't an opinion, that was a fact.
Page: 1 2