Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Friendly monster that follows you Goto page 1, 2 Next

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Freemanoid Joined: 16 Jun 2008 Posts: 52 Location: BELARUS |

Posted: Sat May 16, 2009 5:56 pm Post subject: Friendly monster that follows you |

I read tutorial about friendly monster here http://inside3d.com/showtutorial.php?id=180 But I need something else. I need a monster that follows you when you find him. For example, I place him in my map, and when I find him, he must protect me. So what I need to change in code to do something like this? Monster - soldier.
_________________
^O,..,o^

Back to top |

Wazat Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA |

Posted: Sat May 16, 2009 8:32 pm Post subject: |

Sounds like scourge of armagon (which I'm currently running through), except instead of finding a powerup that you pick up to spawn the monster in front of you, you want the monster to spawn in the level and wait until the player gets near it, or it sees him.
A visibility test and distance test ought to be adequate. You'll also want to make sure your monster does nothing but stand or wander randomly until he sees the player; only when the player finds him can he follow. Not sure where in the code to place that though.
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.

Back to top |

Freemanoid Joined: 16 Jun 2008 Posts: 52 Location: BELARUS |

Posted: Thu May 21, 2009 7:44 am Post subject: |

So how can I do that? _________________ ^O,..,o^

Back to top |

Madfox Joined: 15 Jan 2005 Posts: 36 Location: Holland |

Posted: Fri Jul 17, 2009 11:55 pm Post subject: |

Not sure if I understand what you mean, but why don't you add a monsterfriend outside your level, give it a teleport function to the place in your level and use a trigger at the place in the level (near the teleport destination for the monsterfriend) to spawn to?
So a small cage with a teleporter and monsterfriend and targetname to call and a target to send.
A teleportdestination with the target where you want to meet it .
And close nearby a trigger_once that calls the teleporter's targetname to spawn the monsterfriend.
You only have the monsterfriend in game on the moment you reach the trigger_once, that can only be used by you, not by other monsters.

Back to top |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Sat Jul 18, 2009 5:35 am Post subject: |

*hint: MOVETYPE_FOLLOW Darkplaces, you 'll figure it out.... ok.. u can have a touch function that sets that entity to MOVETYPE_FOLLOW.

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Sat Jul 18, 2009 8:50 am Post subject: |

MOVETYPE_FOLLOW really isn't what he wants... _________________ What's a signature?

Back to top |

Error Inside3D Staff Joined: 05 Nov 2004 Posts: 558 Location: VA, USA

Posted: Sat Jul 18, 2009 9:06 am Post subject: |

MOVETYPE_FOLLOW basically attaches an entity to another with ease. that's all. you could find the cujo bot source. _________________ Inside3D : Knowledge Is Power Darkplaces Documentation Wiki

Back to top |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Sat Jul 18, 2009 4:50 pm Post subject: |

Ah, ya silly me. Looking at the cujo source they are using movetogoal builtIn.

Back to top |

Freemanoid Joined: 16 Jun 2008 Posts: 52 Location: BELARUS |

Posted: Sun Jul 19, 2009 3:50 pm Post subject: |

Ok, look here. For example, I meet a guy in my level. Then I talk to him and he decide to follow me. That's what I want to do. _________________ ^O,..,o^

Back to top |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Sun Jul 19, 2009 7:39 pm Post subject: |

well basically, . the .guy has to run a findradius . see if you are visible . determine your direction . jump?
or
. movetogoal
or
. idle
wash rinse repeat
google "cujo quake", download "Killer Quake Patch" from filefront, decompile the progs with frikdec, search for "cujo" in the source and then investigate from there

Back to top |

Madfox Joined: 15 Jan 2005 Posts: 36 Location: Holland |

Posted: Sun Jul 19, 2009 11:54 pm Post subject: |

well, maybe not smart. but what's wrong with my answer?

Back to top |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Mon Jul 20, 2009 3:20 am Post subject: |

He wants to have a "character" standing idle on the map, so that when you walk up to it and touch it, then it will walk around the map where you lead. Not just a single place to teleport to. Just like in counterstrike, how you have to touch the hostage and then they follow you back to the rescue zone.

Back to top |

MeTcHsteekle Joined: 15 May 2008 Posts: 397 Location: its a secret |

Posted: Mon Jul 20, 2009 3:50 am Post subject: |

shop smart, shop s-mart..... YA GOT THAT??!!?!? _________________ bah

Back to top |

MauveBib Joined: 04 Nov 2004 Posts: 602 |

Posted: Mon Jul 20, 2009 4:06 am Post subject: |

Effectively you need to create an AI with two states, searching and following. It will begin in the searching state, where every second or so it does a findradius to see if there's a player nearby. If there is it switches to the following state, where it chases after the player.
It's not too hard to code, but if you can't code it based on that breakdown you need to go off and learn so more qc first. Try a few more tutorials, especially the AI Cafe ones.
_________________
Apathy Now!

Back to top |

xaGe Joined: 01 Mar 2006 Posts: 329 Location: Upstate, New York |

Posted: Mon Jul 20, 2009 5:12 am Post subject: |

..And for the AI Cafe tutorials you will need to go here: http://quakewiki.net/archives/aicafe/tutorial/main.htm

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT Goto page 1, 2 Next
Page 1 of 2

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group