Want mod brutal heretic so beefier enemies /w more damage

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
maltman
Posts: 10
Joined: Sat Apr 20, 2019 4:08 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Want mod brutal heretic so beefier enemies /w more damage

Post by maltman »

I have begun playing Brutal Heretic. It's awesome and makes the vanilla Heretic weapons much more fun to use IMO. But it also has made the game too easy even on the hardest difficulty.

So, I would like to mod it so the enemies are more dangerous and deal more damage, perhaps even fire faster or with faster projectiles. This is my first mod so I want something dead simple. A simple script with a couple lines.

Can someone please direct me to some cool tutorials or forum posts which can guide me to do this? I'm using GZ_Doom 4.0 btw

Edit:
Is SLADE still the best? And should I be doing Zscript or Decorate?
I did this and it didn't work: viewtopic.php?f=39&t=64471


Edit3:: NM I figured it out now. Here is my code for posterity:

Note that the mod wont register until you load a new level not from a save.

Code: Select all

// You must add the Cat class to MapInfo as an event handler
class Cat : EventHandler 
{
   Actor player;
   
   override void OnRegister()
	{
		super.OnRegister();


		Console.Printf("Registering Mod MYMOD");
	} 

// This doesn't activate for loading saved games.
   override void WorldLoaded(WorldEvent e) 
   {
      super.WorldLoaded(e);
      self.player = players[consoleplayer].mo;

      Console.Printf("Activating Mod MYMOD");
   }

// this doesnt work for loading saved games either
   override void WorldThingSpawned(WorldEvent e) 
   {
      super.WorldThingSpawned(e);

      Actor npc = e.Thing;

      if (!npc.bIsMonster 
         || npc.IsFriend(self.player) 
         || npc.GetClassName() == "Lost Soul") 
		 {
			return;
		}

      npc.Health *= 1.5;  
	  //Random(2.0, 3.0);
      //npc.SetDamage(*2.0); // this line doesnt work because projectiles have damage, not npcs.
	  Console.Printf("%s , DAMAGE = %4.4f\n , HEALTH = %4.4f\n", npc.GetClassName(), npc.Damage, npc.Health);
   }
   
   // This doubles the amount of damage received by player.
   override void WorldThingDamaged(WorldEvent e)
   {
   		super.WorldThingDamaged(e);
		if (e.Thing == self.player)
		{
			Actor playerThing = e.Thing;
			Console.Printf("Player damaged : %4.4f\n", e.Damage);
			playerThing.health -= e.Damage;
		}
		else
		{
			Console.Printf("%s", "Thing damaged\n");
		}
   }
   
}
 
 // this is how you do it but it doesnt work with the brutal mod which levels health
//class MyPlayer : HereticPlayer
//{
 //Default
  //  {
   //     Health 70;
	//}
//}
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: Want mod brutal heretic so beefier enemies /w more damag

Post by m8f »

Please take a look at this. If it doesn't satisfy you, at least it has example code.
Post Reply

Return to “Scripting”