[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/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 - Help modifying code. Targeting System.

Help modifying code. Targeting System.

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Help modifying code. Targeting System.

Postby Blackstar1000 » Sat Dec 17, 2011 3:30 am

Knives out. Catch the mouse. Squash his head. Put him in your mouth.
Blackstar1000
 
Posts: 52
Joined: Mon Sep 13, 2010 5:16 pm

Re: Help modifying code. Targeting System.

Postby necros » Sat Dec 17, 2011 5:36 am

sure. you'll need to do a little bit more house keeping with a sprite, since it will be an actual entity, instead of a tempentity that is removed by the engine.

essentially, you just put in the standard spawning stuff in the place of the particle call:

entity guy;
guy = spawn();
setmodel(guy, "progs/guy.spr");
setorigin(guy, en1.origin);

the above will spawn a new entity with the guy sprite. now, for the house keeping:

guy.nextthink = time + 1; //some random time... whatever you want
guy.think = SUB_Remove; //remove after a while.

this will remove the sprite after 1 second.

now... i have no idea what the targeting system is, or how it works, but from your post, it looks like it just continuously spawns particles on the targetted entity.
this will probably not work well with the sprite. what you want is the sprite to spawn and stay spawned while the entity is targetted.
a simple (but wasteful) way of doing that would be to set guy.owner to en1.
then, before spawning the guy sprite, first check (again, with a nested while) if there is any entity spawned with .owner pointing to en1. if true, then bump the .nextthink a bit to avoid removing it and skip the spawning section.

edit: you'll also want to update the origin since the monster or whatever probably moved since the last time you checked.
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Re: Help modifying code. Targeting System.

Postby Blackstar1000 » Sun Dec 18, 2011 12:00 am

Ugh, Im still so confused. I just cant manage to spawn only one of them and I can't seem to get just one to follow the character around using your method. My understanding of quakeC is still inadequate. I would ask for someone to help clarify, I have wasted my only two nights off on this :|.

I just want to find the nearest entity and apply a sprite that will be tied to it as you get within a certain range. My starting place may have been wrong. It only seemed so right. These things were so easy in hammer ;(
Knives out. Catch the mouse. Squash his head. Put him in your mouth.
Blackstar1000
 
Posts: 52
Joined: Mon Sep 13, 2010 5:16 pm

Re: Help modifying code. Targeting System.

Postby tZork » Sat Dec 24, 2011 4:37 pm

tZork
 
Posts: 2
Joined: Tue Jun 21, 2011 8:59 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests