Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Expolision Studios

How do I make a friendly monster? (ai)

Recommended Posts

So i'm making a rather non_hostile map in doombuilder 2, and i want to make a friendly AI. 

I was hoping that maybe, there was a code for it, or a certain addon needed, because i see developers make WADs with monsters that just walk around, and not kill you. If anyone can help me out, that'd be great.

Share this post


Link to post

Well, in udmf(maybe in hexen too)format you can mark monster as friendly without any external tools. But on other formats, I'm not sure. I don't know if Dehacked can do this. 

Share this post


Link to post
1 hour ago, EmotionalFelineinaMadstate said:

Create an actor in DECORATE and add the +FRIENDLY flag to it, at least that's one way.

You can also checkbox this when you place a monster in doombuilder or gzdoombuilder so you don't even have to hard-code it. I think it only works if the map is UDMF though.

Share this post


Link to post
7 hours ago, Impie said:

You can also checkbox this when you place a monster in doombuilder or gzdoombuilder so you don't even have to hard-code it. I think it only works if the map is UDMF though.

Well, I saw the "friendly" checkbox in the monster settings, but when i tested it, the monster was gone

Share this post


Link to post
7 hours ago, Expolision Studios said:

Well, I saw the "friendly" checkbox in the monster settings, but when i tested it, the monster was gone

Now that's weird. Maybe you need to check "friendly" and "ally", now that I think of it.

Share this post


Link to post

I have a question, and I don't care if I must hack NASA or not in the process. How can I make, once I putted the Flag Friendly in the Decorate Lump, that the actor gets mad on me if I damage it. Like unfriend it. I believe using some like IF between the flags, but I'm not really sure of what must I put in there, of if is even possible.

 

Here's my code:

 

Spoiler

actor MarinePrueba 15002
{
  Game Doom
  //$Category Monsters
  //$Title Ally 01- Punch
  Health 200
  GibHealth -45
  Radius 20
  Height 56
  Speed 15
  PainChance 64
  OBITUARY "%o was punched in the face!"
  SEESOUND "Ally/Site"
  PAINSOUND "Ally/Pain"
  DEATHSOUND "Ally/Death"
  ACTIVESOUND "Ally/Active"
  MeleeThreshold 64
  MeleeRange 64
  MaxStepHeight 32
  MaxDropoffHeight 64
  MONSTER
  +BOSS
  +FLOORCLIP
  +FRIENDLY
  +QUICKTORETALIATE
  +NORADIUSDMG
  +SLIDESONWALLS
  +JUMPDOWN
  +CANPUSHWALLS
  +CANUSEWALLS
  +NODROPOFF
  +PUSHABLE
  +NOTAUTOAIMED
  +NOBLOCKMONST
  -COUNTKILL
  //+NOTIMEFREEZE
  //+NOFEAR
  +LOOKALLAROUND
  //+TELESTOMP
	//Here is where I planned to put If, but not really sure
   states
  {
   Spawn: //Spawn & Wait like standard Monsters
   ALY1 AABB 5 A_Look
   goto see
   See:
   ALY1 AABBCCDD 3 A_Chase
   ALY1 A 0 A_CheckSight("A01Patrol")//If target gets out of sight or dies after attacking, restarts patroling.
   loop
   A01Patrol: //Numbered by each Marine's number to avoid "Double Defenitions"
   ALY1 AABBCCDD 3 A_Wander
   ALY1 A 0 A_Look
   Loop
   Melee:
   ALY1 E 3 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   ALY1 E 5 A_Jump(64,"Missile") //Might follow through with a jump & punch attack
   ALY1 A 3
   Goto See
   Missile:
   ALY1 A 10 A_FaceTarget
   ALY1 A 5 A_PlaySound("Ally/PunchChargeReady")
   ALY1 E 5 A_FaceTarget
   ALY1 E 0 A_PlaySound("Ally/PunchChargeJump")
   ALY1 A 10 A_SkullAttack
   ALY1 E 5 A_Gravity
   ALY1 E 0 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   ALY1 E 5 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   goto See
   Pain:
   ALY1 G 5 A_Pain
   ALY1 G 3
   Goto See
   Death:
   ALY1 H 3
   ALY1 I 3 A_Scream
   ALY1 J 3
   ALY1 KLM 5
   ALY1 N -1 A_NoBlocking
   Stop
   XDeath:
   ALY1 O 5
   ALY1 P 5 A_XScream
   ALY1 QRSTUV 5
   ALY1 W -1 A_NoBlocking
   Stop
   }
  }

 

 

Share this post


Link to post
17 hours ago, noigs2015 said:

I have a question, and I don't care if I must hack NASA or not in the process. How can I make, once I putted the Flag Friendly in the Decorate Lump, that the actor gets mad on me if I damage it. Like unfriend it. I believe using some like IF between the flags, but I'm not really sure of what must I put in there, of if is even possible.

 

Here's my code:

 

  Reveal hidden contents


actor MarinePrueba 15002
{
  Game Doom
  //$Category Monsters
  //$Title Ally 01- Punch
  Health 200
  GibHealth -45
  Radius 20
  Height 56
  Speed 15
  PainChance 64
  OBITUARY "%o was punched in the face!"
  SEESOUND "Ally/Site"
  PAINSOUND "Ally/Pain"
  DEATHSOUND "Ally/Death"
  ACTIVESOUND "Ally/Active"
  MeleeThreshold 64
  MeleeRange 64
  MaxStepHeight 32
  MaxDropoffHeight 64
  MONSTER
  +BOSS
  +FLOORCLIP
  +FRIENDLY
  +QUICKTORETALIATE
  +NORADIUSDMG
  +SLIDESONWALLS
  +JUMPDOWN
  +CANPUSHWALLS
  +CANUSEWALLS
  +NODROPOFF
  +PUSHABLE
  +NOTAUTOAIMED
  +NOBLOCKMONST
  -COUNTKILL
  //+NOTIMEFREEZE
  //+NOFEAR
  +LOOKALLAROUND
  //+TELESTOMP
	//Here is where I planned to put If, but not really sure
   states
  {
   Spawn: //Spawn & Wait like standard Monsters
   ALY1 AABB 5 A_Look
   goto see
   See:
   ALY1 AABBCCDD 3 A_Chase
   ALY1 A 0 A_CheckSight("A01Patrol")//If target gets out of sight or dies after attacking, restarts patroling.
   loop
   A01Patrol: //Numbered by each Marine's number to avoid "Double Defenitions"
   ALY1 AABBCCDD 3 A_Wander
   ALY1 A 0 A_Look
   Loop
   Melee:
   ALY1 E 3 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   ALY1 E 5 A_Jump(64,"Missile") //Might follow through with a jump & punch attack
   ALY1 A 3
   Goto See
   Missile:
   ALY1 A 10 A_FaceTarget
   ALY1 A 5 A_PlaySound("Ally/PunchChargeReady")
   ALY1 E 5 A_FaceTarget
   ALY1 E 0 A_PlaySound("Ally/PunchChargeJump")
   ALY1 A 10 A_SkullAttack
   ALY1 E 5 A_Gravity
   ALY1 E 0 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   ALY1 E 5 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   goto See
   Pain:
   ALY1 G 5 A_Pain
   ALY1 G 3
   Goto See
   Death:
   ALY1 H 3
   ALY1 I 3 A_Scream
   ALY1 J 3
   ALY1 KLM 5
   ALY1 N -1 A_NoBlocking
   Stop
   XDeath:
   ALY1 O 5
   ALY1 P 5 A_XScream
   ALY1 QRSTUV 5
   ALY1 W -1 A_NoBlocking
   Stop
   }
  }

 

 

If anyone find this, I discovered how (I'm a little slow)

 

This is my Decorate for the Neutral/Friendly/Don't-mess-with-him monster now (The //Notes will explain the process):

 

Spoiler

actor MarinePrueba 15002
{
  Game Doom
  //$Category Monsters
  //$Title Punchy Boii
  Health 200
  GibHealth -45
  Radius 20
  Height 56
  Speed 15
  PainChance 85 //This is a percent of possibilities to activate the Pain States, that will be important in this, you can set it how you want, being 0 a touhg guy that feels no pain and 100 an easily offended fag.
  OBITUARY "%o was punched in the face!"
  SEESOUND "Ally/Site"
  PAINSOUND "Ally/Pain"
  DEATHSOUND "Ally/Death"
  ACTIVESOUND "Ally/Active"
  MeleeThreshold 64
  MeleeRange 64
  MaxStepHeight 32
  MaxDropoffHeight 64
  MONSTER
  +BOSS
  +FLOORCLIP
  +FRIENDLY // This is the magic thingy that make the monster not mad at you, even if you attack him
  +QUICKTORETALIATE
  +NORADIUSDMG
  +SLIDESONWALLS
  +JUMPDOWN
  +CANPUSHWALLS
  +CANUSEWALLS
  +NODROPOFF
  +PUSHABLE
  +NOTAUTOAIMED
  +NOBLOCKMONST
  -COUNTKILL
  //+NOTIMEFREEZE
  //+NOFEAR
  +LOOKALLAROUND
  //+TELESTOMP
   states
  {
   Spawn:
   ALY1 AABB 5 A_Look
   goto see //This will automatically activate the monster, activating the See State, even if the monster haven't seen you yet.
   See:
   ALY1 AABBCCDD 3 A_Chase
   ALY1 A 0 A_CheckSight("A01Patrol")//If target gets out of sight or dies after attacking, restarts patroling.
   loop
   A01Patrol:
   ALY1 AABBCCDD 3 A_Wander
   ALY1 A 0 A_Look
   Loop
   Melee:
   ALY1 E 3 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   ALY1 E 5 A_Jump(64,"Missile")
   ALY1 A 3
   Goto See
   Missile:
   ALY1 A 10 A_FaceTarget
   ALY1 A 5 A_PlaySound("Ally/PunchChargeReady")
   ALY1 E 5 A_FaceTarget
   ALY1 E 0 A_PlaySound("Ally/PunchChargeJump")
   ALY1 A 10 A_SkullAttack
   ALY1 E 5 A_Gravity
   ALY1 E 0 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   ALY1 E 5 A_FaceTarget
   ALY1 F 5 A_CustomMeleeAttack(random(3, 10) * 8,"Ally/PunchImpact","Ally/Fist","Melee")
   goto See
   Pain: //This is the Pain State, which is important, when it gets activated, the next will happen
   ALY1 G 5 A_ChangeFlag("FRIENDLY", FALSE) //Now this is the Function that solve the puzzle. A_ChangeFlag(-The Flag you want to modify or add-, -"True" to add, "False" to delete, and that's all.
   ALY1 G 5 A_Pain
   ALY1 G 3
   Goto See
   Death:
   ALY1 H 3
   ALY1 I 3 A_Scream
   ALY1 J 3
   ALY1 KLM 5
   ALY1 N -1 A_NoBlocking
   Stop
   XDeath:
   ALY1 O 5
   ALY1 P 5 A_XScream
   ALY1 QRSTUV 5
   ALY1 W -1 A_NoBlocking
   Stop
   }
  }

 

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×