ID:171180
Oct 31 2004, 12:25 am
|
|
I can't keep the NPCs from being killed. Does some have a code to prevent this?
|
In response to Ter13
|
|
Okay, what I mean is that I don't want some of my NPCs to be attacked. Like the townspeople, royality, anyone helpful, I don't want them to die, just the monsters. (I don't have any mosters just yet, but I'm not making them yet.)
So, If there is a working code out there, please point it out. |
In response to GoldenSunMaster3
|
|
Never ask for code.
Ask how YOU can make it. Do you have an attack verb done? You will need a new type of NPC if so. ONLY define the attack verb in /mob/NPC/combative. mob |
In response to Ter13
|
|
My attack verb is interfrring. What should I do?
|
In response to GoldenSunMaster3
|
|
GoldenSunMaster3 wrote:
My attack verb is interfrring. What should I do? You can go back and set a sub-category for hostile NPCs and another for shopkeepers like suggested previously, or create and check a list to see if the player can attack a certain NPC like so. Create a procedure much like this: mob/player Then with the attack verb: mob/player Sure it's a lot more processor load when compared to just categorizing mobs but it's useful if you need to make hostiles peaceful for charming or a faction setup. |
In response to Grei
|
|
Or he could create npcs from a /obj type.
|
In response to GoldenSunMaster3
|
|
you COULD define the attack verb so that it only detects /mob/NPC/combatants, or you could actually take my suggestion and make the attack verb under the person who is being attacked.
|
Put all the NPC's under a certain type and in the attack verb make sure that the person being attacked isn't of that type, if the person being attacked IS of that type then don't carry out the verb, otherwise do everything as normal.
|
In response to DeathAwaitsU
|
|
Or, if DeathAwaitsU's explantion is just to complicated, I find it much easier to give all the NPCs a certain var and then have the attack verb check for that var before attacking. I always found it simpler that way.
Chance |
In response to DeathAwaitsU
|
|
Okay. How would I go about doing that?
|
In response to GoldenSunMaster3
|
|
Well typing usually helps.
|
In response to GoldenSunMaster3
|
|
GoldenSunMaster3 wrote:
Okay. How would I go about doing that? You're a lazy soul, eh? mob You MIGHT want to use binary instead, if(N.baddy == 1) Etc. Now you owe me your house, and wife/husband. Oh, and don't copy and paste my code. |
In response to Kholintian Destroying Army
|
|
I don't owe you anything!
|
Most people want the opposite, they want their players to die, and their NPCs to be deleted.
You have to supply information.