Inside3D!
     

Tutorial Requests
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Supa



Joined: 26 Oct 2004
Posts: 122

PostPosted: Sat Feb 13, 2010 10:13 pm    Post subject: Reply with quote

Quote:
So... I'm dusting this discussion off and am requesting for a generic tutorial that shows how to stick something to a player.

There really isn't that much to it. You just need to create your flag/arrow/etc as a helper entity with the stuck-to player as its' owner and depending on what engine you're targetting you could attach it in one of two ways.

If it *has* to work on every NQ engine, you'll need to have the helper entity think every server frame, updating its' origin and angles to match the .owner's angles every time. Keep in mind that this will produce choppier updates in MP as the server framerate will be running at sys_ticrate (usually 20fps by default in most NQ servers), SP runs a physics frame with every rendered frame iirc. Related to that, you'd probably want to cap origin/angles updates to 10~20/second and make sure you don't have _too_ many attached entities at any one time, this method has a capability of producing waaay too much network traffic.

If you're using DP, all you need to do just read up on DP_GFX_QUAKE3MODELTAGS here. You don't actually need the attachee to have any tags in order to attach something, calling setattachment without providing a tag name will just attach the entity to the attachee's origin.

I think QW is supposed to have an entity field for this, but since I don't have much gamecode experience in QW I'll leave it to someone who does. :)
Back to top
View user's profile Send private message Send e-mail
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Sat Feb 13, 2010 10:35 pm    Post subject: Reply with quote

how about a reload with animations? im sure iv seen a thread for it multiple times. a step by step im sure would be helpful.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Sat Feb 13, 2010 11:31 pm    Post subject: Centerprint Tutorial kind of thing! Reply with quote

This will make a onscreen centerprint for important events that is always there:

Code:

/*
 Centerprint Messenger
 By: Error
 
 In Defs.qc you  need to add this following at
 the bottom of the file:
 
 void(entity client, string s, string s, string s, string s, string s, string s, string s) centerprint7 = #73;
 .string message1, message2, message3, message4, message5, message6, message7;
*/

/*
 messenger_init ();
 sets all messages to blank with a few spaces
 to make the messages not move down when there
 are too many messages
 
 Put the Following Code in PutClientInServer ();
 located in client.qc:
 
    messenger_init ();
*/
void() messenger_init =
{
   self.message1 = "  \n";
   self.message2 = "  \n";
   self.message3 = "  \n";
   self.message4 = "  \n";
   self.message5 = "  \n";
   self.message6 = "  \n";
   self.message7 = "  \n";
};

/*
 add_message (entity slf, string new_mess);
 Moves all the messages up one when a new message
 is added to the queue.
 
 Anytime you want to add a message to the queue
 just call something like so:
 
   add_message (self, "You gained 15 health\n");
*/
void(entity slf, string new_mess) add_message =
{
   slf.message1 = slf.message2;
   slf.message2 = slf.message3;
   slf.message3 = slf.message4;
   slf.message4 = slf.message5;
   slf.message5 = slf.message6;
   slf.message6 = slf.message7;
   slf.message7 = new_mess;
};

/*
 messenger_main ();
 This is what makes your messages appear.  Special
 Note... since this will be called every frame, it
 will overwrite all other centerprints.
 
 Call this from PlayerPostThink in client.qc:
 
   messenger_main ();
*/
void() messenger_main =
{
   centerprint7 (self, self.message1, self.message2, self.message3, self.message4, self.message5, self.message6, self.message7);
};

_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Sat Feb 13, 2010 11:50 pm    Post subject: Reply with quote

i could see that code being used for a lot of things =)
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Sun Feb 14, 2010 12:24 am    Post subject: Reply with quote

indeed, I made one that used timers to get rid of messages too. maybe I'll upgrade it soon.
_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
lahore123



Joined: 14 Feb 2010
Posts: 1

PostPosted: Sun Feb 14, 2010 9:48 am    Post subject: Reply with quote

Have you upgraded it. please share with us. Thanks
_________________
הפצת ניוזלטר
יעוץ עסקי
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion All times are GMT
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
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