From ccfdfb2adaabe1cfcc6c8d92a9a6ae296b00ce7c Mon Sep 17 00:00:00 2001 From: inkoalawetrust <56005600+inkoalawetrust@users.noreply.github.com> Date: Fri, 13 May 2022 20:00:28 +0300 Subject: [PATCH] Version 1.0.3 - Bumped the minimum ZScript version needed from 4.3.3 to 4.7.0. That way I'll hopefully get less bug reports from people using outdated GZDoom versions. - Fixed a VM abort caused if when the marine checked a player who has no weapon at all. - Fixed some typos inside of the readme and document. - Added possible fix for a bug that seems to make non-friendly marines start shooting at other hostile monsters. Even though the marines should avoid infighting. --- Document.txt | 4 ++-- MarineFunctions.zsc | 4 ++-- ZScript.zsc | 2 +- readme.md | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Document.txt b/Document.txt index 5ec1159..eeeb541 100644 --- a/Document.txt +++ b/Document.txt @@ -44,10 +44,10 @@ The turret's editor name is "Machine Gun Emplacement", and it can be found in th - Random (Randomly pick a color.) - Default (Use the default shade of green. Similar to just leaving User_Color empty.) - Most of the marines' behaviour can be configured on a per actor basis using user variables. -- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomied. +- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomized. - They also have a rifle that they sometimes drop, which you can pick up and use yourself. - The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too. - - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increased you accuracy as well. + - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well. - The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine. ================|USER VARIABLES|================ diff --git a/MarineFunctions.zsc b/MarineFunctions.zsc index 9649de9..0488e43 100644 --- a/MarineFunctions.zsc +++ b/MarineFunctions.zsc @@ -154,7 +154,7 @@ Mixin Class MarineFunctions //If your target is hostile, and is a player or marine that's on a turret. And they are in range and visible. /*This Else If is here so marines scared of an enemy on a turret, won't be any more likely to get on one themselves. Since protecting yourself from machine gun fire by getting to a stationary turret yourself is stupid, and MORE likely to get you killed.*/ - Else If ((Target.Player && Target.Player.ReadyWeapon.GetClassName() == "SmartMarineMGWeapon" && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret || + Else If ((Target.Player && Target.Player.ReadyWeapon && Target.Player.ReadyWeapon.GetClassName() == "SmartMarineMGWeapon" && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret || Target Is "SmartMarine" && SmartMarine(Target).OnTurret && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret || Target Is "TurretMarine" && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret)) { @@ -273,7 +273,7 @@ Mixin Class MarineFunctions //And it is not your current target. !(Target == Mobj)) { - Return True; //Then return that the actor should not be shot. + Return (bFriendly && !IsHostile(Mobj)) || (!bFriendly && !Mobj.bFriendly); //Then return that the actor should not be shot if it isn't hostile to you. } } diff --git a/ZScript.zsc b/ZScript.zsc index 23f09b2..c5fa4e7 100644 --- a/ZScript.zsc +++ b/ZScript.zsc @@ -1,4 +1,4 @@ -Version "4.3.3" +Version "4.7.0" #Include "VanillaRifle.zsc" //The rifle the marine may drop when killed. #Include "MarineFunctions.zsc" //A mixin container for all the marines' custom functions. diff --git a/readme.md b/readme.md index 3eb59a8..f7b5b89 100644 --- a/readme.md +++ b/readme.md @@ -37,10 +37,10 @@ Smart marines are NPCs for Doom that are far more intelligent than vanilla monst - Random (Randomly pick a color.) - Default (Use the default shade of green. Similar to just leaving User_Color empty.) - Most of the marines' behaviour can be configured on a per actor basis using user variables. -- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomied. +- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomized. - They also have a rifle that they sometimes drop, which you can pick up and use yourself. - The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too. - - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increased you accuracy as well. + - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well. - The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine. More information, such as info on what all the user variables available on the marines are, and what they do. Can be found inside Document.txt