those simple questions thread...

Any aspects of level design for the Source engine.

Re: those simple questions thread...

Postby darkpivot on Sun Dec 04, 2011 10:22 pm

That's the video I was talking about. Thanks for sending it again.
User avatar
darkpivot
Pheropod
Pheropod
 
Joined: Sun Oct 03, 2010 12:49 am

Re: those simple questions thread...

Postby Naticus on Mon Dec 05, 2011 9:25 pm

Is there a way to use env_toggletexture with textures that utilize an envmapmask? I'm looking to have a portion of a texture glow after it is triggered. The env_toggletexture came to mind but the alpha channel is used for the multiple frames. Any ideas?
Naticus
Been Here A While
Been Here A While
 
Joined: Mon May 22, 2006 4:54 pm

Re: those simple questions thread...

Postby Dr Evil on Tue Dec 06, 2011 3:22 pm

Is it possible to have a teleport with random destinations?
Dr Evil
1337 p0st3r
1337 p0st3r
 
Joined: Sun Dec 12, 2010 7:22 pm

Re: those simple questions thread...

Postby joe_rogers_11155 on Tue Dec 06, 2011 6:09 pm

@dr evil: just use logic_case to pick something at random. up to 16 choices. you will have to build 16 teleport locations so it wont be totally random across any location in your map...but you can choose randomly from 16 specific locations.

https://developer.valvesoftware.com/wiki/Logic_case
"Day breaks, but decay soon follows." - Ava Winona
Image
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
User avatar
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: those simple questions thread...

Postby Zecrah on Tue Dec 06, 2011 8:52 pm

I'm not sure on specifics, but maybe you could use some math and such to create a random set of co-ordinates to teleport to? And maybe some if's and such to prevent values being too high or low. Just a thought.
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
User avatar
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am
Location: *Waves vaguely*

Re: those simple questions thread...

Postby joe_rogers_11155 on Tue Dec 06, 2011 11:17 pm

if you don't think having sixteen places to choose from is enough to simulate randomness, then you can simply add in more logic_cases to increase the amount of places.
"Day breaks, but decay soon follows." - Ava Winona
Image
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
User avatar
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: those simple questions thread...

Postby Dr Evil on Wed Dec 07, 2011 12:07 am

joe_rogers_11155 wrote:if you don't think having sixteen places to choose from is enough to simulate randomness, then you can simply add in more logic_cases to increase the amount of places.


Thanks for the info, I've never looked into using a logic_case ent but i'll give it a shot :)
Dr Evil
1337 p0st3r
1337 p0st3r
 
Joined: Sun Dec 12, 2010 7:22 pm

Re: those simple questions thread...

Postby Ark11 on Thu Dec 08, 2011 6:53 am

Anyone know some tutorials that could teach me how to use Source Particle Editor?
"Drop kick me Jesus, through the goalposts of life." - Robert Bare
User avatar
Ark11
Senior Member
Senior Member
 
Joined: Mon May 24, 2010 10:02 pm
Location: Sydney, Australia

Re: those simple questions thread...

Postby joe_rogers_11155 on Thu Dec 08, 2011 1:45 pm

i would recommend talking to janga or some of the other frequenters of the particle pimpage thread. i've looked for some good tuts myself and haven't found anything i can wrap my head around.
"Day breaks, but decay soon follows." - Ava Winona
Image
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
User avatar
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: those simple questions thread...

Postby Ark11 on Tue Dec 20, 2011 11:06 pm

Ok, I am trying to modify an npc to be able to have a weapon and for it to have the choice of which weapon it has in Hammer. However, i have no coding knowledge and haven't been able to find what I need on the internet. So if anyone knows what the code for an npc to be able to do this, please give it to me.

If you need the code I am modifying for that, here it is:
Code: Select all
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//

#include "cbase.h"
#include "ai_default.h"
#include "ai_task.h"
#include "ai_schedule.h"
#include "ai_node.h"
#include "ai_hull.h"
#include "ai_hint.h"
#include "ai_squad.h"
#include "ai_senses.h"
#include "ai_navigator.h"
#include "ai_motor.h"
#include "ai_behavior.h"
#include "ai_baseactor.h"
#include "ai_behavior_lead.h"
#include "ai_behavior_follow.h"
#include "ai_behavior_standoff.h"
#include "ai_behavior_assault.h"
#include "npc_playercompanion.h"
#include "soundent.h"
#include "game.h"
#include "npcevent.h"
#include "entitylist.h"
#include "activitylist.h"
#include "vstdlib/random.h"
#include "engine/IEngineSound.h"
#include "sceneentity.h"
#include "gameweaponmanager.h"

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

#define FISHERMAN_MODEL "models/lostcoast/fisherman/fisherman.mdl"

//=========================================================
// Fisherman activities
//=========================================================

Activity ACT_FISHERMAN_HAT_UP;
Activity ACT_FISHERMAN_HAT_DOWN;

//=========================================================
// animation events
//=========================================================
int AE_FISHERMAN_HAT_UP;
int AE_FISHERMAN_HAT_DOWN;
int AE_FISHERMAN_HAT_ON;
int AE_FISHERMAN_HAT_OFF;

//---------------------------------------------------------
//
//---------------------------------------------------------

class CNPC_Fisherman : public CNPC_PlayerCompanion
{
public:
   DECLARE_CLASS( CNPC_Fisherman, CNPC_PlayerCompanion );
   //DECLARE_SERVERCLASS();
   DECLARE_DATADESC();

   virtual void Precache()
   {
      // Prevents a warning
      SelectModel( );
      BaseClass::Precache();

      PrecacheScriptSound( "NPC_Fisherman.FootstepLeft" );
      PrecacheScriptSound( "NPC_Fisherman.FootstepRight" );
      PrecacheScriptSound( "NPC_Fisherman.Die" );

      PrecacheInstancedScene( "scenes/Expressions/FishermanIdle.vcd" );
      PrecacheInstancedScene( "scenes/Expressions/FishermanAlert.vcd" );
      PrecacheInstancedScene( "scenes/Expressions/FishermanCombat.vcd" );
   }

   virtual void Activate()
   {
      BaseClass::Activate();

      if (m_iHatState == -1)
      {
         m_iHatState = ACT_FISHERMAN_HAT_DOWN;
      }

      // allocate layer, start with the hat down
      m_iHatLayer = AddGesture( (Activity)m_iHatState, false );
   }

   void   Spawn( void );
   void   SelectModel();
   Class_T Classify( void );

   void HandleAnimEvent( animevent_t *pEvent );

   bool ShouldLookForBetterWeapon() { return false; }
   virtual bool   IgnorePlayerPushing( void ) { return true; }
   void   DeathSound( const CTakeDamageInfo &info );

   int m_iHatLayer;   // overlay layer for hat, don't save/restore.
   int m_iHatState;   // hat state, persistant.

   DEFINE_CUSTOM_AI;
};

LINK_ENTITY_TO_CLASS( npc_fisherman, CNPC_Fisherman );

//---------------------------------------------------------
//
//---------------------------------------------------------
/*
IMPLEMENT_SERVERCLASS_ST(CNPC_Fisherman, DT_NPC_Fisherman)
END_SEND_TABLE()
*/

//---------------------------------------------------------
// Save/Restore
//---------------------------------------------------------
BEGIN_DATADESC( CNPC_Fisherman )

   // DEFINE_FIELD( m_iHatLayer, FIELD_INT ),
   DEFINE_FIELD( m_iHatState, FIELD_INTEGER ),

END_DATADESC()

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Fisherman::SelectModel()
{
   SetModelName( AllocPooledString( FISHERMAN_MODEL ) );
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Fisherman::Spawn( void )
{
   m_iHatLayer = -1;
   m_iHatState = -1;

   Precache();

   m_iHealth = 80;

//   m_iszIdleExpression = MAKE_STRING("scenes/Expressions/FishermanIdle.vcd");
//   m_iszAlertExpression = MAKE_STRING("scenes/Expressions/FishermanAlert.vcd");
//   m_iszCombatExpression = MAKE_STRING("scenes/Expressions/FishermanCombat.vcd");

   BaseClass::Spawn();

   AddEFlags( EFL_NO_DISSOLVE | EFL_NO_MEGAPHYSCANNON_RAGDOLL | EFL_NO_PHYSCANNON_INTERACTION );

   NPCInit();
}

//-----------------------------------------------------------------------------
// Purpose:
// Output :
//-----------------------------------------------------------------------------
Class_T   CNPC_Fisherman::Classify( void )
{
   return   CLASS_PLAYER_ALLY_VITAL;
}

//---------------------------------------------------------
//---------------------------------------------------------
void CNPC_Fisherman::HandleAnimEvent( animevent_t *pEvent )
{
   if ( pEvent->event == NPC_EVENT_LEFTFOOT )
   {
      EmitSound( "NPC_Fisherman.FootstepLeft", pEvent->eventtime );
   }
   else if ( pEvent->event == NPC_EVENT_RIGHTFOOT )
   {
      EmitSound( "NPC_Fisherman.FootstepRight", pEvent->eventtime );
   }
   else if ( pEvent->event == AE_FISHERMAN_HAT_UP )
   {
      if (m_iHatLayer != -1)
      {
         RemoveLayer( m_iHatLayer, 0.2, 0.2 );
         m_iHatLayer = -1;
      }

      m_iHatState = ACT_FISHERMAN_HAT_UP;
      m_iHatLayer = AddGesture( (Activity)m_iHatState, false );
   }
   else if ( pEvent->event == AE_FISHERMAN_HAT_DOWN )
   {
      if (m_iHatLayer != -1)
      {
         RemoveLayer( m_iHatLayer, 0.2, 0.2 );
         m_iHatLayer = -1;
      }

      m_iHatState = ACT_FISHERMAN_HAT_DOWN;
      m_iHatLayer = AddGesture( (Activity)m_iHatState, false );
   }
   else if ( pEvent->event == AE_FISHERMAN_HAT_ON )
   {
      m_iHatLayer = AddGesture( (Activity)m_iHatState, false );
   }
   else if ( pEvent->event == AE_FISHERMAN_HAT_OFF )
   {
      if (m_iHatLayer != -1)
      {
         RemoveLayer( m_iHatLayer, 0.2, 0.2 );
         m_iHatLayer = -1;
      }
   }
   else
   {
      BaseClass::HandleAnimEvent( pEvent );
   }
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void CNPC_Fisherman::DeathSound( const CTakeDamageInfo &info )
{
   // Sentences don't play on dead NPCs
   SentenceStop();
}

//-----------------------------------------------------------------------------
//
// Schedules
//
//-----------------------------------------------------------------------------

AI_BEGIN_CUSTOM_NPC( npc_fisherman, CNPC_Fisherman )

   DECLARE_ACTIVITY( ACT_FISHERMAN_HAT_UP )
   DECLARE_ACTIVITY( ACT_FISHERMAN_HAT_DOWN )

   DECLARE_ANIMEVENT( AE_FISHERMAN_HAT_UP )
   DECLARE_ANIMEVENT( AE_FISHERMAN_HAT_DOWN )
   DECLARE_ANIMEVENT( AE_FISHERMAN_HAT_ON )
   DECLARE_ANIMEVENT( AE_FISHERMAN_HAT_OFF )

AI_END_CUSTOM_NPC()
"Drop kick me Jesus, through the goalposts of life." - Robert Bare
User avatar
Ark11
Senior Member
Senior Member
 
Joined: Mon May 24, 2010 10:02 pm
Location: Sydney, Australia

Re: those simple questions thread...

Postby LordDz on Wed Dec 21, 2011 10:30 am

If you change the parameter ShouldLookForBetterWeapon to true, at least he would pick up a better weapon right ? So if you place it in front of him..
User avatar
LordDz
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Not a serious post ---->

Re: those simple questions thread...

Postby adr_n on Fri Dec 30, 2011 10:52 pm

I have question about ambient_generic and it's client side properties. For example: I have two rooms on my map. In one room there is ambient_generic inside, which plays music. Map is multiplayer for CS:S. I would like to make something like this: Player inside room with ambient_generic hear music, but second player which is on the other room - don't hear. And the main problem and question is: Ambient_Generic is client-side, or works globally to all players on the map? Ambient_Generic is with switched on flag " Play Everywhere ". I made it using trigger_multiple with outputs: " on start touch , volume: 10 " , " on end touch , volume 1 ". But i dont know how it will work in multiplayer. If Ambient_Generic works globally - player by entering trigger will globally change the volume of the ambient_generic, to all players. Anybody know how it works? Sorry for my bad english :)
adr_n
Member
Member
 
Joined: Fri Nov 11, 2011 3:23 pm

Re: those simple questions thread...

Postby Ark11 on Fri Dec 30, 2011 11:57 pm

Maybe you could make the ambient_generics 'MaximumAudibleDistance' parameter to the size of the room. You can go to the top bar of buttons in Hammer and go to View then click an option called 'Show Helpers'. Then a big circle will appear around your ambient_generic. It'll visually show the audible distance, and may make it easier for you to make it to the rooms size.
"Drop kick me Jesus, through the goalposts of life." - Robert Bare
User avatar
Ark11
Senior Member
Senior Member
 
Joined: Mon May 24, 2010 10:02 pm
Location: Sydney, Australia

Re: those simple questions thread...

Postby adr_n on Sat Dec 31, 2011 12:57 am

MaximumAudibleDistance don't work properly - real audible distance in game doesn't match to big circle around my ambient_generic. For example: I have set 100 in this value, and in game i hear music like i have set something like 1000... . So only idea in my opinion is to make it like i said on upper post, but i dont know how it will work in multiplayer. I know only, that if some player turn on ambient_generic with flag " play everywhere " , everyone will hear music, if stop, everyone in same time won't hear -i saw this on some map. So it works globally. But i dont know how it will work with " volume " triggering.
adr_n
Member
Member
 
Joined: Fri Nov 11, 2011 3:23 pm

Re: those simple questions thread...

Postby eviltoast499 on Thu Jan 05, 2012 12:00 am

I'm having some kind of strange leak in my map. I can compile the map just fine but If I hide everything but the bare necessities (skybox, real world brushes, nodraw) I'll get those "FindPortalSide: Couldn't find a good match for which brush to assign to a portal near...." kind of leaks:

Code: Select all
Leaf 0 contents:(may vary)
Leaf 1 contents: CONTENTS_SOLID (may vary, e.g. CONTENTS_WATER)
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID (ditto)
This means that none of the brushes in leaf 0 or 1 that touches the portal
has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents
CONTENTS_SOLID
Candidate brush IDs:


It doesn't give a candidate brush ID and if I go by the coordinates it takes me out to the void. No pointfile is generated either, the map is sealed up. But as long as at least one entity exists (not hidden) in the map, it compiles fine.

So I suspect a brush or entity somewhere is causing this to happen, but that's just a guess.
eviltoast499
Member
Member
 
Joined: Wed Jul 14, 2010 4:32 am
PreviousNext

Return to Hammer Editor Help

Who is online

Users browsing this forum: Google [Bot]