Lobo Posted August 27, 2003 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; 0 Share this post Link to post
Lobo Posted September 10, 2003 Somebody throw me a bone here! Can someone at elast give me the name and email address of an Edge guru? 0 Share this post Link to post
SyntherAugustus Posted September 10, 2003 everybody's moving to EDF now. :P 0 Share this post Link to post
zark Posted September 10, 2003 BlackFish said:everybody's moving to EDF now. :P Everybody being you? 0 Share this post Link to post
SyntherAugustus Posted September 10, 2003 heh someday I wont be the only one. 0 Share this post Link to post
Fanatic Posted September 13, 2003 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; 0 Share this post Link to post
Lobo Posted September 13, 2003 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; 0 Share this post Link to post
Fanatic Posted September 16, 2003 Ah, yeah, I never messed with friendly monsters. The stuff I did only worked on normal "very angry at you" monsters. If you can't figure it out, try emailing whomever is left at http://edge.sourceforge.net. 0 Share this post Link to post
Lobo Posted September 16, 2003 Yeah, I tried that but he hasn't answered back. Anyway, thanks for the help man. The Edge community misses you!! 0 Share this post Link to post