ID:180010
 
How can i make mobs chase users?and how can i make it so when u click on a npc a window or something pops up?
and also a Eat verb shows only when u have Food in your inventory and one more question,i need to know how we make it so we can only eat food and not items
Turles9000 wrote:
How can i make mobs chase users?and how can i make it so when u click on a npc a window or something pops up?
and also a Eat verb shows only when u have Food in your inventory and one more question,i need to know how we make it so we can only eat food and not items

ok to answer your question about the eat verb only assing the verb under food. ex: obj/food
rice
verb/eat
blah

Ok Goto help on under help and lookup input.That will shw you how to make popup windows
Turles9000 wrote:
How can i make mobs chase users?

Check out Deadron's PathFinding library. It's not too difficult to use, provided you don't make my mistake of over-complicating the map by using special teleport turfs. :)

and also a Eat verb shows only when u have Food in your inventory and one more question,i need to know how we make it so we can only eat food and not items

To answer the second part first, you should make food a subset of items:

obj/item
...

obj/item/food
...
verb/eat(item)

Now, to make sure the eat verb is restricted to just inventory contents, do this:

verb/eat(item)
set src in usr

I prefer a little more flexible an eat verb myself, so in my current test designs I'm using this:

verb/eat(item)
set src in view(1)

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Turles9000 wrote:
How can i make mobs chase users?

Check out Deadron's PathFinding library. It's not too difficult to use, provided you don't make my mistake of over-complicating the map by using special teleport turfs. :)

<defensive_mode>
There was still a really easy solution to that!

Anyway, for standard situations you call one proc and don't have to understand anything about the library, so I like to characterize it as "insanely simple" to use...
</defensive_mode>

It wasn't always simple, as it happens -- you used to have to create objects and interact with them, before I got a clue that most things should be no more than one function call for the common case.

If a lot of people do want to use it with teleporters, I could add in some default functionality for that.
In response to Deadron
Deadron wrote:
<defensive_mode>
There was still a really easy solution to that!

Anyway, for standard situations you call one proc and don't have to understand anything about the library, so I like to characterize it as "insanely simple" to use...
</defensive_mode>

True, your solution would have been workable. However I didn't like the way my own code was making the problem more complicated.

It wasn't always simple, as it happens -- you used to have to create objects and interact with them, before I got a clue that most things should be no more than one function call for the common case.

If a lot of people do want to use it with teleporters, I could add in some default functionality for that.

Actually that shouldn't be necessary.

In my region code, support for complex regions means that teleporters can be set up as complex regions, where each tile is a simple region within it. If regions are added to the PathFinding library, it should be possible with reasonable accuracy to automatically "sense" teleporters as a link from one region to another. However, for teleporters that occur within the same region as the source object and destination turf, this won't be as much help, as intra-region pathfinding should rightly default to your original code.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Turles9000 wrote:
How can i make mobs chase users?

Check out Deadron's PathFinding library. It's not too difficult to use, provided you don't make my mistake of over-complicating the map by using special teleport turfs. :)


Or,just make the teleport code look like this:

turf/Teleport
icon='Grass.dmi'
Enter(mob/M)
..()
if(M.client==null)
..()
else
M.Move(x,y,z)

that makes it so only things with a key(signed up for byond)can enter and teleport.
In response to Nadrew
Nadrew wrote:
Lummox JR wrote:
Turles9000 wrote:
How can i make mobs chase users?

Check out Deadron's PathFinding library. It's not too difficult to use, provided you don't make my mistake of over-complicating the map by using special teleport turfs. :)


Or,just make the teleport code look like this:

turf/Teleport
icon='Grass.dmi'
Enter(mob/M)
..()
if(M.client==null)
..()
else
M.Move(x,y,z)

that makes it so only things with a key(signed up for byond)can enter and teleport.

Nadrew, the whole point about teleporters(if you've read the thread with it??) was to design a way for Mobs following you to somehow see the shortest path to you as the teleporter, even though some other way may seem closer.

Alathon
In response to Alathon
Alathon wrote:
Nadrew wrote:
Lummox JR wrote:
Turles9000 wrote:
How can i make mobs chase users?

Check out Deadron's PathFinding library. It's not too difficult to use, provided you don't make my mistake of over-complicating the map by using special teleport turfs. :)


Or,just make the teleport code look like this:

turf/Teleport
icon='Grass.dmi'
Enter(mob/M)
..()
if(M.client==null)
..()
else
M.Move(x,y,z)

that makes it so only things with a key(signed up for byond)can enter and teleport.

Nadrew, the whole point about teleporters(if you've read the thread with it??) was to design a way for Mobs following you to somehow see the shortest path to you as the teleporter, even though some other way may seem closer.

Alathon

Yeah stupid me I re-read it doh...Well for anyone interested theres a code to make it so NPC's can't use warps.