Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Lobo

DDF help needed (again)

Recommended Posts

I'm having a problem with the path_follow DDF actions.

I want to have an friendly monster that follows a patrol route around a map (I have the RTS triggers all set up and working). There's no problem with that. But I also want this monster to attack any enemies he might come across along the path. I can't get it to do both!!

Anyone know how I could set this up? (code would be nice) Here's what I've got at the moment:

// friendly Battloid
[FRIENDLY_BATTLOID:3603]
SPAWNHEALTH=50;
REACTION_TIME=0.1;
SPRITE_SCALE=0.80;
RADIUS=20;
HEIGHT=64;
SPEED=16;
MASS=100;
PAINCHANCE=50%;
RIDE_FRICTION=0;
IMMUNITY_CLASS=T; //makes this thing immune to attack class T
SPECIAL=SOLID,DROPOFF,SLIDER,CLIMBABLE,SHOOTABLE,SLIDER,NO_GRUDGE,ATTACK_HURTS,GRAVFALL,DAMAGESMOKE;
MINATTACK_CHANCE=70%;
CASTORDER=19;
PALETTE_REMAP=PLAYER_BROWN;
SIDE=1;
RESPAWN_EFFECT=RESPAWN_FLASH;
AMBIENT_SOUND="POSIT?";
DEATH_SOUND="PDIEHI";
PAIN_SOUND="PLPAIN";
SIGHTING_SOUND="POSIT?";
RANGE_ATTACK=FORMER_HUMAN_SHOTGUN;
SPARE_ATTACK=FORMER_HUMAN_SHOTGUN;

STATES(IDLE)=RT03:A:3:NORMAL:PATH_CHECK,
              RT03:A:3:NORMAL:support_meander,
              RT03:B:3:NORMAL:support_meander,
              RT03:B:3:NORMAL:support_meander,
              RT03:C:3:NORMAL:support_meander,
              RT03:C:3:NORMAL:support_meander,
              RT03:D:3:NORMAL:support_meander,
              RT03:D:3:NORMAL:support_meander,
		  #IDLE;
		
STATES(MEANDER)=RT03:A:4:NORMAL:PATH_FOLLOW,
              RT03:A:4:NORMAL:PATH_FOLLOW,
              RT03:B:4:NORMAL:PATH_FOLLOW,
              RT03:B:4:NORMAL:PATH_FOLLOW,
              RT03:C:4:NORMAL:PATH_FOLLOW,
              RT03:C:4:NORMAL:PATH_FOLLOW,
              RT03:D:4:NORMAL:PATH_FOLLOW,
              RT03:D:4:NORMAL:PATH_FOLLOW,
              #IDLE;
		
STATES(CHASE)=RT03:A:4:NORMAL:makesoundrandom,
              RT03:A:4:NORMAL:chase,
              RT03:B:4:NORMAL:chase,
              RT03:B:4:NORMAL:chase,
              RT03:C:4:NORMAL:chase,
              RT03:C:4:NORMAL:chase,
              RT03:D:4:NORMAL:chase,
              RT03:D:4:NORMAL:chase,
              #IDLE;

STATES(MISSILE)=RT03:E:3:NORMAL:FACETARGET,
                RT03:F:8:BRIGHT:RANGE_ATTACK,
                RT03:E:8:normal:SPARE_ATTACK,
                #idle;

STATES(PAIN)=RT03:G:3:NORMAL:NOTHING,
             RT03:G:3:NORMAL:MAKEPAINSOUND,
             #IDLE;

STATES(DEATH)=RT03:I:8:NORMAL:NOTHING,
              RT03:J:8:NORMAL:MAKEDEATHSOUND,
              RT03:K:8:NORMAL:NOTHING,
              RT03:L:8:NORMAL:MAKEDEAD,
              RT03:M:8:NORMAL:NOTHING,
              RT03:N:8:NORMAL:NOTHING,
              RT03:O:-1:NORMAL:NOTHING;

STATES(RESPAWN)=RT03:K:5:NORMAL:NOTHING,
                RT03:J:5:NORMAL:NOTHING,
                RT03:I:5:NORMAL:NOTHING,
                RT03:H:5:NORMAL:NOTHING,
                #IDLE;

Share this post


Link to post

Somebody throw me a bone here!

Can someone at elast give me the name and email address of an Edge guru?

Share this post


Link to post
BlackFish said:

everybody's moving to EDF now.

:P

Everybody being you?

Share this post


Link to post

Add some checks in the meander states, that's why it's not looking to attack. If you set the tics to zero, they act are pointers between each visible frame. Check QDOOM's DDF lumps, I did a lot of crap like this to make monsters do neato things.

STATES(MEANDER)=RT03:A:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
RT03:A:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
RT03:B:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
RT03:B:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
RT03:C:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
RT03:C:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
RT03:D:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
RT03:D:4:NORMAL:PATH_FOLLOW,
RT03:A:0:NORMAL:LOOKOUT,
#IDLE;

Share this post


Link to post

OK Fanatic, that works for normal monsters but not if it's a friendly monster. If I add the LOOKOUT action he turns around and attacks ME even though we both have SIDE=1; !

I figured the principle would be the same: all I need to do is change LOOKOUT for SUPPORT_LOOKOUT, right? Wrong. That doesn't work the same way(and neither does SUPPORT_MEANDER).

In the end the best I could do is to at least get my friendly monster to retaliate if he's attacked, but he's stil blind as far as other monsters are concerned. The code below is for a friendly monster which follows a RTS path around a map, and who will defend himself if attacked, and who returns to the path once his attacker is killed. He will not start a fight himself when he sees an enemy(which is what I'd like). If there is no RTS path then this monster will act like a normal friendly monster and go wandering around helping you.

// FRIENDLY BATTLOID
// Initially this monster will follow RTS nodes and will NOT attack other monsters
//   UNLESS he gets attacked. Once this happens he will hunt down his attacker...
// I would prefer that he did both i.e. follow nodes AND attack other monsters when he
//   sees them but I can't figure it out.
[FRIENDLY_BATTLOID:3603]
SPAWNHEALTH=200;
REACTION_TIME=0.1;
SPRITE_SCALE=0.80;
RADIUS=20;
HEIGHT=64;
SPEED=16;
MASS=100;

//We make sure he always goes into a pain state so we
// can break out of the MEANDER state loop and retaliate with CHASE
PAINCHANCE=100%; 

RIDE_FRICTION=0;
IMMUNITY_CLASS=T; //makes this thing immune to attack class T
SPECIAL=SOLID,DROPOFF,SLIDER,CLIMBABLE,SHOOTABLE,SLIDER,NO_GRUDGE,ATTACK_HURTS,GRAVFALL,DAMAGESMOKE;
MINATTACK_CHANCE=70%;
CASTORDER=19;
PALETTE_REMAP=PLAYER_BROWN;
SIDE=1;
RESPAWN_EFFECT=RESPAWN_FLASH;
AMBIENT_SOUND="POSIT?";
DEATH_SOUND="PDIEHI";
PAIN_SOUND="PLPAIN";
SIGHTING_SOUND="POSIT?";
RANGE_ATTACK=PLAYER_SHOTGUN;
SPARE_ATTACK=PLAYER_SHOTGUN;

STATES(IDLE)=RT03:A:0:NORMAL:JUMP(HELPMEANDER,100%),//Always jump to HELP_MEANDER
	      #IDLE;
	
//This will be our own custom MEANDER state since the other one is used by node followers
STATES(HELPMEANDER)=RT03:A:4:NORMAL:SUPPORT_MEANDER,
		RT03:B:4:NORMAL:SUPPORT_MEANDER,//make him go looking for baddies
		RT03:C:4:NORMAL:SUPPORT_MEANDER,
		RT03:D:4:NORMAL:SUPPORT_MEANDER,
		RT03:C:4:NORMAL:SUPPORT_MEANDER,
		RT03:B:4:NORMAL:SUPPORT_MEANDER,
		#IDLE;

//I don't use SUPPORT_LOOKOUT since it seems to make 
//the monster stand there like a dumb shit and not do anything


//The MEANDER state is used by the node follower to move around
STATES(MEANDER)=RT03:A:4:NORMAL:PATH_FOLLOW,
		RT03:B:4:NORMAL:PATH_FOLLOW,
		RT03:C:4:NORMAL:PATH_FOLLOW,//follow RTS nodes if any
		RT03:D:4:NORMAL:PATH_FOLLOW,
		RT03:C:4:NORMAL:PATH_FOLLOW,
		RT03:B:4:NORMAL:PATH_CHECK,//loop back to the start of MEANDER if there is an RTS node
		#IDLE;
	

//We set up a loop in CHASE state to make sure he hunts down his attacker
STATES(CHASE)=RT03:A:4:NORMAL:makesoundrandom,
              RT03:B:4:NORMAL:chase,
              RT03:C:4:NORMAL:chase,
              RT03:D:4:NORMAL:chase,
              #CHASE;

STATES(MISSILE)=RT03:E:3:NORMAL:FACETARGET,
                RT03:F:8:NORMAL:RANGE_ATTACK,
                RT03:E:8:NORMAL:SPARE_ATTACK,
		RT03:E:3:NORMAL:REFIRE_CHECK, //this makes sure we still see the enemy
                #CHASE; //we loop to chase again if the REFIRE_CHECK gives true

//Initially this monster will follow RTS nodes and will NOT attack other monsters
//UNLESS he gets attacked. Once this happens he will hunt down his attacker...
//I would prefer that he did both i.e. follow nodes AND attack other monsters when he
//sees them but I Can't figure it out.
STATES(PAIN)=RT03:G:3:NORMAL:NOTHING,
             RT03:G:3:NORMAL:MAKEPAINSOUND,
             #CHASE;//he got hurt so we send him to CHASE state to hunt the attacker

STATES(DEATH)=RT03:I:8:NORMAL:NOTHING,
              RT03:J:8:NORMAL:MAKEDEATHSOUND,
              RT03:K:8:NORMAL:NOTHING,
              RT03:L:8:NORMAL:MAKEDEAD,
              RT03:M:8:NORMAL:NOTHING,
              RT03:N:8:NORMAL:NOTHING,
              RT03:O:-1:NORMAL:NOTHING;

STATES(RESPAWN)=RT03:K:5:NORMAL:NOTHING,
                RT03:J:5:NORMAL:NOTHING,
                RT03:I:5:NORMAL:NOTHING,
                RT03:H:5:NORMAL:NOTHING,
                #IDLE;



Share this post


Link to post

Yeah, I tried that but he hasn't answered back.

Anyway, thanks for the help man. The Edge community misses you!!

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
Sign in to follow this  
×