Re: [hlcoders] Shared Entities
I guess that'd explain why. However, what could be a solution to drawing information from that entity? Would it be a possible solution to make another entity on the server? Do the entities that share information have to be inherited from the same type of class (I mean C_BaseEntity and CBaseEntity) or does it have to be an entity meant to share information? The arena code isn't mine, so I don't want to actually modify it I just want to pull information from it. 2011/2/15 Saul Rennison saul.renni...@gmail.com Logical entities aren't networked afaik On Tuesday, 15 February 2011, Bryan Abrams abrams@gmail.com wrote: Hey Guys, I've read over the wiki entry about Network entities and creating shared variables, but I can't really seem to get it to work. The entity is already created on the server, an 'arena'. It inherits CLogicalEntity and contains information like the name of the field, id, etc etc. The data table for sharing information is setup. I want to be able to get this information from the server so I can display such things in a VGUI menu. The problem I'm having is I'm not sure how to actually setup the client side. I set the LINK_ENTITY_TO_CLASS( hammer_ent, C_ArenaEntity ) and I inherit C_BaseEntity. My first general impression was when that entity is found by the client on the map, then it establishes a class and because I have the client/server data tables it'll share the information (I've already created the network entities for such things.) When debugging the code however, as soon as the game starts it goes directly to the client datatable and never reaches during loading of the map, like the server side does. Maybe I'm just over analyzing it or making it a bit more difficult then it actually is, but I can't really seem to wrap my head around it. Any help at all would be great. Thank you! -- Thanks, - Saul. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Shared Entities
Being server-only is something that CLogicalEntity does. If you inherit from CBaseEntity you'll be fine, and switching shouldn't cause any problems. http://developer.valvesoftware.com/wiki/Edict_t On 15/02/2011 12:49, Bryan Abrams wrote: I guess that'd explain why. However, what could be a solution to drawing information from that entity? Would it be a possible solution to make another entity on the server? Do the entities that share information have to be inherited from the same type of class (I mean C_BaseEntity and CBaseEntity) or does it have to be an entity meant to share information? The arena code isn't mine, so I don't want to actually modify it I just want to pull information from it. 2011/2/15 Saul Rennison saul.renni...@gmail.com mailto:saul.renni...@gmail.com Logical entities aren't networked afaik On Tuesday, 15 February 2011, Bryan Abrams abrams@gmail.com mailto:abrams@gmail.com wrote: Hey Guys, I've read over the wiki entry about Network entities and creating shared variables, but I can't really seem to get it to work. The entity is already created on the server, an 'arena'. It inherits CLogicalEntity and contains information like the name of the field, id, etc etc. The data table for sharing information is setup. I want to be able to get this information from the server so I can display such things in a VGUI menu. The problem I'm having is I'm not sure how to actually setup the client side. I set the LINK_ENTITY_TO_CLASS( hammer_ent, C_ArenaEntity ) and I inherit C_BaseEntity. My first general impression was when that entity is found by the client on the map, then it establishes a class and because I have the client/server data tables it'll share the information (I've already created the network entities for such things.) When debugging the code however, as soon as the game starts it goes directly to the client datatable and never reaches during loading of the map, like the server side does. Maybe I'm just over analyzing it or making it a bit more difficult then it actually is, but I can't really seem to wrap my head around it. Any help at all would be great. Thank you! -- Thanks, - Saul. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Shared Entities
Logical entities aren't networked afaik On Tuesday, 15 February 2011, Bryan Abrams abrams@gmail.com wrote: Hey Guys, I've read over the wiki entry about Network entities and creating shared variables, but I can't really seem to get it to work. The entity is already created on the server, an 'arena'. It inherits CLogicalEntity and contains information like the name of the field, id, etc etc. The data table for sharing information is setup. I want to be able to get this information from the server so I can display such things in a VGUI menu. The problem I'm having is I'm not sure how to actually setup the client side. I set the LINK_ENTITY_TO_CLASS( hammer_ent, C_ArenaEntity ) and I inherit C_BaseEntity. My first general impression was when that entity is found by the client on the map, then it establishes a class and because I have the client/server data tables it'll share the information (I've already created the network entities for such things.) When debugging the code however, as soon as the game starts it goes directly to the client datatable and never reaches during loading of the map, like the server side does. Maybe I'm just over analyzing it or making it a bit more difficult then it actually is, but I can't really seem to wrap my head around it. Any help at all would be great. Thank you! -- Thanks, - Saul. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Do entities need to think to process things like being Hit, etc?
I believe you have to set m_takedamage = DAMAGE_YES; in your entity, or else OnTakeDamage won't get called Jorge Rodriguez wrote: Got me. I think there's a flag somewhere that turns OnTakeDamage on and off. Look around in the base entity damage functions. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Do entities need to think to process things like being Hit, etc?
I think what you want to do would be done best not through thinking but with the entity OnUse and OnTakeDamage functions. Check out how things like buttons and breakables do that. To answer your question no I don't think entities need to have a think function in order to process other things. -- Jorge Vino Rodriguez ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Do entities need to think to process things like being Hit, etc?
I've gotten OnUse working with: virtual intObjectCaps( void ) { return BaseClass::ObjectCaps() | FCAP_IMPULSE_USE; }; virtual voidUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); Can't get OnTakeDamage working though, I have: virtual intOnTakeDamage( const CTakeDamageInfo inputInfo ); In the header of my entity, but it doesn't fire in game Do I need another part of ObjectCaps? Either way I now have a basic health system working (Still using an input to remove life since I can't get OTD to work) so that's good. Thanks! On Fri, Mar 26, 2010 at 10:03 PM, Jorge Rodriguez bs.v...@gmail.com wrote: I think what you want to do would be done best not through thinking but with the entity OnUse and OnTakeDamage functions. Check out how things like buttons and breakables do that. To answer your question no I don't think entities need to have a think function in order to process other things. -- Jorge Vino Rodriguez ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Do entities need to think to process things like being Hit, etc?
Got me. I think there's a flag somewhere that turns OnTakeDamage on and off. Look around in the base entity damage functions. -- Jorge Vino Rodriguez ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Counting entities within a Custom Brush
How about making a trigger_multiple -alike brush entity that counts the number of entities in it. Everytime something new touches it, it increments an integer, and decreases it when the entities leave it. - Original Message - From: n...@perforated-art.com To: hlcoders@list.valvesoftware.com Sent: Wednesday, March 11, 2009 8:35 PM Subject: [hlcoders] Counting entities within a Custom Brush I'm new to Source development and would like to get an idea for the best way to approach my problem before embarking on writing any code: In a mulitplayer team-based environment I'd like to count the number of specific entities placed within a Custom Brush's radius. The number of entities within the brushes radius contributes directly to a particular teams score and I'd like to periodically increase a teams score over time. Essentially then, I'm looking to check for the number of entities within a Custom Brushes radius at set intervals. In my mind there are two ways of approaching this. The first is to have the brushes think() function count the entities and deal with them accordingly. The second is to have the CGameRules class search the level for any of these Custom Brushes and then count the number of entities within them (again, at set intervals). Being new to Source, I imagine the first approach would trigger a Logic Entity (such as math_counter). Of course, the problem here is that I'd like to allow for multiple Custom Brushes, so I think my second solution seems more flexible, in this regard (especially seeing as how the number of objects within a teams collection of Custom Brushes _can_ result in the victory of a round). How would you approach this? Secondly, what do people consider 'good practice' with regards to custom Game Rules? Do you subclass CGameRules (or some equivalent class), or do you edit directly (as a number of tutorial on the VALVe Wiki suggest?) Basically, I'd just like feedback from people with more experience to see if I'm heading in the right direction. I don't want to jump in at the deep end and sink! ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Counting entities within a Custom Brush
You can use the trigger_multiple method with multiple disjoint brushes. The various brush volumes would act as a single trigger. You would need a trigger_multiple, a filter_activator_class, and a math_counter to do this. Set the filter to only pass entities of the class that you are interested in, then hook up entity I/O as follows: trigger_multiple.OnStartTouch - math_counter.Add(1) trigger_multiple.OnEndTouch - math_counter.Subtract(1) trigger_multiple.OnEndTouchAll - math_counter.SetValue(0) -Original Message- From: hlcoders-boun...@list.valvesoftware.com [mailto:hlcoders-boun...@list.valvesoftware.com] On Behalf Of Jonas 'Sortie' Termansen Sent: Wednesday, March 11, 2009 2:13 PM To: Discussion of Half-Life Programming Subject: Re: [hlcoders] Counting entities within a Custom Brush How about making a trigger_multiple -alike brush entity that counts the number of entities in it. Everytime something new touches it, it increments an integer, and decreases it when the entities leave it. - Original Message - From: n...@perforated-art.com To: hlcoders@list.valvesoftware.com Sent: Wednesday, March 11, 2009 8:35 PM Subject: [hlcoders] Counting entities within a Custom Brush I'm new to Source development and would like to get an idea for the best way to approach my problem before embarking on writing any code: In a mulitplayer team-based environment I'd like to count the number of specific entities placed within a Custom Brush's radius. The number of entities within the brushes radius contributes directly to a particular teams score and I'd like to periodically increase a teams score over time. Essentially then, I'm looking to check for the number of entities within a Custom Brushes radius at set intervals. In my mind there are two ways of approaching this. The first is to have the brushes think() function count the entities and deal with them accordingly. The second is to have the CGameRules class search the level for any of these Custom Brushes and then count the number of entities within them (again, at set intervals). Being new to Source, I imagine the first approach would trigger a Logic Entity (such as math_counter). Of course, the problem here is that I'd like to allow for multiple Custom Brushes, so I think my second solution seems more flexible, in this regard (especially seeing as how the number of objects within a teams collection of Custom Brushes _can_ result in the victory of a round). How would you approach this? Secondly, what do people consider 'good practice' with regards to custom Game Rules? Do you subclass CGameRules (or some equivalent class), or do you edit directly (as a number of tutorial on the VALVe Wiki suggest?) Basically, I'd just like feedback from people with more experience to see if I'm heading in the right direction. I don't want to jump in at the deep end and sink! ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Map entities on the client
I don't think it is possible from the client On 7/27/07, Richard Slaughter [EMAIL PROTECTED] wrote: Hi, I'm currently working on the radar for our mod and I'm just wondering if it's possible to access entities specified in the map on the client. I want to do this so that I can show the nearest of a certain type of entity on the radar without having to send that information from the server to the client. Firstly is this possible, i.e. is there something similar to FindEntityByClassname on the client, ClientEntityList() doesn't seem to offer anything like this, leading me to believe that map entities aren't created on the client unless they're network entities? Secondly is this even advisable, or is it just better to send that data from the server to the client? Thanks R. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Map entities on the client
it is. do a find in files for the string cl_entitylist and you will see how its used. this question has come up twice before: http://www.mail-archive.com/search?q=cl_entitylistl=hlcoders%40list.valvesoftware.com On 7/30/07, Nick [EMAIL PROTECTED] wrote: I don't think it is possible from the client ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
What you need to do is merge the PVS/PAS of the bot and the player. SetupVisibility() is where the server DLL can set the PVS to be used in AddToFullPack(). The default implementation just asks the engine to calculate the PVS for the current view entitity. You could ask the engine to calculate the PVS for two viewpoints, but if the engine's implementation of SV_SetFatPVS() is the same as Quake's then this won't work: the PVS is cleared at the start of each call. What you can do is memcopy() the PVS calculated into a buffer and bitwise-or each additional PVS you need, then return a pointer to the buffer. I'm almost certain this would work, although I haven't tested it :) Something like this (again, untested): void SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) { Vector org; edict_t *pView = pClient; static unsigned char visBuffer[MAX_MAP_LEAFS / 8]; // Find the client's PVS if ( pViewEntity ) { pView = pViewEntity; } org = pView-v.origin + pView-v.view_ofs; if ( pView-v.flags FL_DUCKING ) { org = org + ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN ); } *pvs = ENGINE_SET_PVS ( (float *)org ); *pas = ENGINE_SET_PAS ( (float *)org ); memcpy( visBuffer, pvs, MAX_MAP_LEAFS / 8 ); for (/* each additional viewpoint */) { *pvs = ENGINE_SET_PVS( /* viewpoint */ ); for (int i = 0; i sizeof pvsBuffer; i++) pvsBuffer[i] |= pvs[i]; } *pvs = pvsBuffer; } From: TheLazy1 [EMAIL PROTECTED] What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders - Email sent from www.ntlworld.com Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
Thanks for that info but the additional viewpoint code causes a crash. Maybe I could send all the entities anyway and filter out the non visible ones client-side? [EMAIL PROTECTED] wrote: What you need to do is merge the PVS/PAS of the bot and the player. SetupVisibility() is where the server DLL can set the PVS to be used in AddToFullPack(). The default implementation just asks the engine to calculate the PVS for the current view entitity. You could ask the engine to calculate the PVS for two viewpoints, but if the engine's implementation of SV_SetFatPVS() is the same as Quake's then this won't work: the PVS is cleared at the start of each call. What you can do is memcopy() the PVS calculated into a buffer and bitwise-or each additional PVS you need, then return a pointer to the buffer. I'm almost certain this would work, although I haven't tested it :) Something like this (again, untested): void SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) { Vector org; edict_t *pView = pClient; static unsigned char visBuffer[MAX_MAP_LEAFS / 8]; // Find the client's PVS if ( pViewEntity ) { pView = pViewEntity; } org = pView-v.origin + pView-v.view_ofs; if ( pView-v.flags FL_DUCKING ) { org = org + ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN ); } *pvs = ENGINE_SET_PVS ( (float *)org ); *pas = ENGINE_SET_PAS ( (float *)org ); memcpy( visBuffer, pvs, MAX_MAP_LEAFS / 8 ); for (/* each additional viewpoint */) { *pvs = ENGINE_SET_PVS( /* viewpoint */ ); for (int i = 0; i sizeof pvsBuffer; i++) pvsBuffer[i] |= pvs[i]; } *pvs = pvsBuffer; } From: TheLazy1 [EMAIL PROTECTED] What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders - Email sent from www.ntlworld.com Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
On Wednesday 29 November 2006 1:36 pm, TheLazy1 wrote: Thanks for that info but the additional viewpoint code causes a crash. Maybe I could send all the entities anyway and filter out the non visible ones client-side? That would sort of negate the whole point of PVS in: 1. Reducing bandwidth requirements. 2. Cheating prevention. ;-) -John Sheu ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
Well, split screen play would be limited to listenservers and not allow more than one real client to be connected. Another issue is that if player one is underwater, the second viewport will get the underwater fog effect applied to it. I assume that is being done by the engine so I don't know if it's possible to fix that or not. I might have better luck with HL2 but my computer can barely handle 1 viewport :) John Sheu wrote: On Wednesday 29 November 2006 1:36 pm, TheLazy1 wrote: Thanks for that info but the additional viewpoint code causes a crash. Maybe I could send all the entities anyway and filter out the non visible ones client-side? That would sort of negate the whole point of PVS in: 1. Reducing bandwidth requirements. 2. Cheating prevention. ;-) -John Sheu ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
-- [ Picked text/plain from multipart/alternative ] Thanks for bringing this function to my attention, I was able to add another origin point to the PVS system however i still get some minor flickers. I'd still like to find a way to enter individual entities into the list of displayed entities, clientside if possible, since theres no possible cheating that can be done by displaying the entity I want. On 11/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: What you need to do is merge the PVS/PAS of the bot and the player. SetupVisibility() is where the server DLL can set the PVS to be used in AddToFullPack(). The default implementation just asks the engine to calculate the PVS for the current view entitity. You could ask the engine to calculate the PVS for two viewpoints, but if the engine's implementation of SV_SetFatPVS() is the same as Quake's then this won't work: the PVS is cleared at the start of each call. What you can do is memcopy() the PVS calculated into a buffer and bitwise-or each additional PVS you need, then return a pointer to the buffer. I'm almost certain this would work, although I haven't tested it :) Something like this (again, untested): void SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) { Vector org; edict_t *pView = pClient; static unsigned char visBuffer[MAX_MAP_LEAFS / 8]; // Find the client's PVS if ( pViewEntity ) { pView = pViewEntity; } org = pView-v.origin + pView-v.view_ofs; if ( pView-v.flags FL_DUCKING ) { org = org + ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN ); } *pvs = ENGINE_SET_PVS ( (float *)org ); *pas = ENGINE_SET_PAS ( (float *)org ); memcpy( visBuffer, pvs, MAX_MAP_LEAFS / 8 ); for (/* each additional viewpoint */) { *pvs = ENGINE_SET_PVS( /* viewpoint */ ); for (int i = 0; i sizeof pvsBuffer; i++) pvsBuffer[i] |= pvs[i]; } *pvs = pvsBuffer; } From: TheLazy1 [EMAIL PROTECTED] What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders - Email sent from www.ntlworld.com Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
I tried again and managed to get that code working but only when I used a cheap hack. For some reason I cannot just do pvsBuffer[ x ] |= *pvs[ x ] since it'll just crash, I can however memcpy it into a buffer and do the bitwise OR later. Should I do this with PAS aswell? [EMAIL PROTECTED] wrote: What you need to do is merge the PVS/PAS of the bot and the player. SetupVisibility() is where the server DLL can set the PVS to be used in AddToFullPack(). The default implementation just asks the engine to calculate the PVS for the current view entitity. You could ask the engine to calculate the PVS for two viewpoints, but if the engine's implementation of SV_SetFatPVS() is the same as Quake's then this won't work: the PVS is cleared at the start of each call. What you can do is memcopy() the PVS calculated into a buffer and bitwise-or each additional PVS you need, then return a pointer to the buffer. I'm almost certain this would work, although I haven't tested it :) Something like this (again, untested): void SetupVisibility( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas ) { Vector org; edict_t *pView = pClient; static unsigned char visBuffer[MAX_MAP_LEAFS / 8]; // Find the client's PVS if ( pViewEntity ) { pView = pViewEntity; } org = pView-v.origin + pView-v.view_ofs; if ( pView-v.flags FL_DUCKING ) { org = org + ( VEC_HULL_MIN - VEC_DUCK_HULL_MIN ); } *pvs = ENGINE_SET_PVS ( (float *)org ); *pas = ENGINE_SET_PAS ( (float *)org ); memcpy( visBuffer, pvs, MAX_MAP_LEAFS / 8 ); for (/* each additional viewpoint */) { *pvs = ENGINE_SET_PVS( /* viewpoint */ ); for (int i = 0; i sizeof pvsBuffer; i++) pvsBuffer[i] |= pvs[i]; } *pvs = pvsBuffer; } From: TheLazy1 [EMAIL PROTECTED] What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders - Email sent from www.ntlworld.com Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
-- [ Picked text/plain from multipart/alternative ] I too have been looking for something similar. I have entities that I render on the client that aren't in the client's view according to the server so the entity model flickers in and out when it drags just out of my view and back in. I need to set it to be shown even if its not in the PVS. On 11/28/06, TheLazy1 [EMAIL PROTECTED] wrote: What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
You guys should take a look at how the camera/monitor code does it, as that adds another viewpoint to be rendered that is potentially far from the client. I haven't looked myself, so I can't offer any more than that suggestion right now. From: Joel R. [EMAIL PROTECTED] Reply-To: hlcoders@list.valvesoftware.com To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] Sending entities to the client that only a bot can see Date: Tue, 28 Nov 2006 13:48:01 -0600 -- [ Picked text/plain from multipart/alternative ] I too have been looking for something similar. I have entities that I render on the client that aren't in the client's view according to the server so the entity model flickers in and out when it drags just out of my view and back in. I need to set it to be shown even if its not in the PVS. On 11/28/06, TheLazy1 [EMAIL PROTECTED] wrote: What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Get free, personalized commercial-free online radio with MSN Radio powered by Pandora http://radio.msn.com/?icid=T002MSN03A07001 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
-- [ Picked text/plain from multipart/alternative ] You can add a point to the player's PVS. The render target camera does it so you can see what it sees. It's serverside and it's something really simple. On 11/28/06, Joel R. [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] I too have been looking for something similar. I have entities that I render on the client that aren't in the client's view according to the server so the entity model flickers in and out when it drags just out of my view and back in. I need to set it to be shown even if its not in the PVS. On 11/28/06, TheLazy1 [EMAIL PROTECTED] wrote: What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Sending entities to the client that only a bot can see
I should have mentioned earlier that this is for Half-Life 1, however, if what you said still applies are there any docs outlining that? Garry Newman wrote: -- [ Picked text/plain from multipart/alternative ] You can add a point to the player's PVS. The render target camera does it so you can see what it sees. It's serverside and it's something really simple. On 11/28/06, Joel R. [EMAIL PROTECTED] wrote: -- [ Picked text/plain from multipart/alternative ] I too have been looking for something similar. I have entities that I render on the client that aren't in the client's view according to the server so the entity model flickers in and out when it drags just out of my view and back in. I need to set it to be shown even if its not in the PVS. On 11/28/06, TheLazy1 [EMAIL PROTECTED] wrote: What I'm trying to do is add split screen play to half-life deathmatch, currently I have the client rendering from the view of a bot which in the future will be controlled by additional players through player 1. The problem is that once player one leaves the area of the player two bot, the entities in the bot's view disappear. // Ignore if not the host and not touching a PVS/PAS leaf // If pSet is NULL, then the test will always succeed and the entity will be added to the update if ( ent != host ) { if ( !ENGINE_CHECK_VISIBILITY( (const struct edict_s *)ent, pSet ) ) { return 0; } } Commenting that code fixes the problem but also causes the client to render every entity in the level causing a noticable drop in performance. Are there any ways around this? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] findind entities client side
You can use ClientEntityList().GetClientEntity(int index), however you'll run into problems unless all your server entities also exist on the client. For instance, you may well have entities which exist server-side only (such as your control points). In this case, user messages are probably a better option - you could have control points on the server send out update messages every so often. Alternatively, if you're happier with the entity code, just create stub classes for your control points c client-side, just so that the client knows about their existence and position. -Original Message- From: Draco [mailto:[EMAIL PROTECTED] Sent: 25 August 2005 12:02 To: hlcoders@list.valvesoftware.com Subject: [hlcoders] findind entities client side Hi, just a quick question. I have a VGUI panel that is going to display the status of control points on the map. The entity we are using to place these points has a client side class too so I want to be able to grab the info from the client version instead of using user messages. I was about to use the gEntList.FindEntityByClassname function then I noticed it's never used client side. Is there a client equilivant to this? I need to search for every ent with the classname flag and get info from them. Or is this a job for user messages? -- Draco ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ Information contained in this e-mail is intended for the use of the addressee only, and is confidential and may be the subject of Legal Professional Privilege. Any dissemination, distribution, copying or use of this communication without prior permission of the addressee is strictly prohibited.The views of the author may not necessarily constitute the views of Kuju Entertainment Ltd. Nothing in this email shall bind Kuju Entertainment Ltd in any contract or obligation. The contents of an attachment to this e-mail may contain software viruses which could damage your own computer system. While Kuju Entertainment has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening the attachment. __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email _ ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] findind entities client side
Thanks, I'll try that :D -- Draco ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Resetting Entities on Round Restart @ Handy Vandal's Almanac
-- [ Picked text/plain from multipart/alternative ] Yay, some topic I made :D I didn't make this how ever, but I got help from the guy who wrote this(I be live he posted in this topic) and I came up with a very similar solution. http://www.sourcewiki.org/wiki/index.php/Resetting_the_Map On 6/27/05, Karl Jones [EMAIL PROTECTED] wrote: I have posted a summary of the long-running (and very interesting) Resetting Entities on Round Restart thread, here on the Handy Vandal's Almanac -- http://www.karljones.com/halflife2/main.asp?chapter=183 Karl ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- - Ben Davison - http://www.shadow-phoenix.com -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Creating Entities in a server plug-in
You can use the interfaces exported by the IVEngine interface. What you shouldn't do is send network messages directly to clients (as the format and features of those messages are between the game dll and client dll, not third party code). The general rule is that if the interface comes from the engine (or another base binary) then you can use it, if its from the game dll then don't touch it. - Alfred Original Message From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael A. Hobson Sent: Friday, May 20, 2005 2:19 PM To: HLCoders Subject: [hlcoders] Creating Entities in a server plug-in Alfred, et al., Hiya. Well, now that we have been reminded that it is bad juju to depend upon any undocumented interfaces, I need to ask the *right way* to do something which is not going to disappear on me later. Specifically, what engine interface should I be using to create a visible entity with arbitrary position and orientation in-game from a server plug-in? Can I create an entity with an arbitrary .MDL this way? Can I create a 2D sprite this way? What about a persistent texture decal ? I've been examining the plug-in codebase and it is unclear whether we can use arbitrary engine interfaces in server plugins and also unclear (to me at least), which one lets me add entities to the game from a plug-in (something that was pretty trivial to do with Metamod). Michael A. Hobson email: [EMAIL PROTECTED] (310) 344-3585 (cell) ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
David Anderson wrote: while (!FNullEnt(tEnt)) { const char *model = STRING(model); Sorry, spent a few days doing other stuff, but found the problem :) const char *model = STRING(tEnt-v.model); Nice function, and thanks for your help. And apologies to valve for accusing them for breaking something they hadn't :) Matt. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Removing entities
1] You cannot add new spawns dynamically to CS 1.6 anymore. 2] You cannot remove spawns dynamically from CS 1.6 anymore. Double check how you were creating entities as CREATE_NAMED_ENTITY() and REMOVE_ENTITY() work fine in CS 1.6. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Removing entities
No, they don't. As has been stated before, they are cached internally. When I delete or add spawns, I get spawned at 0,0,0 and then the game crashes. You can CREATE_NAMED_ENTITY() just about anything but a spawn point, and you can REMOVE_ENTITY() only things you created with CREATE_NAMED_ENTITY(). This may have changed since I first found this out (mid February), but try it yourself... -David BAILOPAN Anderson On Fri, 30 Apr 2004, Deadman Standing wrote: 1] You cannot add new spawns dynamically to CS 1.6 anymore. 2] You cannot remove spawns dynamically from CS 1.6 anymore. Double check how you were creating entities as CREATE_NAMED_ENTITY() and REMOVE_ENTITY() work fine in CS 1.6. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
Help! (I have never coded for 1.5, but I am beginning to wish I had. Are they going to make it this hard for us to do stuff in HL2?) The DeleteCSWeapon is not working for me. DeleteCSWeapon(models/w_awp.mdl,weapon_awp,index); Am I using this wrong? If I call this function when the player is carrying an AWP and there is also an AWP on the floor, the server crashes. Here is my code (I added your solidstate stuff to it): void GiveNamedItem(edict_t *pEdict, const char *pszName) { if(strncmp(pszName,weapon_,7) == 0|| strncmp(pszName,item_,5) == 0|| strncmp(pszName,ammo_,5) == 0) { edict_t *pent; int istr = MAKE_STRING(pszName); pent = CREATE_NAMED_ENTITY(istr); if(FNullEnt(pent)) { ALERT(at_console, NULL Ent in GiveNamedItem!\n); return; } VARS(pent)-origin = VARS(pEdict)-origin; pent-v.spawnflags |= SF_NORESPAWN; (*gpGamedllFuncs-dllapi_table-pfnSpawn)(pent); int solidstate = pent-v.solid; (*gpGamedllFuncs-dllapi_table-pfnTouch)(pent, pEdict); if(pent-v.solid == solidstate) REMOVE_ENTITY(pent); } } And your code copied as is (pretty much). void DeleteWeapon(char *weaponmodel, char *weapon, int player) { edict_t *pPlayer = INDEXENT(player); edict_t *tEnt = FIND_ENTITY_BY_STRING(NULL, classname, weaponbox); edict_t *wEnt = NULL; while (!FNullEnt(tEnt)) { const char *model = STRING(model); UTIL_LogPrintf(DeleteWeapon: %s\n,model); if (strcmp(model, weaponmodel) == 0) { if (ENTINDEX(tEnt-v.owner) == player) { wEnt = FIND_ENTITY_BY_STRING(NULL, classname, weapon); while (!FNullEnt(wEnt)) { if (ENTINDEX(wEnt-v.owner) == ENTINDEX(tEnt)) { RemoveWeapon(wEnt); } wEnt = FIND_ENTITY_BY_STRING(wEnt, classname, weapon); } //finding wEnts } //owners matched RemoveWeapon(tEnt); } //weapon matched tEnt = FIND_ENTITY_BY_STRING(tEnt, classname, weaponbox); } //finding tEnts } ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Removing entities
Aw by spawn you mean creating the entities: info_player_deathmatch, info_player_start, or info_vip_start, if I understand you correctly? Never tried those. I know removing any of the entities that originate in a map is problematic. I can say I have never had issues adding or removing the entities: info_target, func_wall, or trigger_auto as I use them all the time. If I get some spare time I'll try playing with the spawn entities. No, they don't. As has been stated before, they are cached internally. When I delete or add spawns, I get spawned at 0,0,0 and then the game crashes. You can CREATE_NAMED_ENTITY() just about anything but a spawn point, and you can REMOVE_ENTITY() only things you created with CREATE_NAMED_ENTITY(). This may have changed since I first found this out (mid February), but try it yourself... ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
along the same lines.. i made a mod that worked for 1.5 that gave every player all weapons, now in 1.6 it get to 4/5 and crashes, the code im using is: for (int i=0;iMAX_CWEAPONS;i++) { edict_t *r = CREATE_NAMED_ENTITY(MAKE_STRING(cWeapons[i])); r-v.spawnflags |= SF_NORESPAWN; r-v.origin = a-v.origin + Vector(1,1,1); pEntity = (CBaseEntity *)GET_PRIVATE(r); if (pEntity) { pEntity-pev-absmin = pEntity-pev-origin - Vector(1,1,1); pEntity-pev-absmax = pEntity-pev-origin + Vector(1,1,1); pEntity-Spawn(); } } anyone have any ideas why it crashes? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Removing entities
I just did a test of creating an info_player_deathmatch entity (Terrorist spawn point in CS) and had no server crash. I was also able to remove the spawn point without a crash. I can not guarantee that hlds actually would use the spawn point since I have no easy way of testing that functionality. I looked back in the emails and found your original question David posted on 2/15/2004 about your deathmatch mod. My geuss your problem steamed from: I have tried blocking REMOVE_ENTITY calls from the CS Engine, and that sort of works... not. CS is still making illegal calls (and apparently, doesn't check to see if they're valid or not). The basic rule seems to be create it through api calls, free it through api calls. Don't tamper with its free mechanism or pointers will get unhappy :) I can see blocking the REMOVE_ENTITY call as a procedure that would get the cache out of sync. Hope this helps. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Anderson Sent: Friday, April 30, 2004 12:01 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] Removing entities No, they don't. As has been stated before, they are cached internally. When I delete or add spawns, I get spawned at 0,0,0 and then the game crashes. You can CREATE_NAMED_ENTITY() just about anything but a spawn point, and you can REMOVE_ENTITY() only things you created with CREATE_NAMED_ENTITY(). This may have changed since I first found this out (mid February), but try it yourself... -David BAILOPAN Anderson On Fri, 30 Apr 2004, Deadman Standing wrote: 1] You cannot add new spawns dynamically to CS 1.6 anymore. 2] You cannot remove spawns dynamically from CS 1.6 anymore. Double check how you were creating entities as CREATE_NAMED_ENTITY() and REMOVE_ENTITY() work fine in CS 1.6. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Removing entities
You are referencing CBaseEntity. Since we do not have the schema they use for that class is CS you would get crashes. It appears the class schema differs between the SDK and Counter-Strike. Methods or attributes were probability added to the classes. Bottom line is you can only access edict_t data types and can use none of the SDK class hierarchy. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Sent: Friday, April 30, 2004 4:18 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Removing entities along the same lines.. i made a mod that worked for 1.5 that gave every player all weapons, now in 1.6 it get to 4/5 and crashes, the code im using is: for (int i=0;iMAX_CWEAPONS;i++) { edict_t *r = CREATE_NAMED_ENTITY(MAKE_STRING(cWeapons[i])); r-v.spawnflags |= SF_NORESPAWN; r-v.origin = a-v.origin + Vector(1,1,1); pEntity = (CBaseEntity *)GET_PRIVATE(r); if (pEntity) { pEntity-pev-absmin = pEntity-pev-origin - Vector(1,1,1); pEntity-pev-absmax = pEntity-pev-origin + Vector(1,1,1); pEntity-Spawn(); } } anyone have any ideas why it crashes? ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
Matt Judge wrote: I have seen a number of posts and articales on this, is there any chance that you can enable people to remove entities without crashing the server? Huh? Are you talking about removing entities from the SDK (or from a MOD)? If it's MOD related, whether you can remove and entity or not would depend on what the MOD used it for. As an example, maps would be completely useless if you remove the player spawn point entity from them. We can spawn entities, look them up, modify certain aspects, why the hell can't we delete them? You can. Please can we have this *bug* fixed. I see this as a setback to anyone trying to create a mod. What entities specifically can't you remove if you are creating your own MOD? -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
Jeffrey botman Broome wrote: We can spawn entities, look them up, modify certain aspects, why the hell can't we delete them? You can. Please can we have this *bug* fixed. I see this as a setback to anyone trying to create a mod. What entities specifically can't you remove if you are creating your own MOD? Oh, this looks like I have got the wrong end of the stick :) I am looking to be able to add or remove spawn points, and also remove weapons from the CS. Is this possible? This is all new to me, and I am only part way through coding my first plugin for metamod. google searches and other peoples code have been invaluable in finding most things I needed to know. I have even downloaded the archived hlcoders mailing list before posting, and my interpretation of previous posts was that weapons could not be removed from the game. 2 other questions I have :) 1) Is there a way to force a client to drop a weapon without issuing the CLIENT_COMMAND(pEntity, drop)? 2) Is there an easy way to see if a shield is being carried but not deployed? I have these 2 bits of code which hint on a solution, but I am hoping that asking here will give me a better insight. // Block Server-Crash exploit if( pPlayer-v.sequence == 86 ) // Block shield exploit if( pPlayer-v.sequence == 98 ) Cheers, Matt. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
Matt Judge wrote: I am looking to be able to add or remove spawn points, and also remove weapons from the CS. Is this possible? Yes. There are many people that have taken the standard 20 player maps and made 32 player maps from them. If you want to play around with a metamod plugin that allows dynamically adding and remove stuff to/from a map, take a look at my Stripper2 plugin... http://planethalflife.com/botman/stripper2.shtml Make sure that spawn points that are added to the map aren't placed to close to world geometry that would collide with the player (otherwise the player will be stuck and can't move). 2 other questions I have :) 1) Is there a way to force a client to drop a weapon without issuing the CLIENT_COMMAND(pEntity, drop)? That's the only method that I know of. Clients can't block this command (unless they are running some clientside cheat that sneaks past VAC and intercepts server commands). 2) Is there an easy way to see if a shield is being carried but not deployed? I have these 2 bits of code which hint on a solution, but I am hoping that asking here will give me a better insight. I don't know nuthin' about no shields in Counter-Strike. -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
Jeffrey botman Broome wrote: Yes. There are many people that have taken the standard 20 player maps and made 32 player maps from them. If you want to play around with a metamod plugin that allows dynamically adding and remove stuff to/from a map, take a look at my Stripper2 plugin... http://planethalflife.com/botman/stripper2.shtml Adding and removing of weapons works with 1.6? All my attempts to remove a spawned weapon causes the server to crash :( I have looked at your code, but I shall revisit it now :) Matt. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Removing entities
Any entities you create can be removed without issue (I do it all the time). Deleting entities created by the game (like map spawned entities) may cause issues with the caching mechanism introduced a few releases ago. At least that is the word as I recall it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Judge Sent: Thursday, April 29, 2004 4:59 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Removing entities Jeffrey botman Broome wrote: Yes. There are many people that have taken the standard 20 player maps and made 32 player maps from them. If you want to play around with a metamod plugin that allows dynamically adding and remove stuff to/from a map, take a look at my Stripper2 plugin... http://planethalflife.com/botman/stripper2.shtml Adding and removing of weapons works with 1.6? All my attempts to remove a spawned weapon causes the server to crash :( I have looked at your code, but I shall revisit it now :) Matt. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
Deadman Standing wrote: Any entities you create can be removed without issue (I do it all the time). Deleting entities created by the game (like map spawned entities) may cause issues with the caching mechanism introduced a few releases ago. At least that is the word as I recall it. Any sample code for me to borrow? ;) Matt. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Removing entities
Some things I found (while making CSDM) on CS entities: 1] You cannot add new spawns dynamically to CS 1.6 anymore. 2] You cannot remove spawns dynamically from CS 1.6 anymore. 3] You can create weapons in two ways - spawning them (in CS 1.6 they will disappear after 2 seconds though) or by creating fake ones and hooking Touch() 4] You can remove weapons from CS still... you can look into the archives and see me begging Alfred to help me with this :] but that was met with nothing. Calling a weapon's Think() function will destroy it... in Metamod that's MDLL_Think(edict_t *). I have not tested deleting spawns because that is no longer useful to me (now I created an algorithm to use the old spawns and set origins. Note that this is how you should remove weapons: Find the weaponbox that has the target weapon model, then remove the actual entity that has the weapon as the classname, whose owner is the weaponbox entity. 5] You can test if a player has a shield by seeing what model they have I think. That is how many AMX Mod * plugins do it. To spawn weapons in CS what I did was make my own internally cached fake weapon entities, which are stored in a hash array... then when a player touches them, I use the item giving code from OLO's fun module. I'll give you code because I spent weeks figuring this out :] If Valve decides to break it again in a future update, I will probably quit because too many people would harass me to fix it :\ but since they are not obligated to not break it, be aware that this may not work in the future. -David BAILOPAN Anderson http://www.amxmodx.org/ Example code for giving a CS weapon: int iWeapon = ALLOC_STRING(weapon_awp); edict_t *pWeapon = CREATE_NAMED_ENTITY(iWeapon); if (FNullEnt(pWeapon)) return; pWeapon-v.origin = pEntity-v.origin; pWeapon-v.spawnflags |= SF_NORESPAWN; MDLL_Spawn(pWeapon); int solidstate = pWeapon-v.solid; MDLL_Touch(pWeapon, ENT(pEntity)); if (pWeapon-v.solid == solidstate) REMOVE_ENTITY(pWeapon); Example code for destroying a CS weapon: #ifdef STEAM #define RemoveWeapon(x) MDLL_Think(x) #else #define RemoveWeapon(x) REMOVE_ENTITY(x) #endif void DeleteCSWeapon(char *weaponmodel, char *weapon, int player) { edict_t *pPlayer = INDEXENT(player); edict_t *tEnt = FIND_ENTITY_BY_STRING(NULL, classname, weaponbox); edict_t *wEnt = NULL; while (!FNullEnt(tEnt)) { const char *model = STRING(model); if (strcmp(model, weaponmodel)==0) { if (ENTINDEX(tEnt-v.owner)==player) { wEnt = FIND_ENTITY_BY_STRING(NULL, classname, weapon); while (!FNullEnt(wEnt)) { if (ENTINDEX(wEnt-v.owner)==ENTINDEX(tEnt)) { RemoveWeapon(wEnt); } wEnt = FIND_ENTITY_BY_STRING(wEnt, classname, weapon); } //finding wEnts } //owners matched RemoveWeapon(tEnt); } //weapon matched tEnt = FIND_ENTITY_BY_STRING(tEnt, classname, weaponbox); } //finding tEnts } Code for spawning a permanent weapon the ground: build your own give weapon wrapper :] ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Temp Entities
With a server side tempent? You don't. If you were doing it client side, (efx api, which calls into the tempents without messages), you can run callback functions which you can use to detect when it stops moving. But other than that, sool. -omega Blackened Interactive - http://blackened-interactive.com Front Line Force - http://www.flfmod.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Admin Sent: December 28, 2002 9:14 AM To: [EMAIL PROTECTED] Subject: [hlcoders] Temp Entities This is a multi-part message in MIME format. -- -- [ Picked text/plain from multipart/alternative ] When you create an SVC_TEMPENTITY of type TE_MODEL (an entity that has direction and velocity that bounces off other entities, walls, etc for a time duration) How do you learn of the final position of the temp entity? Example: If the temp entity bounces off a wall and comes to rest on the ground and the time the temp entity is allowed to exist expires how do you find its final location? -- [ image001.gif of type image/gif deleted ] -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Temp Entities
This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] Client-side Temp Ents are great, personally I just edit the following routine in entity.cpp: void DLLEXPORT HUD_TempEntUpdate You can basically do what you want with it in there. Check this section here if ( !active ) // Kill it { pTemp-next = *ppTempEntFree; *ppTempEntFree = pTemp; if ( !pprev ) // Deleting at head of list *ppTempEntActive = pnext; else pprev-next = pnext; } This is called when life has run out to remove it from the linked list etc, you could put some special case code here, either by adding another custom FTENT_ flag or whatever you like. I use HUD_TempEntUpdate for custom control of sprites (dust, smoke, etc), as far as I know it should work the same with temp-entity models. You'll find the origin in, pTemp-entity.origin and the velocity its in pTemp-entity.baseline.origin, took me a bit of debuging and mucking about to find that! Hopefully this should be of some help. o Creme Michael Danzo Game Programmer :: Half-Life Rally modification :: http://www.hlrally.net/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of omega Sent: Saturday, 28 December 2002 10:50 PM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] Temp Entities With a server side tempent? You don't. If you were doing it client side, (efx api, which calls into the tempents without messages), you can run callback functions which you can use to detect when it stops moving. But other than that, sool. -omega Blackened Interactive - http://blackened-interactive.com Front Line Force - http://www.flfmod.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Admin Sent: December 28, 2002 9:14 AM To: [EMAIL PROTECTED] Subject: [hlcoders] Temp Entities This is a multi-part message in MIME format. -- -- [ Picked text/plain from multipart/alternative ] When you create an SVC_TEMPENTITY of type TE_MODEL (an entity that has direction and velocity that bounces off other entities, walls, etc for a time duration) How do you learn of the final position of the temp entity? Example: If the temp entity bounces off a wall and comes to rest on the ground and the time the temp entity is allowed to exist expires how do you find its final location? -- [ image001.gif of type image/gif deleted ] -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Zone Entities
Well... does a player trigger the Touch() function every frame as long as he is inside the entity? You could clear the flag in the players PreThink() function, and set it in the Touch() function. Thusly, if they leave, the flag is no longer updated and is cleared. Or something like that. - Original Message - From: Mazor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 16, 2002 9:44 PM Subject: [hlcoders] Zone Entities This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] I need to figure out how to code in zone type entities into my mod. I can get the base entity part, but I need to figure out how to flag a player when he's in the entity and then how to reset the flag when he's exited the entity's bounds. any ideas how? -Mazor ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Zone Entities
Then wouldn't the flag end up flip flopping every frame? One frame on, one frame off, one frame on, one frame off it would cause a headache when trying to examine it... wouldn't it? -Mazor -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Daniel Koppes Sent: Sunday, June 16, 2002 5:24 AM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Zone Entities Well... does a player trigger the Touch() function every frame as long as he is inside the entity? You could clear the flag in the players PreThink() function, and set it in the Touch() function. Thusly, if they leave, the flag is no longer updated and is cleared. Or something like that. - Original Message - From: Mazor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 16, 2002 9:44 PM Subject: [hlcoders] Zone Entities This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] I need to figure out how to code in zone type entities into my mod. I can get the base entity part, but I need to figure out how to flag a player when he's in the entity and then how to reset the flag when he's exited the entity's bounds. any ideas how? -Mazor ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Zone Entities
You can make something like this in the Think function : for ( loop_through_all_players ) { if ( pPlayer-pev-origin.x pev-abs.x ... /*some other tests to verify that the origin of the*/ /*players is between hte absmax and absmin values*/ ) { // set the flag : pPlayer-m_CortexsFlag |= IN_ZONE; // lol } else { pPlayer-m_CortexFlag } } Here you are :) So, you don't need to set a Touch() function. - Cortex : HL Albator coder and mapper ( www.hlalbator.fr.st ) - email : [EMAIL PROTECTED]ICQ : 71548738 - Original Message - From: Mazor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 16, 2002 12:50 PM Subject: RE: [hlcoders] Zone Entities | Then wouldn't the flag end up flip flopping every frame? One frame on, | one frame off, one frame on, one frame off it would cause a headache | when trying to examine it... wouldn't it? | | -Mazor | | -Original Message- | From: [EMAIL PROTECTED] | [mailto:[EMAIL PROTECTED]] On Behalf Of Daniel | Koppes | Sent: Sunday, June 16, 2002 5:24 AM | To: [EMAIL PROTECTED] | Subject: Re: [hlcoders] Zone Entities | | Well... does a player trigger the Touch() function every frame as long | as he | is inside the entity? | | You could clear the flag in the players PreThink() function, and set it | in | the Touch() function. | | Thusly, if they leave, the flag is no longer updated and is cleared. | | Or something like that. | | | - Original Message - | From: Mazor [EMAIL PROTECTED] | To: [EMAIL PROTECTED] | Sent: Sunday, June 16, 2002 9:44 PM | Subject: [hlcoders] Zone Entities | | | This is a multi-part message in MIME format. | -- | [ Picked text/plain from multipart/alternative ] | I need to figure out how to code in zone type entities into my mod. I | can get the base entity part, but I need to figure out how to flag a | player when he's in the entity and then how to reset the flag when | he's | exited the entity's bounds. any ideas how? | | -Mazor | ___ | To unsubscribe, edit your list preferences, or view the list archives, | please visit: | http://list.valvesoftware.com/mailman/listinfo/hlcoders | | | | ___ | To unsubscribe, edit your list preferences, or view the list archives, | please visit: | http://list.valvesoftware.com/mailman/listinfo/hlcoders | ___ | To unsubscribe, edit your list preferences, or view the list archives, please visit: | http://list.valvesoftware.com/mailman/listinfo/hlcoders | | ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Zone Entities
I need to figure out how to code in zone type entities into my mod. I can get the base entity part, but I need to figure out how to flag a player when he's in the entity and then how to reset the flag when he's exited the entity's bounds. any ideas how? If you have an origin of an entity (func_zone or whatever) and you know the bounding box size of the entity (pev-mins, pev-maxs), it's a fairly simple task to determine if a player origin is between the entity min and max coordinates... if ((player.x = entity.min.x) (player.x = entity.max.x) (player.y = entity.min.y) (player.y = entity.max.y) (player.z = entity.min.z) (player.y = entity.max.z)) { // think inside the box } ...of course this assumes that the bounding box of the entity is axially aligned (aligned with the X, Y, and Z axis). Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Light entities
You need to know which light it is you want to turn on and off. In your code, you are trying to toggle a light you reference with CLight, but thats an unidentified variable. Use the GET_ENTITY_BY_STRING or similar functions to get a pointer to the entity. -av Rob z wrote: ok im not the best of coders sooo a lil more help would be nice after looking at what botman wrote and reading through some code about the GetClassPtr() function i was hoping this would work ( to test i am putting the code in the client command function ) CBaseEntity *pLight = NULL; pLight = GetClassPtr( (CLight *)NULL ); pLight-Use(NULL, NULL, USE_TOGGLE, 0); // toggle on or off but it returns me some errors that im not very sure what to do to solve. can anyone help? error C2065: 'CLight' : undeclared identifier : error C2059: syntax error : ')' i think that CLight is the wrong thing to put to find the light entity but i have no idea what to put :( _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- - [DRP]Avatar-X SillyZone Homepage: www.thesillyzone.com SillyZone Forums: forum.thesillyzone.com My Homepage: www.cyberwyre.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Light entities
or just include effects.h (or lights.h, I'm not sure and I haven't HL SDK on this computer). Cortex You need to know which light it is you want to turn on and off. In your code, you are trying to toggle a light you reference with CLight, but thats an unidentified variable. Use the GET_ENTITY_BY_STRING or similar functions to get a pointer to the entity. -av Rob z wrote: ok im not the best of coders sooo a lil more help would be nice after looking at what botman wrote and reading through some code about the GetClassPtr() function i was hoping this would work ( to test i am putting the code in the client command function ) CBaseEntity *pLight = NULL; pLight = GetClassPtr( (CLight *)NULL ); pLight-Use(NULL, NULL, USE_TOGGLE, 0); // toggle on or off but it returns me some errors that im not very sure what to do to solve. can anyone help? error C2065: 'CLight' : undeclared identifier : error C2059: syntax error : ')' i think that CLight is the wrong thing to put to find the light entity but i have no idea what to put :( _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- - [DRP]Avatar-X SillyZone Homepage: www.thesillyzone.com SillyZone Forums: forum.thesillyzone.com My Homepage: www.cyberwyre.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Ce mel a été envoyé avec Meloo http://www.meloo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Map entities client-side
Cant you pass the keyvalues to the client in your message? I know for my mod we have animated plants and items that are on the server side only. For instance when the player touches the animated item, a message is sent to the client tellin it what it is and the inventory/hud info is updated accordingly. I dont know if that pertains to your original question... but anyway... =) If you really need the keyvalues, when the entity is created send a message to the client. Im tired... im going to bed. Roachie www.the-coming.com - Original Message - From: Persuter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 12:27 AM Subject: RE: [hlcoders] Map entities client-side Btw, to clear things up on this, I did indeed eventually use the message to client and it works fine now (better than I expected, actually), but I just found it odd that we can't get the keyvalues from the client-side. OK, now continue the digression... :) Thanks for everyone who helped, btw... Persuter -Original Message- From: [EMAIL PROTECTED] [mailto:hlcoders- [EMAIL PROTECTED]] On Behalf Of Pat Magnan Sent: Tuesday, February 12, 2002 3:28 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Map entities client-side Two solutions come to mind: - parse the BSP client side... - transmit the value of that keyvalue to the client in a message, just once while the HUD is initializing should do it (keyvalues don't change do they?). I chose the latter for an entity that was placed in the map, and rendered client side by TriAPI. I think some folks were working on trying to parse the BSP client side, but ran into trouble keeping things in synch... I think you've been around longer than I have and may not need it, :) but if you want to see an outline of my approach, I did up a tutorial (concept mostly) here: http://www.tourofdutymod.com/tutorials.php Is there a way to access keyvalue info in the map from the client- side? I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. Thanks, Persuter _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Map entities client-side
Prasing the BSP Client side is the best way...Although if its just an entity that is used once, then just sent it serverside its easier to setup... I'm gunna lead you through using the BSP Client side... First thing add to your project bspfile.cpp cmdlib.cpp mathlib.cpp scriplib.cpp And I Include bspfile.h into the files you wish to use the bsp stuff Now, time to get the name of the map, well we know entity in index 0 is the map, so lets use the name of the model, to get the map... gEngfuncs.GetEntityByIndex(0)-model-name will give the map..now to load the BSP File.. LoadBSPFile(gEngfuncs.GetEntityByIndex(0)-model-name); Now the epairs/entities aren't prased in that they are just stored, time to prase the entities ParseEntities(); Now its time to find the entity you need.. entity_t * FindEntityByClassName(char *classname) { for(int i=0;inum_entities;i++) if(strcmp(classname, ValueForKey(entities[i],classname)) == 0) return entities[i]; return NULL; } Now how about we try and find and aim at an info_player_deathmatch entity, we would do the following.. entity_t * entity = FindEntityByClassName(info_player_deathmatch); How about an example of using that entity, lets make it aim at that point :D hehe gotta have some fun sometime vec3_t dirAim; vec3_t MyOrigin float Angles[3]; VectorCopy(MyOrigin,gEngfuncs.GetLocalPlayer()-origin) VectorMinus(entity-origin, dirAim, MyOrigin); VectorAngles(dirAim, Angles); for(int i=0;i3;i++) if(Angles[i]180) Angles-=360; gEngfuncs.SetViewAngles(Angles); Now There you are happy as can be, only one thing, you will be aiming from the center of your body if you try that, but thats just to show how to use the entity_t stuff, btw the entity_t struct is stored in bspfile.h I Recommend only loading the bsp and prasing it, probley in HUD_VidInit - Original Message - From: Roachfood - the-coming.com [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 7:38 PM Subject: Re: [hlcoders] Map entities client-side Cant you pass the keyvalues to the client in your message? I know for my mod we have animated plants and items that are on the server side only. For instance when the player touches the animated item, a message is sent to the client tellin it what it is and the inventory/hud info is updated accordingly. I dont know if that pertains to your original question... but anyway... =) If you really need the keyvalues, when the entity is created send a message to the client. Im tired... im going to bed. Roachie www.the-coming.com - Original Message - From: Persuter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 12:27 AM Subject: RE: [hlcoders] Map entities client-side Btw, to clear things up on this, I did indeed eventually use the message to client and it works fine now (better than I expected, actually), but I just found it odd that we can't get the keyvalues from the client-side. OK, now continue the digression... :) Thanks for everyone who helped, btw... Persuter -Original Message- From: [EMAIL PROTECTED] [mailto:hlcoders- [EMAIL PROTECTED]] On Behalf Of Pat Magnan Sent: Tuesday, February 12, 2002 3:28 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Map entities client-side Two solutions come to mind: - parse the BSP client side... - transmit the value of that keyvalue to the client in a message, just once while the HUD is initializing should do it (keyvalues don't change do they?). I chose the latter for an entity that was placed in the map, and rendered client side by TriAPI. I think some folks were working on trying to parse the BSP client side, but ran into trouble keeping things in synch... I think you've been around longer than I have and may not need it, :) but if you want to see an outline of my approach, I did up a tutorial (concept mostly) here: http://www.tourofdutymod.com/tutorials.php Is there a way to access keyvalue info in the map from the client- side? I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. Thanks, Persuter _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Map entities client-side
lol, reductor, yeah, I started looking at bspfile.cpp... Then I just rolled my eyes and didn't do it. It's just something I need to send one time. Making the message was simple in the extreme, I just wanted to know if there was a simpler way that didn't take up net bandwidth on the client-side. But thanks, I'll be sure to keep this around for next time... :) Persuter -Original Message- From: [EMAIL PROTECTED] [mailto:hlcoders- [EMAIL PROTECTED]] On Behalf Of ReDucTor Sent: Wednesday, February 13, 2002 4:29 AM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Map entities client-side Prasing the BSP Client side is the best way...Although if its just an entity that is used once, then just sent it serverside its easier to setup... I'm gunna lead you through using the BSP Client side... First thing add to your project bspfile.cpp cmdlib.cpp mathlib.cpp scriplib.cpp And I Include bspfile.h into the files you wish to use the bsp stuff Now, time to get the name of the map, well we know entity in index 0 is the map, so lets use the name of the model, to get the map... gEngfuncs.GetEntityByIndex(0)-model-name will give the map..now to load the BSP File.. LoadBSPFile(gEngfuncs.GetEntityByIndex(0)-model-name); Now the epairs/entities aren't prased in that they are just stored, time to prase the entities ParseEntities(); Now its time to find the entity you need.. entity_t * FindEntityByClassName(char *classname) { for(int i=0;inum_entities;i++) if(strcmp(classname, ValueForKey(entities[i],classname)) == 0) return entities[i]; return NULL; } Now how about we try and find and aim at an info_player_deathmatch entity, we would do the following.. entity_t * entity = FindEntityByClassName(info_player_deathmatch); How about an example of using that entity, lets make it aim at that point :D hehe gotta have some fun sometime vec3_t dirAim; vec3_t MyOrigin float Angles[3]; VectorCopy(MyOrigin,gEngfuncs.GetLocalPlayer()-origin) VectorMinus(entity-origin, dirAim, MyOrigin); VectorAngles(dirAim, Angles); for(int i=0;i3;i++) if(Angles[i]180) Angles-=360; gEngfuncs.SetViewAngles(Angles); Now There you are happy as can be, only one thing, you will be aiming from the center of your body if you try that, but thats just to show how to use the entity_t stuff, btw the entity_t struct is stored in bspfile.h I Recommend only loading the bsp and prasing it, probley in HUD_VidInit - Original Message - From: Roachfood - the-coming.com [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 7:38 PM Subject: Re: [hlcoders] Map entities client-side Cant you pass the keyvalues to the client in your message? I know for my mod we have animated plants and items that are on the server side only. For instance when the player touches the animated item, a message is sent to the client tellin it what it is and the inventory/hud info is updated accordingly. I dont know if that pertains to your original question... but anyway... =) If you really need the keyvalues, when the entity is created send a message to the client. Im tired... im going to bed. Roachie www.the-coming.com - Original Message - From: Persuter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 12:27 AM Subject: RE: [hlcoders] Map entities client-side Btw, to clear things up on this, I did indeed eventually use the message to client and it works fine now (better than I expected, actually), but I just found it odd that we can't get the keyvalues from the client-side. OK, now continue the digression... :) Thanks for everyone who helped, btw... Persuter -Original Message- From: [EMAIL PROTECTED] [mailto:hlcoders- [EMAIL PROTECTED]] On Behalf Of Pat Magnan Sent: Tuesday, February 12, 2002 3:28 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Map entities client-side Two solutions come to mind: - parse the BSP client side... - transmit the value of that keyvalue to the client in a message, just once while the HUD is initializing should do it (keyvalues don't change do they?). I chose the latter for an entity that was placed in the map, and rendered client side by TriAPI. I think some folks were working on trying to parse the BSP client side, but ran into trouble keeping things in synch... I think you've been around longer than I have and may not need it, :) but if you want to see an outline of my approach, I did up a tutorial (concept mostly) here: http://www.tourofdutymod.com/tutorials.php Is there a way to access keyvalue info in the map from the client- side? I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do
RE: [hlcoders] Map entities client-side
Well yeah, that's why I didn't care, just makes sense to cut down on network traffic whenever possible, 'specially if it's easier. Persuter -Original Message- From: [EMAIL PROTECTED] [mailto:hlcoders- [EMAIL PROTECTED]] On Behalf Of Tom Sent: Wednesday, February 13, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Map entities client-side well if you think about it, your only sending it over as they connect, so its not bad nettraffic, it doesnt get in the way of gameplay - Original Message - From: Persuter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 5:20 PM Subject: RE: [hlcoders] Map entities client-side lol, reductor, yeah, I started looking at bspfile.cpp... Then I just rolled my eyes and didn't do it. It's just something I need to send one time. Making the message was simple in the extreme, I just wanted to know if there was a simpler way that didn't take up net bandwidth on the client-side. But thanks, I'll be sure to keep this around for next time... :) Persuter -Original Message- From: [EMAIL PROTECTED] [mailto:hlcoders- [EMAIL PROTECTED]] On Behalf Of ReDucTor Sent: Wednesday, February 13, 2002 4:29 AM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Map entities client-side Prasing the BSP Client side is the best way...Although if its just an entity that is used once, then just sent it serverside its easier to setup... I'm gunna lead you through using the BSP Client side... First thing add to your project bspfile.cpp cmdlib.cpp mathlib.cpp scriplib.cpp And I Include bspfile.h into the files you wish to use the bsp stuff Now, time to get the name of the map, well we know entity in index 0 is the map, so lets use the name of the model, to get the map... gEngfuncs.GetEntityByIndex(0)-model-name will give the map..now to load the BSP File.. LoadBSPFile(gEngfuncs.GetEntityByIndex(0)-model-name); Now the epairs/entities aren't prased in that they are just stored, time to prase the entities ParseEntities(); Now its time to find the entity you need.. entity_t * FindEntityByClassName(char *classname) { for(int i=0;inum_entities;i++) if(strcmp(classname, ValueForKey(entities[i],classname)) == 0) return entities[i]; return NULL; } Now how about we try and find and aim at an info_player_deathmatch entity, we would do the following.. entity_t * entity = FindEntityByClassName(info_player_deathmatch); How about an example of using that entity, lets make it aim at that point :D hehe gotta have some fun sometime vec3_t dirAim; vec3_t MyOrigin float Angles[3]; VectorCopy(MyOrigin,gEngfuncs.GetLocalPlayer()-origin) VectorMinus(entity-origin, dirAim, MyOrigin); VectorAngles(dirAim, Angles); for(int i=0;i3;i++) if(Angles[i]180) Angles-=360; gEngfuncs.SetViewAngles(Angles); Now There you are happy as can be, only one thing, you will be aiming from the center of your body if you try that, but thats just to show how to use the entity_t stuff, btw the entity_t struct is stored in bspfile.h I Recommend only loading the bsp and prasing it, probley in HUD_VidInit - Original Message - From: Roachfood - the-coming.com [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 7:38 PM Subject: Re: [hlcoders] Map entities client-side Cant you pass the keyvalues to the client in your message? I know for my mod we have animated plants and items that are on the server side only. For instance when the player touches the animated item, a message is sent to the client tellin it what it is and the inventory/hud info is updated accordingly. I dont know if that pertains to your original question... but anyway... =) If you really need the keyvalues, when the entity is created send a message to the client. Im tired... im going to bed. Roachie www.the-coming.com - Original Message - From: Persuter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 12:27 AM Subject: RE: [hlcoders] Map entities client-side Btw, to clear things up on this, I did indeed eventually use the message to client and it works fine now (better than I expected, actually), but I just found it odd that we can't get the keyvalues from the client-side. OK, now continue the digression... :) Thanks for everyone who helped, btw... Persuter -Original Message- From: [EMAIL PROTECTED] [mailto:hlcoders- [EMAIL PROTECTED]] On Behalf Of Pat Magnan Sent: Tuesday, February 12, 2002 3:28 PM To: [EMAIL PROTECTED] Subject: Re
Re: [hlcoders] Map entities client-side
Two solutions come to mind: - parse the BSP client side... - transmit the value of that keyvalue to the client in a message, just once while the HUD is initializing should do it (keyvalues don't change do they?). I chose the latter for an entity that was placed in the map, and rendered client side by TriAPI. I think some folks were working on trying to parse the BSP client side, but ran into trouble keeping things in synch... I think you've been around longer than I have and may not need it, :) but if you want to see an outline of my approach, I did up a tutorial (concept mostly) here: http://www.tourofdutymod.com/tutorials.php Is there a way to access keyvalue info in the map from the client- side? I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. Thanks, Persuter _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Map entities client-side
how can u render an entity clientside using TriApi? I mean like if it was a model then you woulldnt use triapi (efxapi?) and how do you get all of the planes of a brush entitiy? - Original Message - From: Pat Magnan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 9:27 PM Subject: Re: [hlcoders] Map entities client-side Two solutions come to mind: - parse the BSP client side... - transmit the value of that keyvalue to the client in a message, just once while the HUD is initializing should do it (keyvalues don't change do they?). I chose the latter for an entity that was placed in the map, and rendered client side by TriAPI. I think some folks were working on trying to parse the BSP client side, but ran into trouble keeping things in synch... I think you've been around longer than I have and may not need it, :) but if you want to see an outline of my approach, I did up a tutorial (concept mostly) here: http://www.tourofdutymod.com/tutorials.php Is there a way to access keyvalue info in the map from the client- side? I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. Thanks, Persuter _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Map entities client-side
Oops, I guess that was as clear as mud.. ;) What we wanted to accomplish was this: - have an animated, transparent thing that our mappers could use for effects like swaying grass or brush or reeds or whatever - we thought about sprites, but the engine draws them at 90 degrees to the player's viewpoint at all times, so they pivot (which isn't quite what we wanted) Instead, what we came up with was a scheme where the mappers specify the origin and angles of the sprite in the BSP, and I shoot a message for each of these entities from server to client. Using the origin and angle information, along with the sprite name, I load the sprite file (on the client), draw a poly four corners of the sprite (after getting the size of the sprite from the file), texture it with that sprite, and then rotate it appropriately in space. I also advance the frame every now and then, in accordance with the framerate specified in the BSP. Then, we end up with some swaying grass that while purely 2D, if placed cleverly by the mappers (a few of them overlapping and at angles to each other), gives us a sort of effect of a field of swaying grass I don't know if what you're trying to do could be approached with a similar scheme or not.. and I sometimes wonder if what we did would be better done with some models or something, but that was one solution we came up with :D We still haven't had any decent test maps done up using this scheme, so I don't know how useful it will end up being, but I was kinda bored one weekend, and gave this a try.. :D how can u render an entity clientside using TriApi? I mean like if it was a model then you woulldnt use triapi (efxapi?) and how do you get all of the planes of a brush entitiy? - Original Message - From: Pat Magnan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 9:27 PM Subject: Re: [hlcoders] Map entities client-side Two solutions come to mind: - parse the BSP client side... - transmit the value of that keyvalue to the client in a message, just once while the HUD is initializing should do it (keyvalues don't change do they?). I chose the latter for an entity that was placed in the map, and rendered client side by TriAPI. I think some folks were working on trying to parse the BSP client side, but ran into trouble keeping things in synch... I think you've been around longer than I have and may not need it, :) but if you want to see an outline of my approach, I did up a tutorial (concept mostly) here: http://www.tourofdutymod.com/tutorials.php Is there a way to access keyvalue info in the map from the client- side? I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. Thanks, Persuter _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Map entities client-side
Oops, I guess that was as clear as mud.. ;) What we wanted to accomplish was this: - have an animated, transparent thing that our mappers could use for effects like swaying grass or brush or reeds or whatever - we thought about sprites, but the engine draws them at 90 degrees to the player's viewpoint at all times, so they pivot (which isn't quite what we wanted) Instead, what we came up with was a scheme where the mappers specify the origin and angles of the sprite in the BSP, and I shoot a message for each of these entities from server to client. Using the origin and angle information, along with the sprite name, I load the sprite file (on the client), draw a poly four corners of the sprite (after getting the size of the sprite from the file), texture it with that sprite, and then rotate it appropriately in space. I also advance the frame every now and then, in accordance with the framerate specified in the BSP. Then, we end up with some swaying grass that while purely 2D, if placed cleverly by the mappers (a few of them overlapping and at angles to each other), gives us a sort of effect of a field of swaying grass I don't know if what you're trying to do could be approached with a similar scheme or not.. and I sometimes wonder if what we did would be better done with some models or something, but that was one solution we came up with :D We still haven't had any decent test maps done up using this scheme, so I don't know how useful it will end up being, but I was kinda bored one weekend, and gave this a try.. :D how can u render an entity clientside using TriApi? I mean like if it was a model then you woulldnt use triapi (efxapi?) and how do you get all of the planes of a brush entitiy? - Original Message - From: Pat Magnan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 9:27 PM Subject: Re: [hlcoders] Map entities client-side Two solutions come to mind: - parse the BSP client side... - transmit the value of that keyvalue to the client in a message, just once while the HUD is initializing should do it (keyvalues don't change do they?). I chose the latter for an entity that was placed in the map, and rendered client side by TriAPI. I think some folks were working on trying to parse the BSP client side, but ran into trouble keeping things in synch... I think you've been around longer than I have and may not need it, :) but if you want to see an outline of my approach, I did up a tutorial (concept mostly) here: http://www.tourofdutymod.com/tutorials.php Is there a way to access keyvalue info in the map from the client- side? I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. Thanks, Persuter _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders --- Eighty percent of life is showing up. -- Woody Allen ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Map entities client-side
-- Alternatively, there's code in DMC which loads in the teleporters on the client which you can bastardise if you want and which isn't GPL'd. -randomnine- -Original Message- From : James Williams [EMAIL PROTECTED] To : [EMAIL PROTECTED] Date : 09 February 2002 08:10:05 Subject : RE: [hlcoders] Map entities client-side Is there a way to access keyvalue info in the map from the client-side?\ I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. The engine has the map, yes, but you can't get to it there. You'll need to load the BSP yourself and parse its entity lump. botman has some code on his site to do it (bsp_tool); you'll need to hack it up pretty badly to get it in HL, though. Took me a couple hours on and off to get it in and get it to compile, but once I did, it works pretty well. =) It's also GPLed code, which means you have to distribute changes you make to it. Fortunately, we don't have to include our entire client DLLs, just the BSP loading code. That said, let me know if you want it and I'll send it to you (I personally don't want botman breathing down my neck about it. ;) ) Of course, it's obviously more educational for you to do it yourself (I learned a lot about it editing the source), but if you're stuck, let me know. -James Corvidae Williams ([EMAIL PROTECTED]) Administrator, Wavelength Forums (http://www.planethalflife.com/wavelength) Co-Leader / Coder, Underhive (http://www.underhive.com) ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- Get a free, personalised email address at http://another.com TXT ALRT! Stop wasting money now. Send FREE, personalised txt msgs to UK mobile phones from http://another.com -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] Map entities client-side
Is there a way to access keyvalue info in the map from the client-side?\ I keep on thinking you must be able to, since obviously the client side has the map, but I haven't been able to find any way to do it. The engine has the map, yes, but you can't get to it there. You'll need to load the BSP yourself and parse its entity lump. botman has some code on his site to do it (bsp_tool); you'll need to hack it up pretty badly to get it in HL, though. Took me a couple hours on and off to get it in and get it to compile, but once I did, it works pretty well. =) It's also GPLed code, which means you have to distribute changes you make to it. Fortunately, we don't have to include our entire client DLLs, just the BSP loading code. That said, let me know if you want it and I'll send it to you (I personally don't want botman breathing down my neck about it. ;) ) Of course, it's obviously more educational for you to do it yourself (I learned a lot about it editing the source), but if you're stuck, let me know. -James Corvidae Williams ([EMAIL PROTECTED]) Administrator, Wavelength Forums (http://www.planethalflife.com/wavelength) Co-Leader / Coder, Underhive (http://www.underhive.com) ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] # of entities
Is there a clean way to count the totally number of a certain entity in map? -Ron By certain entity I assume you mean of the same classname... edict_t *pEdict = NULL; int count = 0; while (pEdict=UTIL_FindEntityByClassname(pEdict, classname_to_search_for)) { count++; } Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] # of entities
OOPS! Wrong cvs tree ;) There is a pLast = pObject; In between the for {} and do {} while (); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yacketta, Ronald Sent: Wednesday, November 14, 2001 9:35 AM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] # of entities Tis what I have so far, another issue I am having.. The first trigger_camera is fired clean (developer 100 running) Second pass, the player is dropped to a SpawnSpot *boogle* then Back to a camera *boggle*. The player should never leave the Camera's UNTIL a team/class is selected. void CBasePlayer::PreThink(void) { blah blah blah ... CBaseEntity *pObject= NULL; CBaseEntity *pLast = NULL; // If joe-blow is not on a team, find a camera and // for him to use it! // stay in camera mode until a team/class is selected if ( (!FStrEq(this-m_szTeamName, TEAM_PS) ) (!FStrEq(this-m_szTeamName, TEAM_GHOST) ) (!FStrEq(this-m_szTeamName, TEAM_SPECTATOR) ) ) { // Thanks ReedBeta for the timer idea! if (gpGlobals-time m_flNextCameraTime) { // Taked from EntSelectSpawnPoint for ( int i = 2; i 0; i-- ) // TODO: remove the static 2, replace with dynamic code // That will find the # of trigger_cameras in the map { pObject = UTIL_FindEntityByClassname( pObject,trigger_camera ); if(!pObject) continue; } do { UTIL_LogPrintf(doing the do\n); // increment pObject pObject = UTIL_FindEntityByClassname( pObject, trigger_camera ); } while ( pObject != pLast ); // End EntSelectSpawnPoint pObject-Use(this,this,USE_TOGGLE,0); m_flNextCameraTime = gpGlobals-time + 15; } } ... ... ... } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of botman Sent: Wednesday, November 14, 2001 9:01 AM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] # of entities G... That erks me now ;) I can find all 3 trigger_cameras in a level, but every time PreThink() is called The same trigger_camera is fired *sigh* even though I have a do{} while (pLast != pObject); (similar to the Spawn selection code) -Ron Is pLast declared global (or static within the function)??? Maybe it's always starting at the first one each time. Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
RE: [hlcoders] # of entities
*nod* I also missed some key logic it looks like as well *sigh* oh well, no one said I was a botman ;) God of SDK -Ron -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of _Phantom_ Sent: Wednesday, November 14, 2001 11:13 AM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] # of entities well, do a dry run of the code on paper to make sure my logic is correct.. you probably want while (pObject == pLast ) at the bottom of the while loop, and to set pLast as a member varible for the class and dont set it to NULL on entry to the function. - Original Message - From: Yacketta, Ronald [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 14, 2001 4:04 PM Subject: RE: [hlcoders] # of entities Hrmmm I rip'ed that code from SpawnSpot... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of _Phantom_ Sent: Wednesday, November 14, 2001 11:01 AM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] # of entities your resetting pLast to NULL each time this function is called, in effect you are doing * find camera (first one) * save to pLast * loop while camera != pLast (so if the camera == first one we loop, oo second camera != first one) * use pobject (second camera) * exit function thus each time you are finding the same camera (the second one I would guess) - Original Message - From: Yacketta, Ronald [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 14, 2001 2:37 PM Subject: RE: [hlcoders] # of entities OOPS! Wrong cvs tree ;) There is a pLast = pObject; In between the for {} and do {} while (); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yacketta, Ronald Sent: Wednesday, November 14, 2001 9:35 AM To: [EMAIL PROTECTED] Subject: RE: [hlcoders] # of entities Tis what I have so far, another issue I am having.. The first trigger_camera is fired clean (developer 100 running) Second pass, the player is dropped to a SpawnSpot *boogle* then Back to a camera *boggle*. The player should never leave the Camera's UNTIL a team/class is selected. void CBasePlayer::PreThink(void) { blah blah blah ... CBaseEntity *pObject = NULL; CBaseEntity *pLast = NULL; // If joe-blow is not on a team, find a camera and // for him to use it! // stay in camera mode until a team/class is selected if ( (!FStrEq(this-m_szTeamName, TEAM_PS) ) (!FStrEq(this-m_szTeamName, TEAM_GHOST) ) (!FStrEq(this-m_szTeamName, TEAM_SPECTATOR) ) ) { // Thanks ReedBeta for the timer idea! if (gpGlobals-time m_flNextCameraTime) { // Taked from EntSelectSpawnPoint for ( int i = 2; i 0; i-- ) // TODO: remove the static 2, replace with dynamic code // That will find the # of trigger_cameras in the map { pObject = UTIL_FindEntityByClassname( pObject,trigger_camera ); if(!pObject) continue; } do { UTIL_LogPrintf(doing the do\n); // increment pObject pObject = UTIL_FindEntityByClassname( pObject, trigger_camera ); } while ( pObject != pLast ); // End EntSelectSpawnPoint pObject-Use(this,this,USE_TOGGLE,0); m_flNextCameraTime = gpGlobals-time + 15; } } ... ... ... } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of botman Sent: Wednesday, November 14, 2001 9:01 AM To: [EMAIL PROTECTED] Subject: Re: [hlcoders] # of entities G... That erks me now ;) I can find all 3 trigger_cameras in a level, but every time PreThink() is called The same trigger_camera is fired *sigh* even though I have a do{} while (pLast != pObject); (similar to the Spawn selection code) -Ron Is pLast declared global (or static within the function)??? Maybe it's always starting at the first one each time. Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe