[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - makingmonsters hunt non-player entities

makingmonsters hunt non-player entities

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

makingmonsters hunt non-player entities

Postby hondobondo » Sat Feb 21, 2015 1:59 am

say i wanted to make a MOBA type game, where two armies each hunt for the enemies totem or whatever. now they just hunt for the player. the axe of command mod will make enemies hunt for monsters that aren't = owner, but how do i make them hunt for say an entity like a turret or fortress that sits in the middle of the map (or at one end of the map)

hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Re: makingmonsters hunt non-player entities

Postby Spike » Sat Feb 21, 2015 3:03 am

they go for players via the checkclient() builtin, which returns a different player 10 times a second or something stupid like that. you'd need to call some custom qc function that returns your turret or whatever instead.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: makingmonsters hunt non-player entities

Postby hondobondo » Sat Feb 21, 2015 3:50 am


hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Re: makingmonsters hunt non-player entities

Postby frag.machine » Sun Feb 22, 2015 5:05 am

You need to change FindTarget, make them look for entities with different .team values.
EDIT: spell
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Re: makingmonsters hunt non-player entities

Postby PrimalLove » Sun Feb 22, 2015 6:24 am

@hondobondo

It may be helpful if you posted some code for review to see if you made any errors. Also, not sure if you are spawning an entity model or whatever for this totem but for the record, findradius will not return SOLID_NOT solid type entities. You can get around this problem in DP with sv_gameplayfix_blowupfallenzombies cvar. It is a shot in the dark that this is the problem but thought I'd mention it.
PrimalLove
 
Posts: 14
Joined: Sun Oct 19, 2014 2:37 am

Re: makingmonsters hunt non-player entities

Postby hondobondo » Tue Feb 24, 2015 7:32 am


hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Re: makingmonsters hunt non-player entities

Postby PrimalLove » Tue Feb 24, 2015 9:21 pm

Here are a couple of suggestions:

1. Place a few bprints in there so you can see where things are getting hung up.
2. How many of these turret monster things are you spawning? If it is like one or two per map I'd suggest not using findradius because the distance you are searching, plus the fact that all the monsters will be running this same routine you might want to consider a different method to alert them to the enemy.
3. Do any of the monsters actually have a self.owner? I ask because I see alot of additional conditions in your while statement that may just not even need to be there. If none of them do you can also get rid of the last self.goalentity stuff at the bottom of the function because its not needed. But if some of them do indeed have a self.owner then I suppose this is fine. I also question the head.owner != self.owner but I am not sure of how the rest of your mod works so I am going to assume this is a condition you need. It may not be best to put it in the first if statement tho.
4. The purpose of your while statement as I see it is to find the closest enemy possible by walking through the list of potential enemies and setting the dist each time to keep track of different locations of enemies as you walk through the list. It appears tho you are not actually using it in this way. Instead restricting it to only the one entity you hope to find? I say this because even if you have multiple turret monsters, it will return after the first one it finds. Making setting the dist afterwards rather pointless. As it is now it will just go after the first turret it finds. I'd suggest setting it to selected as you were previously and not having head.classname in your traceline condition statement. Without a bit more information about how your mod is intended to work I have nothing specifically I can point to that would lead me to think it wouldn't work other than some things I pointed out before that may be causing problems.
5. If the self.owner stuff is not needed and you only plan for them to look for one turret per map you can greatly shorten this routine up and make it much more efficient. Hard to stay for sure without a bit more info.
PrimalLove
 
Posts: 14
Joined: Sun Oct 19, 2014 2:37 am

Re: makingmonsters hunt non-player entities

Postby hondobondo » Tue Mar 10, 2015 3:47 pm

ok what i wanted to do was spawn monsters that would hunt this single stationary entity and attack it like DOTA/LOL or somesuch, and the player would have to defend it. ideally there would be two entities for two different teams, but one would be fine to start

hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Re: makingmonsters hunt non-player entities

Postby frag.machine » Wed Mar 11, 2015 12:30 am

I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest