Would be nice if we could get an update for those scientists on the new oil rig.
Thank you.
Thank you.
In response to Arainrr ():Scientist deaths not showing in chat, See chadomat's answer.
Replace HTNPlayer with Sc...
///////////////////////////////////////////////////////////////////// DeathNotes.cs if (entity is BaseTrap) return CombatEntityType.Trap; if (entity is Barricade) return CombatEntityType.Barricade; if (entity is HTNPlayer) return CombatEntityType.HTNPlayer; return CombatEntityType.Other; }///////////////////////////////////////////////////////////////////// DeathNotes.cs case CombatEntityType.Scientist: case CombatEntityType.Murderer: var name = entity.ToPlayer()?.displayName; return string.IsNullOrEmpty(name) || name == entity.ToPlayer()?.userID.ToString() ? combatEntityType.ToString() : name; case CombatEntityType.HTNPlayer: return UppercaseFirst(entity.ShortPrefabName.ToString());case CombatEntityType.Bradley: return "Bradley APC";///////////////////////////////////////////////////////////////////// DeathNotes.cs Fire = 11, Lock = 12, ScientistSentry = 13, HTNPlayer = 14, Other = 15, None = 16 }///////////////////////////////////////////////////////////////////// DeathNotes.cs private static string UppercaseFirst(string text) { if (string.IsNullOrEmpty(text)) return string.Empty; var a = text.ToCharArray(); a[0] = char.ToUpper(a[0]); return new string(a); }///////////////////////////////////////////////////////////////////// DeathNotes.cfg { "KillerType": "Player", "VictimType": "HTNPlayer", "DamageType": "*", "Messages": [ "Killmessage" ] }, { "KillerType": "HTNPlayer", "VictimType": "Player", "DamageType": "*", "Messages": [ "Killmessage" ] },Where is DeathNotes.cfg? Where am I supposed to find it??? private static string UppercaseFirst(string text) { if (string.IsNullOrEmpty(text)) return string.Empty; var a = text.ToCharArray(); a[0] = char.ToUpper(a[0]); return new string(a); }
I cannot find this code in DeathNotes.cs
I am totally stuck in a rut here..... :-(
Any help/hint/suggestion would be greatly appreciated! Thanks in advance!
In response to Arainrr ():private static string UppercaseFirst(string text)This is the new function
private static string HumanizePascalCase(string text)
{
if (string.IsNullOrEmpty(text))
return string.Empty;
var sb = new StringBuilder();
foreach (char c in text)
{
if (char.IsUpper(c) && sb.Length != 0 && !char.IsUpper(sb[sb.Length - 1]))
sb.Append(" ");
sb.Append(c);
}
return sb.ToString();
}
private string StripRichText(string text)
{
if (string.IsNullOrEmpty(text))
return string.Empty;
text = _colorTagRegex.Replace(text, string.Empty);
text = _sizeTagRegex.Replace(text, string.Empty);
foreach (var richTextLiteral in _richTextLiterals)
text = text.Replace(richTextLiteral, string.Empty, StringComparison.InvariantCulture);
return text;
}
Twice, as you can see. So it's not clear to me where and what I should replace the new part. I told you I am not a programmer.
The only thing I have figured out is that what he calls "DeathNote.cfg" is the \oxide\config\DeathNote.json
And that's a huge success!
In response to pookins ():If you go playing around with .cs files you wont have anything to complain about if the plugin doesn...
In response to JagsterWintermute ():LOL! "scolding" me for "playing around with .cs files" it's not that it helps me a lot, either. So,...
In response to pookins ():I am not scolding you but pointing out that the .cs file is not the file you edit or change, there a...
Greetings.
As i saw some people asking for it , but with no definite answer - Here's the answer how to display the "new" scientist npcs if they get killed
Just replace this
// Ignore deaths of other entities
if (data.KillerEntityType == CombatEntityType.Other || data.VictimEntityType == CombatEntityType.Other)
return;With this -
// Ignore deaths of other entities
if (data.KillerEntityType == CombatEntityType.Other || data.VictimEntityType == CombatEntityType.Other)
{
var enemy = data.VictimEntity?.GetType().Name ?? "NULL";
if(enemy != "ScientistNPC")
{
return;
}
}
That should do the trick
// You MIGHT have to add the messages into the config after that. the Victim type is "Other"
{
"KillerType": "Player",
"VictimType": "Other",
"DamageType": "*",
"Messages": [
"{killer} butchered a {victim} but forgot to took a picture to post on Facebook. Lame.",
"Wow. You really killed a {victim}? Feeling proud? You are ready for the military tunnel, bruh!"
]
},Thank you for the ultimate hint! :-D