Those Simple "Source Programming Questions" Thread...

Grab your favourite IDE and tinker with the innards of game engines

Re: Those Simple "Source Programming Questions" Thread...

Postby Swog on Thu Nov 08, 2012 10:12 pm

Why can't I launch a 2006 Source Mod?
User avatar
Swog
Regular
Regular
 
Joined: Sun Nov 04, 2012 4:48 am

Re: Those Simple "Source Programming Questions" Thread...

Postby LordDz on Fri Nov 09, 2012 3:48 pm

You don't have Half-Life 2 installed? Or that a lot of them were broken when Valve made the Orange Box?
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: Those Simple "Source Programming Questions" Thread...

Postby fishshapedfish on Fri Nov 09, 2012 5:16 pm

Have you got source SDK base 2006?
Check Out the Team's Latest Mod!
WIP Screenshots
Recruiting/Our Goals
User avatar
fishshapedfish
Regular
Regular
 
Joined: Fri Aug 05, 2011 5:44 pm

Re: Those Simple "Source Programming Questions" Thread...

Postby Swog on Fri Nov 09, 2012 7:30 pm

Well.

I got it fixed.


What you have to do is extract the client.dll and server.dll from $STEAMDIR\steamapps\(your username)\source sdk base\sourcetest\bin and copy them into $STEAMDIR\steamapps\sourcemod\(your mod name)\bin

It will change it to multiplayer, which sucks.
User avatar
Swog
Regular
Regular
 
Joined: Sun Nov 04, 2012 4:48 am

Re: Those Simple "Source Programming Questions" Thread...

Postby stoopdapoop on Sun Dec 16, 2012 11:18 am

Ok, I got a fresh one for you guys. I'm writing my own mini math library using SIMD intrinsics. I was using XNAmath for a bit, but all that C style code was pretty ugly and annoying.

So here's my problem, I love me some forward declarations, but for some reason this snippet is returning an error.

Code: Select all
class Vector4;

class SIMDVector
{
public:
   __m128 vec;

public:
   SIMDVector() {};

   void StoreVector4(Vector4* vec4) { _mm_storeu_ps( &vec4->x, vec );}
};


The errors are
Code: Select all
1>c:\users\superfast\documents\visual studio 2012\projects\brownengine\brownengine\poop_math.h(17): error C2027: use of undefined type 'Vector4'
1>          c:\users\superfast\documents\visual studio 2012\projects\brownengine\brownengine\poop_math.h(7) : see declaration of 'Vector4'
1>c:\users\superfast\documents\visual studio 2012\projects\brownengine\brownengine\poop_math.h(17): error C2227: left of '->x' must point to class/struct/union/generic type


Vector4 does get defined in this header, so I'm trying to figure out the hell it's complaining. Vector4 is very forward-declarable since I only reference one through a pointer. Can you not forward declare a class that doesn't have a .cpp file or something? I know I could fix this by moving this code to the end of the header, but what gives? google is proving unhelpful.

Edit: nice posting your question at the exact same time as me, arma.
Last edited by stoopdapoop on Sun Dec 16, 2012 11:21 am, edited 3 times in total.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Those Simple "Source Programming Questions" Thread...

Postby Armageddon on Sun Dec 16, 2012 11:18 am

How do you make it so the player doesn't sink in water? So it's like noclip with collisions.
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Those Simple "Source Programming Questions" Thread...

Postby zombie@computer on Sun Dec 16, 2012 11:43 am

stoopdapoop wrote:Ok, I got a fresh one for you guys. I'm writing my own mini math library using SIMD intrinsics. I was using XNAmath for a bit, but all that C style code was pretty ugly and annoying.

So here's my problem, I love me some forward declarations, but for some reason this snippet is returning an error.

Code: Select all
class Vector4;

class SIMDVector
{
public:
   __m128 vec;

public:
   SIMDVector() {};

   void StoreVector4(Vector4* vec4) { _mm_storeu_ps( &vec4->x, vec );}
};


The errors are
Code: Select all
1>c:\users\superfast\documents\visual studio 2012\projects\brownengine\brownengine\poop_math.h(17): error C2027: use of undefined type 'Vector4'
1>          c:\users\superfast\documents\visual studio 2012\projects\brownengine\brownengine\poop_math.h(7) : see declaration of 'Vector4'
1>c:\users\superfast\documents\visual studio 2012\projects\brownengine\brownengine\poop_math.h(17): error C2227: left of '->x' must point to class/struct/union/generic type


Vector4 does get defined in this header, so I'm trying to figure out the hell it's complaining. Vector4 is very forward-declarable since I only reference one through a pointer. Can you not forward declare a class that doesn't have a .cpp file or something? I know I could fix this by moving this code to the end of the header, but what gives? google is proving unhelpful.

Edit: nice posting your question at the exact same time as me, arma.

I gotta be honest im not seeing the problem right now, but a forward declaring a class does not give you access to undeclared members/methods. Even if it did recognise Vector4, it would not recognise ->x
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Those Simple "Source Programming Questions" Thread...

Postby stoopdapoop on Sun Dec 16, 2012 11:51 am

yeah, your point one is very valid, dunno why I thought that'd work.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Those Simple "Source Programming Questions" Thread...

Postby zombie@computer on Sun Dec 16, 2012 12:37 pm

stoopdapoop wrote:yeah, your point one is very valid, dunno why I thought that'd work.

btw i removed point 2 in an edit (guessing you still read that). I was confused with c# where structs are more memory efficient.
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Those Simple "Source Programming Questions" Thread...

Postby stoopdapoop on Sun Dec 16, 2012 12:44 pm

yeah, I read it and replied, but then you removed it from your post, so I removed my reply from my post. :)
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Those Simple "Source Programming Questions" Thread...

Postby Soulia on Tue Aug 27, 2013 5:36 pm

I'd like to implement the AR2 impact effect (that small flash when a AR2 shot hits a surface) to another weapon. Is there a simple way to do this?
User avatar
Soulia
Member
Member
 
Joined: Sun Aug 25, 2013 3:25 pm

Re: Those Simple "Source Programming Questions" Thread...

Postby Sandern on Tue Aug 27, 2013 5:43 pm

Soulia wrote:I'd like to implement the AR2 impact effect (that small flash when a AR2 shot hits a surface) to another weapon. Is there a simple way to do this?

I believe you just need to copy CWeaponAR2::DoImpactEffect to your other weapon and you should be pretty much done.
Sandern
Regular
Regular
 
Joined: Thu Jun 30, 2005 1:08 pm
Location: Netherlands

Re: Those Simple "Source Programming Questions" Thread...

Postby sw212 on Fri Aug 30, 2013 8:24 pm

Is there a way to change the burst fire mode in CS:GO to semi automatic (for an offline mod)? If there isn't, is there any other way to toggle between semi and fully automatic in CS:GO?
sw212
Just Joined
Just Joined
 
Joined: Sat Apr 27, 2013 3:20 pm

Re: Those Simple "Source Programming Questions" Thread...

Postby LordDz on Sun Sep 01, 2013 12:26 pm

Why doesn't my vvis compile? It's checked on in the compiler.
Code: Select all
** Executing...
** Command: "d:\games\steam\steamapps\insert name here\sourcesdk\bin\source2007\bin\vbsp.exe"
** Parameters: -game "d:\games\steam\steamapps\SourceMods\serioushalf-life" "D:\Games\Steam\SteamApps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01"

Valve Software - vbsp.exe (May 19 2009)
2 threads
materialPath: d:\games\steam\steamapps\SourceMods\serioushalf-life\materials
Loading D:\Games\Steam\SteamApps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01.vmf
Patching WVT material: maps/map01/nature/blenddirtgrass001a_wvt_patch
Patching WVT material: maps/map01/dev/dev_blendmeasure_wvt_patch
fixing up env_cubemap materials on brush sides...
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
Processing areas...done (0)
Building Faces...done (0)
Chop Details...done (0)
Find Visible Detail Sides...
Merged 276 detail faces...done (0)
Merging details...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (0)
writing D:\Games\Steam\SteamApps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01.prt...Building visibility clusters...
done (0)
Creating default LDR cubemaps for env_cubemap using skybox materials:
   skybox/sky_day01_01*.vmt
 ! Run buildcubemaps in the engine to get the correct cube maps.
Creating default HDR cubemaps for env_cubemap using skybox materials:
   skybox/sky_day01_01*.vmt
 ! Run buildcubemaps in the engine to get the correct cube maps.
Finding displacement neighbors...
Finding lightmap sample positions...
Displacement Alpha : 0...1...2...3...4...5...6...7...8...9...10
Building Physics collision data...
done (0) (265476 bytes)
Error! prop_static using model "models/props_interiors/furniture_couch01a.mdl", which must be used on a dynamic entity (i.e. prop_physics). Deleted.
Error loading studio model "models/props_interiors/furniture_couch01a.mdl"!
Error! prop_static using model "models/props_c17/furniturecouch001a.mdl", which must be used on a dynamic entity (i.e. prop_physics). Deleted.
Error loading studio model "models/props_c17/furniturecouch001a.mdl"!
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Water found with no water_lod_control entity, creating a default one.
Compacting texture/material tables...
Reduced 757 texinfos to 553
Reduced 84 texdatas to 73 (2515 bytes to 2149)
Writing D:\Games\Steam\SteamApps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01.bsp
2 seconds elapsed

** Executing...
** Command: "d:\games\steam\steamapps\insert name here\sourcesdk\bin\source2007\bin\vvis.exe"
** Parameters: -game "d:\games\steam\steamapps\SourceMods\serioushalf-life" "D:\Games\Steam\SteamApps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01"

Valve Software - vvis.exe (May 19 2009)
2 threads
reading d:\games\steam\steamapps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01.bsp
reading d:\games\steam\steamapps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01.prt
 319 portalclusters
 562 numportals
BasePortalVis:       0...1...2...3...4...5...6...7...8...9...10 (0)
PortalFlow:          0...1...2...3...4...5...6...7...8...9...10 (0)
Optimized: 142 visible clusters (0.00%)
Total clusters visible: 21371
Average clusters visible: 66
Building PAS...
Average clusters audible: 201
visdatasize:21713  compressed from 25520
writing d:\games\steam\steamapps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01.bsp
0 seconds elapsed

** Executing...
** Command: Copy File
** Parameters: "D:\Games\Steam\SteamApps\insert name here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01.bsp" "d:\games\steam\steamapps\SourceMods\serioushalf-life\maps\map01.bsp"


Having googled around a bit, I guess it's a brush with the length of "128.2" or something like that.

Also, strange thing. If I ONLY compile with with World Geometry on, I get this error instead:
Code: Select all
** Executing...
** Command: "d:\games\steam\steamapps\insert I love hammer here\sourcesdk\bin\source2007\bin\vbsp.exe"
** Parameters: -game "d:\games\steam\steamapps\SourceMods\serioushalf-life" "D:\Games\Steam\SteamApps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4"

Valve Software - vbsp.exe (May 19 2009)
2 threads
materialPath: d:\games\steam\steamapps\SourceMods\serioushalf-life\materials
Loading D:\Games\Steam\SteamApps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4.vmf
Patching WVT material: maps/map01_v4/nature/blenddirtgrass001a_wvt_patch
fixing up env_cubemap materials on brush sides...
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
**** leaked ****

FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-2048.0 6656.0 584.0)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-2048.0 6656.0 1304.0)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-2560.0 7168.0 608.0)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-3584.0 7168.0 608.0)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-4096.0 6656.0 608.0)
Leaf 0 contents: CONTENTS_SOLID
Leaf 1 contents:
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-2048.0 5632.0 584.0)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-2048.0 5632.0 1304.0)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (-2048.0 4168.0 184.0)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
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:

*** Suppressing further FindPortalSide errors.... ***
Processing areas...done (0)
Building Faces...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (0)
Creating default LDR cubemaps for env_cubemap using skybox materials:
   skybox/sky_day01_01*.vmt
 ! Run buildcubemaps in the engine to get the correct cube maps.
Creating default HDR cubemaps for env_cubemap using skybox materials:
   skybox/sky_day01_01*.vmt
 ! Run buildcubemaps in the engine to get the correct cube maps.
Finding displacement neighbors...
Finding lightmap sample positions...
Displacement Alpha : 0...1...2...3...4...5...6...7...8...9...10
Building Physics collision data...
done (0) (169324 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Compacting texture/material tables...
Reduced 283 texinfos to 218
Reduced 56 texdatas to 54 (1772 bytes to 1706)
Writing D:\Games\Steam\SteamApps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4.bsp
1 second elapsed

** Executing...
** Command: "d:\games\steam\steamapps\insert I love hammer here\sourcesdk\bin\source2007\bin\vvis.exe"
** Parameters: -game "d:\games\steam\steamapps\SourceMods\serioushalf-life" "D:\Games\Steam\SteamApps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4"

Valve Software - vvis.exe (May 19 2009)
2 threads
reading d:\games\steam\steamapps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4.bsp
reading d:\games\steam\steamapps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4.prt
LoadPortals: couldn't read d:\games\steam\steamapps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4.prt


** Executing...
** Command: Copy File
** Parameters: "D:\Games\Steam\SteamApps\insert I love hammer here\sourcesdk_content\hl2\mapsrc\serioushalflife\map01_v4.bsp" "d:\games\steam\steamapps\SourceMods\serioushalf-life\maps\map01_v4.bsp"



Except there aren't brushes at all at -2048.0 6656.0 584.0..
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: Those Simple "Source Programming Questions" Thread...

Postby Major Banter on Sun Sep 01, 2013 4:08 pm

Dz, this belongs in vanilla Simple Questions, as it has no relevance to programming. I'll still answer your question though.

Your issue lies here. You have a leak. Leaks create a whole host of problems varying from strange physics, to broken lighting (or even none at all) and going so far as to render the map unloadable.

Code: Select all
**** leaked ****


Go to 'map' on Hammer's taskbar and 'load pointfile'. Identify leak and seal. Repeat by compiling BSP until no leaks occur.

Alternately if you'd rather crack on with making the map, use the cordon tool.

Edit; I never got a chance to post an answer to dz's now deleted question, but he didn't have any entities in the map he was attempting to compile. No entities whatsoever results in a leak. Carry on.
ImageImageImage
Major Banter
Veteran
Veteran
 
Joined: Tue Apr 01, 2008 10:52 pm
Location: UK
PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users