RE: RE: [hlcoders] Round Timer/Map Reset

2006-02-02 Thread Ben Everett
This is why I'm against copy/paste coding it's quite obvious from the
code. Use filter.AddKeep(...).

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gus
Sent: Thursday, February 02, 2006 5:54 PM
To: hlcoders@list.valvesoftware.com
Subject: Re: RE: [hlcoders] Round Timer/Map Reset

Hello, Chris Janes,

My mistake, let me explain it more clear...this code works fine, it
does the job, but the scoring is made with logic and math entities. The two
entities that shouldn't be restarted are two math_counter called
"game_score_combine" and "game_score_rebel". so how in the world do I
keep "game_score_combine" and "game_score_rebel" from being deleted by our
round-timer code?

=== At 2006-02-02, 12:42:09 you wrote: ===

>Where are you storing the scores?
>
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Gus
>Sent: 02 February 2006 19:28
>To: hlcoders
>Subject: [hlcoders] Round Timer/Map Reset
>
>Hey y'all,
>
>am having trouble with my round timer/map reset..was working before
>but now is has a glitch or something. Was wondering anyone out there can
>help me get this going.the problem is that the team scores are
>erased at each map reset, I need the scores to stay for every
>round.anyway here's the code am using..
>
>< snip code >
>
>
>--
>Best regards.
>
>Gus
>[EMAIL PROTECTED]
>2006-02-02
>
>
>___
>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
>

= = = = = = = = = = = = = = = = = = = =


Best regards.
Gus
[EMAIL PROTECTED]
2006-02-02



___
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: Re: [hlcoders] Round Timer/Map Reset

2006-02-02 Thread Gus
Hello, Jason Houston,

can I speak you on MSN or AIM?

AIM at unrealprojects
MSN at [EMAIL PROTECTED]

=== At 2006-02-02, 15:28:50 you wrote: ===

>--
>[ Picked text/plain from multipart/alternative ]
>Do you mind if I use that map filter code in BGII? We were looking for a way
>to reset round anyway, and I thought we'd have to reset every entity
>individually :/
>
>
>--
>Draco
>--
>
>___
>To unsubscribe, edit your list preferences, or view the list archives, please 
>visit:
>http://list.valvesoftware.com/mailman/listinfo/hlcoders
>

= = = = = = = = = = = = = = = = = = = =


Best regards.
Gus
[EMAIL PROTECTED]
2006-02-02



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: RE: [hlcoders] Round Timer/Map Reset

2006-02-02 Thread Gus
Hello, Chris Janes,

My mistake, let me explain it more clear...this code works fine, it 
does the job, but the scoring is made with logic and math entities. The two 
entities that shouldn't be restarted are two math_counter called 
"game_score_combine" and "game_score_rebel". so how in the world do I keep 
"game_score_combine" and "game_score_rebel" from being deleted by our 
round-timer code?

=== At 2006-02-02, 12:42:09 you wrote: ===

>Where are you storing the scores?
>
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Gus
>Sent: 02 February 2006 19:28
>To: hlcoders
>Subject: [hlcoders] Round Timer/Map Reset
>
>Hey y'all,
>
>am having trouble with my round timer/map reset..was working before
>but now is has a glitch or something. Was wondering anyone out there can
>help me get this going.the problem is that the team scores are
>erased at each map reset, I need the scores to stay for every
>round.anyway here's the code am using..
>
>< snip code >
>
>
>--
>Best regards.
>
>Gus
>[EMAIL PROTECTED]
>2006-02-02
>
>
>___
>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
>

= = = = = = = = = = = = = = = = = = = =


Best regards.
Gus
[EMAIL PROTECTED]
2006-02-02



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Round Timer/Map Reset

2006-02-02 Thread Jason Houston
--
[ Picked text/plain from multipart/alternative ]
Do you mind if I use that map filter code in BGII? We were looking for a way
to reset round anyway, and I thought we'd have to reset every entity
individually :/


--
Draco
--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Valve, Engine bug?

2006-02-02 Thread Jeremy Swigart
--
[ Picked text/plain from multipart/alternative ]
CServerGameDLL::GameFrame no longer gets called when you've disconnected
back out to the menu, so afaik the game dll isn't being updated. It appears
something in the engine is eating the cpu.

On 2/2/06, Fabian Schreyer <[EMAIL PROTECTED]> wrote:
>
> I also know this problem. I think if you quit a map this way (or if
> the map loading process crashes because of an error in the map), the
> server keeps on working.
>
> On 2/1/06, l3fty <[EMAIL PROTECTED]> wrote:
> > I've noticed this in my mod too. Glad you've seen it in HL2DM, thought
> it
> > might have been something in my project ;)
> >
> >
> > ___
> > 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] Round Timer/Map Reset

2006-02-02 Thread Chris Janes
Where are you storing the scores?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gus
Sent: 02 February 2006 19:28
To: hlcoders
Subject: [hlcoders] Round Timer/Map Reset

Hey y'all,

am having trouble with my round timer/map reset..was working before
but now is has a glitch or something. Was wondering anyone out there can
help me get this going.the problem is that the team scores are
erased at each map reset, I need the scores to stay for every
round.anyway here's the code am using..

< snip code >


--
Best regards.

Gus
[EMAIL PROTECTED]
2006-02-02


___
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



[hlcoders] Round Timer/Map Reset

2006-02-02 Thread Gus
Hey y'all,

am having trouble with my round timer/map reset..was working before but 
now is has a glitch or something. Was wondering anyone out there can help me 
get this going.the problem is that the team scores are erased at each 
map reset, I need the scores to stay for every round.anyway here's the code 
am using..

===
Mapfilter.h
==
#include "cbase.h"
#include "mapentities.h"
#include "UtlSortVector.h"

#ifndef CMAPENTITYFILTER_H
#define CMAPENTITYFILTER_H

typedef const char* strptr;

static bool StrLessThan(  const strptr &src1,  const strptr &src2, void *pCtx )
{
if( strcmp(src1, src2) >= 0)
return false;
else
return true;
}

class CMapEntityFilter : public IMapEntityFilter
{
public:
// constructor
CMapEntityFilter();
// deconstructor
~CMapEntityFilter();

// used to check if we should reset an entity or not
virtual bool ShouldCreateEntity( const char *pClassname );
// creates the next entity in our stored list.
virtual CBaseEntity* CreateNextEntity( const char *pClassname );
// add an entity to our list
void AddKeep( const char*);

private:
// our list of entities to keep
CUtlSortVector< const char* > *keepList;
};

#endif





Mapfilter.cpp

#include "cbase.h"
#include "mapfilter.h"

// Constructor
CMapEntityFilter::CMapEntityFilter()
{
keepList = new CUtlSortVector< const char *> (StrLessThan);
}

// Deconstructor
CMapEntityFilter::~CMapEntityFilter()
{
delete keepList;
}

// [bool] ShouldCreateEntity [char]
// Purpose   : Used to check if the passed in entity is on our stored list
// Arguments : The classname of an entity
// Returns   : Boolean value - if we have it stored, we return false.

bool CMapEntityFilter::ShouldCreateEntity( const char *pClassname )
{
//Check if the entity is in our keep list.
if( keepList->Find( pClassname ) >= 0 )
return false;
else
return true;
}

// [CBaseEntity] CreateNextEntity [char]
// Purpose   : Creates an entity
// Arguments : The classname of an entity
// Returns   : A pointer to the new entity

CBaseEntity* CMapEntityFilter::CreateNextEntity( const char *pClassname )
{
return CreateEntityByName( pClassname);
}

// [void] AddKeep [char]
// Purpose   : Adds the passed in value to our list of items to keep
// Arguments : The class name of an entity
// Returns   : Void

void CMapEntityFilter::AddKeep( const char *sz)
{
keepList->Insert(sz);
}





==
ent_restartround.cpp
==
#include "cbase.h"
#include "entityinput.h"
#include "entityoutput.h"
#include "eventqueue.h"
#include "mathlib.h"
#include "globalstate.h"
#include "ndebugoverlay.h"
#include "vstdlib/random.h"

#ifndef CLIENT_DLL
#include "mapfilter.h"
#endif

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"


class CRestartRoundEntity: public CLogicalEntity
{
public:
DECLARE_CLASS( CRestartRoundEntity, CLogicalEntity );

void InputRestart( inputdata_t &inputdata );

private:

DECLARE_DATADESC();
};

LINK_ENTITY_TO_CLASS( restart_round, CRestartRoundEntity);


BEGIN_DATADESC( CRestartRoundEntity)

DEFINE_INPUTFUNC( FIELD_VOID, "RestartRound", InputRestart ),

END_DATADESC();

void CRestartRoundEntity::InputRestart( inputdata_t &inputdata )
{

CMapEntityFilter filter;

//keep all of these entities (ie don't remove them)
filter.AddKeep("worldspawn");
filter.AddKeep("soundent");
filter.AddKeep("hl2mp_gamerules");
filter.AddKeep("scene_manager");
filter.AddKeep("predicted_viewmodel");
filter.AddKeep("team_manager");
filter.AddKeep("event_queue_saveload_proxy");
filter.AddKeep("player_manager");
filter.AddKeep("player");
filter.AddKeep( "restart_round" );

CBaseEntity *pEnt;
CBaseEntity *tmpEnt;

pEnt = gEntList.FirstEnt();

while (pEnt != NULL)
{
if ( filter.ShouldCreateEntity (pEnt->GetClassname() ) )
{

tmpEnt = gEntList.NextEnt (pEnt);
UTIL_Remove (pEnt);
pEnt = tmpEnt;

}
else
{

pEnt = gEntList.NextEnt (pEnt);

}
}

gEntList.CleanupDeleteList();

MapEntity_ParseAllEntities( engine->GetMapEntitiesString(), &filter, 
true);

//spawn each player
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBaseEntity *plr = UTIL_PlayerByIndex( i );

if ( plr )
{
plr->Spawn();
}
else
{
break;

RE: [hlcoders] RE: SDK Shader samples busted?

2006-02-02 Thread Bob Chatman
There was a period of about a week or two that I too, could not build the
shaders. Valve finally started narrowing down bugs and fixing them.

Keep on chugging.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jed
Sent: Monday, January 30, 2006 12:34 PM
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] RE: SDK Shader samples busted?

 >Did you compile the game_shader_generic_sample project, and did it
copy >the game_shader_generic_sample.dll to your mod's bin directory?

That I did, but it still wasn't working. I've tried again though and it
*seems* to be working now. I think I may of missed a step or done
something in the wrong order.


___
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] Valve, Engine bug?

2006-02-02 Thread Fabian Schreyer
I also know this problem. I think if you quit a map this way (or if
the map loading process crashes because of an error in the map), the
server keeps on working.

On 2/1/06, l3fty <[EMAIL PROTECTED]> wrote:
> I've noticed this in my mod too. Glad you've seen it in HL2DM, thought it
> might have been something in my project ;)
>
>
> ___
> 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