Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

HOW TO MAKE AN NPC DO WHAT YOU WANT IT TO DO (noobs, welcome)


Diskmaster
 Share

Recommended Posts

Ok, I am seeing a lot of questions, especially in scripting, on How to make an NPC do this, or that, and I thought to myself, mabey I should make a tutorial to at least push the noobs in the right direction! Ok, now we start: Step one, pick your NPC, once you do that, go onto the top right corner of the NPC edit box and click on the drop down box up there.  Once that is done, you will have to decide what your NPC will do! Here are the attributes and what they all do:

Attack On Sight: Ok, this attribute is an easy one, and probably most used in ORPGs! It is exactly how it sounds, this NPC will attack any one in its sight range! Oh, and one more thing, it will say what is in the text box under the attributes dropdown once it sees something (also something to note, MONSTERS will almost never attack a person with acess of 2 or higher unless attacked, it is NOT a glitch)

Attack when Attacked: This is the same as above, but they will NOT attack you until you attack them, when attacked they will say what is in the text box (very useful for harmless creatures!!)

Friendly: This one is probably the most misunderstood NPC attribute! Friendly does not mean you can attack it, but it DOES mean you can talk to it! First put something in the text box mentioned above and then set it's HP to 1 (without this step, the NPC won't talk).  You can actually set its HP to whatever you want other than 0, it doesn't matter!  Only one thing, unconfirmed sorces tell me that you cannot talk to these NPCs if your map's attribute is HOUSE

Shop Keeper: This attribute is the exact same as friendly except it makes the NPC immovable

Gaurd: This attribute is also pretty useful! It is very similar to attack when attacked except, if you have more than one gaurd attributed NPCs on a map and you attack one, they will all become aggressive to you! (also, if you kill a player, your name will turn red and gaurds WILL be aggressive to you, until you die at any time)

Scripted: A scripted NPC can do almost anything you want it to EXCEPT be attacked or killed, Just for starters, here is a simple command you can set for a scripted NPC, changing the case # to whatever the next case is

case 1
call playermsg(index, "this is a test to see this NPC works!!", 4)

You can of corse change the text inside of the parenthases " " to whatever you want, and you can change the # as well because that is what color the text will be! (just a side note, if you want to make an NPC do something after dying, try messing with the On NPC Death sub or requesting in the Script Request Sub section of the Scripts forum!

Oh, and on a final note, NPCs CANNOT BE SET TO, OR SCRIPTED TO ATTACK EACH OTHER, so don't ask or request on script request, try source request.
Link to comment
Share on other sites

Also, you may want to add, if a player kills another player, his name will turn red.  The guards will automatically attack a rednamed player; also good to keep PKers out of the city (read it from [here](http://www.touchofdeathforums.com/smf/index.php/topic,38183.0.html); tested it myself).
Link to comment
Share on other sites

@Ruins:

> I think this is way too simple, anyone can find this out except for scripted maybe. 2/5

If you spend enough time in the Questions section, answering people's questions, you'll be thankful someone made a tutorial like this; it's easier linking to a tutorial that explains something as trivial as making an NPC talk, instead of explaining how to do it step-by-step 4-5 times a month to users who don't feel like experimenting with eclipse for themselves.
Link to comment
Share on other sites

  • 5 months later...
ok this isnt working fro me i dont know why but i cant put them i did 1 time before but i re download stable then when back to 2.8 eclipse but now i cant put npc i tryed this and many other ways awell but i cant put one
:huh:i even reinstalled it 5 time and i still cant
Link to comment
Share on other sites

@atmadragon:

> ok this isnt working fro me i dont know why but i cant put them i did 1 time before but i re download stable then when back to 2.8 eclipse but now i cant put npc i tryed this and many other ways awell but i cant put one
> :huh:i even reinstalled it 5 time and i still cant

What part are you having trouble with? does it not attack talk? or can you not place it at all?
Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...