Talk:Adding a Dynamic Scope: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎APPCRASH: new section)
m (Nesciuse moved page Talk:Multipage Base Pages Temp Storage/Adding a Dynamic Scope to Talk:Adding a Dynamic Scope without leaving a redirect: Moving back to proper place)
 
(9 intermediate revisions by 6 users not shown)
Line 79: Line 79:
I just noticed that this can cause the tonemapping to flicker --[[User:AUserofSourceSDK|Pfannkuchen]] 20:58, 8 July 2010 (UTC)
I just noticed that this can cause the tonemapping to flicker --[[User:AUserofSourceSDK|Pfannkuchen]] 20:58, 8 July 2010 (UTC)


== APPCRASH ==
== Highly limited sprite viewing angles ==


OK, I have no compile errors at all with this code on the SourceSDK (2007) scratch code base, yet when I go to create a new game under my mod it crashes (with an APPCRASH) to desktop calling a faulted module in client.dll. Any idea at all on this? I have no idea where to start if vc isn't calling any errors on the code in the first place. New to posting here but been here awhile, will try to send you my edited files through pastebin if you feel like looking...
It seems that this also causes sprites to have very restricted viewing angles (almost dead center to be visible) --[[User:Vektorx4|Vektorx4]] 08:35, 4 December 2011 (PST)
:'''Update''': Turns out that the last argument for <code>ViewDrawScene()</code> inside <code>CViewRender::DrawScope()</code> was causing the issue, changing it from <code>VIEW_MAIN</code> to <code>VIEW_MONITOR</code> resolves it. I've updated the article to reflect this change. --[[User:Vektorx4|Vektorx4]] 04:31, 3 October 2012 (PDT)
 
== Things are acting really weird ==
 
Okay, so I followed this tutorial to the letter, and it compiles. But I seem to be having further issues. http://cloud.steampowered.com/ugc/578956129125494371/D5CEA3261B31E622D523A192AFDBB1DD2F464CF9/ First off, I am using the Crossbow, the view isn't rendering onto the Scope's lens, but instead is rendering in the Top-left corner of the screen. On top of that, the console is flooded with messages, and those messages just keep going and going. Can somebody please help me? [[User:BlackRaven117|BlackRaven117]] 23:15, 14 May 2012 (PDT)
 
EDIT: I was using the wrong model, but the problem still occurs. Pink Checker boarded scope, Render in the top-left corner, console floods with messages. PLEASE HELP. [[User:BlackRaven117|BlackRaven117]] 18:30, 16 May 2012 (PDT)
 
== Could this be used in all source games? ==
 
I'm working on a new weapon concept for TF2, and was wondering if and how this would be added...
 
@Twitchatic: You can't add this functionality because Valve hasn't released the TF2 source code. There is a leaked source code for the 2007 TF2, so you can do that.

Latest revision as of 16:00, 15 July 2024

Oh you're a fucking god whoever added this.

Seriously.--Gear 06:00, 25 May 2008 (PDT)

This doesn't work. I get a black texture. I'm using EP2.--User:JLea 20:29, 26 May 2008 (PDT)

EDITNevermind, I got it to work. It's fine now :D

How do I change the zoom level? FOV?

Millz: Glad you like it.

scopeView.fov = localPlayer->GetActiveWeapon()->GetZoomFOV(); 

This line controls FOV level

i get two errors while compiling

1>.\view.cpp(1146) : error C2039: 'scopeView' : is not a member of 'C_BaseCombatWeapon' 1> d:\Steam\steamapps\SourceMods\src\game_shared\basecombatweapon_shared.h(115) : see declaration of 'C_BaseCombatWeapon' 1>.\view.cpp(1146) : error C2228: left of '.fov' must have class/struct/union

im using ep1 engine



okok i get this error while compiling:

1>.\viewrender.cpp(2928) : error C2664: 'CViewRender::DrawScope' : cannot convert parameter 1 from 'IViewRender *' to 'const CViewSetup &' 1> Reason: cannot convert from 'IViewRender *' to 'const CViewSetup' 1> No constructor could take the source type, or constructor overload resolution was ambiguous

im using OB engine, what am i doing wrong??? or is it just something in the OB engine i was thinking to feed the function ivrender instead of cviewsetup but i dont think it works, in the def's their completly different things goddam it ._.


If you get the 'IViewRender *' to 'const CViewSetup &' error you placed the code in the wrong section, Found the solution a minute ago and it's working.

find:


#ifdef USE_MONITORS if ( cl_drawmonitors.GetBool() && ( g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 70 ) && ( ( whatToDraw & RENDERVIEW_SUPPRESSMONITORRENDERING ) == 0 ) ) { DrawMonitors( view ); } #endif


Add this line below:


if(g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 70 ) { DrawScope( view ); }


and you good to go --Djtyron 19:35, 16 May 2010 (UTC)

work in css

does this work in a css mod?

@Samsimpleasthat You fail man...

hdr

I just noticed that this can cause the tonemapping to flicker --Pfannkuchen 20:58, 8 July 2010 (UTC)

Highly limited sprite viewing angles

It seems that this also causes sprites to have very restricted viewing angles (almost dead center to be visible) --Vektorx4 08:35, 4 December 2011 (PST)

Update: Turns out that the last argument for ViewDrawScene() inside CViewRender::DrawScope() was causing the issue, changing it from VIEW_MAIN to VIEW_MONITOR resolves it. I've updated the article to reflect this change. --Vektorx4 04:31, 3 October 2012 (PDT)

Things are acting really weird

Okay, so I followed this tutorial to the letter, and it compiles. But I seem to be having further issues. http://cloud.steampowered.com/ugc/578956129125494371/D5CEA3261B31E622D523A192AFDBB1DD2F464CF9/ First off, I am using the Crossbow, the view isn't rendering onto the Scope's lens, but instead is rendering in the Top-left corner of the screen. On top of that, the console is flooded with messages, and those messages just keep going and going. Can somebody please help me? BlackRaven117 23:15, 14 May 2012 (PDT)

EDIT: I was using the wrong model, but the problem still occurs. Pink Checker boarded scope, Render in the top-left corner, console floods with messages. PLEASE HELP. BlackRaven117 18:30, 16 May 2012 (PDT)

Could this be used in all source games?

I'm working on a new weapon concept for TF2, and was wondering if and how this would be added...

@Twitchatic: You can't add this functionality because Valve hasn't released the TF2 source code. There is a leaked source code for the 2007 TF2, so you can do that.