Jump to content
  • 0

How to make hitscan species not damage and infight eachother?


DoomBunny

Question

i have a zscript monster that uses hitscans. i want the bullets not cause damage and cause infights to its species.
i searched but can't find a exact answer.
 

this is my zscript monster
 

class RBCP : Actor
{
	Default
	{
		Health 40;
		Radius 20;
		Height 50;
		Speed 8;
		PainChance 200;
		Monster;
		+FLOORCLIP
		SeeSound "Robot/Alert";
		PainSound "Robot/Hurt";
		DeathSound "Robot/Death";
		ActiveSound "Blip/Random";
		Obituary "%o was put to sleep by the Roomba Cop";
		Tag "Roomba Cop";
	}
	States
	{
	Spawn:
		RBCP A 10 A_Look;
		Loop;
	See:
		RBCP A 4 A_Chase;
		Loop;
	Missile:
		RBCP H 10 A_FaceTarget;
		TNT1 A 0 A_PlaySound ("Robot/Shoot");
		RBCP B 4 BRIGHT A_CustomBulletAttack (22.5, 0, 1, 1 * 3, "BulletPuff", 0, CBAF_NORANDOM);
		TNT1 A 0 A_PlaySound ("Robot/Shoot");
		RBCP C 4 BRIGHT A_CustomBulletAttack (22.5, 0, 1, 1 * 3, "BulletPuff", 0, CBAF_NORANDOM);
		TNT1 A 0 A_MonsterRefire(130, "See");
		Goto Missile+1;
	Pain:
		RBCP H 6 A_PAIN;
		Goto See;
	Death:
		RBCP DEF 10 A_Scream;
		RBCP G -1 A_NoBlocking;
		Stop;
	}
}

 

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 2

Instead of using standard bullet puffs, use custom ones so you can use a custom damage type so that your enemy can be made immune to this damage type with a damagefactor of 0 to it.

Share this post


Link to post
  • 2

ok it works, i just have to make it a string. thanks!

 

here's the code incase for people who has the same problem

class RBCP : Actor
{
	Default
	{
		Health 40;
		Radius 20;
		Height 50;
		Speed 8;
		PainChance 200;
		Monster;
		DamageFactor "Sleep", 0.0;
		+FLOORCLIP
		SeeSound "Robot/Alert";
		PainSound "Robot/Hurt";
		DeathSound "Robot/Death";
		ActiveSound "Blip/Random";
		Obituary "%o was put to sleep by the Roomba Cop";
		Tag "Roomba Cop";
	}
	States
	{
	Spawn:
		RBCP A 10 A_Look;
		Loop;
	See:
		RBCP A 4 A_Chase;
		Loop;
	Missile:
		RBCP H 10 A_FaceTarget;
		TNT1 A 0 A_PlaySound ("Robot/Shoot");
		RBCP B 4 BRIGHT A_CustomBulletAttack (22.5, 0, 1, 1 * 3, "SleepLaser", 0, CBAF_NORANDOM);
		TNT1 A 0 A_PlaySound ("Robot/Shoot");
		RBCP C 4 BRIGHT A_CustomBulletAttack (22.5, 0, 1, 1 * 3, "SleepLaser", 0, CBAF_NORANDOM);
		TNT1 A 0 A_MonsterRefire(130, "See");
		Goto Missile+1;
	Pain:
		RBCP H 6 A_PAIN;
		Goto See;
	Death:
		RBCP DEF 10 A_Scream;
		RBCP G -1 A_NoBlocking;
		Stop;
	}
}

class SleepLaser : BulletPuff
{
	Default
	{
		DamageType "Sleep";
	}
}


 

Share this post


Link to post
  • 1

Yeah, every string type data in zscript has to be in " ", so correct it to Damagetype "fire"; and it will work.

 

 Atke a look at your class SleepLaser and try to find out the difference.

 

Decorate and incorrect use if it has taught people lots of bad habits :) like not enclosing strings with " "

Edited by ramon.dexter

Share this post


Link to post
  • 0
Quote

Instead of using standard bullet puffs, use custom ones so you can use a custom damage type so that your enemy can be made immune to this damage type with a damagefactor of 0 to it.

the damage type code example is in decorate. when I put DamageType Fire; in zscript, it causes an error.
 

class SleepLaser : BulletPuff
{
	Default
	{
		DamageType Fire;
	}
}

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...