Getting a microcontroller is a neat thing.
Maybe you should check out that Arduino thread.
[QUOTE=benjojo;21650531]Any one know where to get started on assembly?[/QUOTE]
not really but a quick question. Why ?
I've hit a bump in my code logic.
I'm using SFML and I'm tinkering with the View. It all great so far but the problem is that to draw on something you need an Image, and to make an Image you need to specify width and height and when I pan the view to the right for example I can't draw there because it's out of bounds of the image.
Making the image bigger has a huge impact on performance and hight numbers just don't work.
any ideas? I thought about having more than one image, offseted by screen width and screen height but I don't know how I would manage that, how would I know on which one to draw?
Would I maybe work if I had an Image that would pan along with the View but before panning, copy it's content to another, static image. Would that work?
[editline]09:23PM[/editline]
Never mind. Solved.
I just all the images along with the View but when I'm drawing a pixel on one of them if shifted by the amount the View moved.
It works great.
Really damn frustrated right now..
I'm working on a parser thing in C++. I have a class that looks like this:
[cpp]
namespace Utility
{
namespace ParsableObjects
{
class Base
{
public:
Base( void );
virtual ~Base( void );
virtual void Create( void );
virtual std::string GetStringProperty( const std::string &prop );
virtual Base *GetObjectProperty( const std::string &prop );
virtual void SetStringProperty( const std::string &prop, const std::string &val );
virtual void SetObjectProperty( const std::string &prop, Base *obj );
private:
std::map< std::string, std::string > strProperties;
std::map< std::string, Base * > objProperties;
};
}
}
[/cpp]
And inheriting from that I have another class that looks like this:
[cpp]
namespace Utility
{
namespace ParsableObjects
{
class Test : public Base
{
public:
Test( void );
virtual ~Test( void );
};
}
}
[/cpp]
If I implement the constructor and/or destructor outside of the header file, I get linker errors:
[code]1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Entity.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Utility::ParsableObjects::Base::~Base(void)" (??1Base@ParsableObjects@Utility@@UAE@XZ) referenced in function "public: virtual __thiscall Utility::ParsableObjects::Test::~Test(void)" (??1Test@ParsableObjects@Utility@@UAE@XZ)
1>Entity.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Utility::ParsableObjects::Base::Create(void)" (?Create@Base@ParsableObjects@Utility@@UAEXXZ)
1>Entity.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Utility::ParsableObjects::Base::GetStringProperty(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?GetStringProperty@Base@ParsableObjects@Utility@@UAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV45@@Z)
1>Entity.obj : error LNK2001: unresolved external symbol "public: virtual class Utility::ParsableObjects::Base * __thiscall Utility::ParsableObjects::Base::GetObjectProperty(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?GetObjectProperty@Base@ParsableObjects@Utility@@UAEPAV123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>Entity.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Utility::ParsableObjects::Base::SetStringProperty(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?SetStringProperty@Base@ParsableObjects@Utility@@UAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z)
1>Entity.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Utility::ParsableObjects::Base::SetObjectProperty(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Utility::ParsableObjects::Base *)" (?SetObjectProperty@Base@ParsableObjects@Utility@@UAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAV123@@Z)[/code]
I can get around that by #including the source file at the bottom of the header but that's just :barf:. Does anyone know what I'm doing wrong?
-snip- never mind should read the post first
[QUOTE=James0890;21653686]I don't work with C++ much, if at all, but I'm pretty sure you're suppose to use = 0 on those abstract functions.[/QUOTE]
They're not necessarily meant to be abstract just because they're virtual.
[QUOTE=James0890;21653686]I don't work with C++ much, if at all, but I'm pretty sure you're suppose to use = 0 on those abstract functions.[/QUOTE]
All except Create() have implementation. I did have Create() as pure virtual until I removed it in desperation :frown:
Hey, quick question:
Is it possible to set a permanent location where an OpenFileDialog opens in Visual Studio? My application won't always let me open pictures if the OpenFileDialog opens over a certain area it messes up.
How does it mess up?
I'm using a picturebox with a white background, and when I open a picture and the openfile thing is over the picturebox theres a 99% chance that when you open the file you'll click the box and it'll go back to being white. :\
Ok, I installed XNA and quick made a game. And whenever I try to launch it it just gives me an error saying Test Game has encountered a problem and needs to close. We are sorry for the inconvenience. Any explanations?
You have an uncaught exception. That typically means you fed some method incorrect input.
Run it in debug mode and use the debugger.
[QUOTE=Chad Mobile;21657951]I'm using a picturebox with a white background, and when I open a picture and the openfile thing is over the picturebox theres a 99% chance that when you open the file you'll click the box and it'll go back to being white. :\[/QUOTE]
Do you mean it's not being repainted?
I also had this problem when I wrote a paint program using GDI+
You can solve it by putting all the actual drawing code into the Paint event of your picture box, then call PictureBox.Invalidate() whenever you need to force it to update.
[QUOTE=Chad Mobile;21662111]Ok, I installed XNA and quick made a game. And whenever I try to launch it it just gives me an error saying Test Game has encountered a problem and needs to close. We are sorry for the inconvenience. Any explanations?[/QUOTE]
What OS are you using?
[QUOTE=Chris220;21665860]Do you mean it's not being repainted?
I also had this problem when I wrote a paint program using GDI+
You can solve it by putting all the actual drawing code into the Paint event of your picture box, then call PictureBox.Invalidate() whenever you need to force it to update.[/QUOTE]This is the issue I believe. Typically when you open the picture you doubleclick the file and end up clicking the box, which erases the new file and draws a new line. I'm trying to allow a file to be opened, drawn over, and saved.
This is my code for opening a file onto the canvas so far. (I know, Visual Basic..It's going to be in C# when I'm done with this tech demo)
[code]
Dim openfiledialog1 As New OpenFileDialog()
openfiledialog1.Filter = "Bitmap Image (*.bmp)|*.bmp |Icon Files (*.ico)|*.ico|Cursor Files (*.cur)|*.cur|PNG Files (*.png)|*.png|JPEG Files (*.JPEG/JPG)|*.jpeg|All Files|*.*"
If openfiledialog1.ShowDialog() = DialogResult.OK Then
PictureBox1.Image = Image.FromFile(openfiledialog1.FileName)[/code]
[QUOTE=Turd92;21653565]Really damn frustrated right now..[/QUOTE]
Got the fucker, thanks to some guy at Stack Overflow. I'll post the answer in case some Googler has the same problem I had.
I had two source files, both called Base.cpp, but in different directories. One was for a base game entity, and this was for a base parsable object. When MSVC compiles, it dumps object files named by their source filename. Thus one was overwritten and the linker couldn't find the function definitions.
The fix is to rename my files :saddowns:
[QUOTE=Chad Mobile;21668454]This is the issue I believe. Typically when you open the picture you doubleclick the file and end up clicking the box, which erases the new file and draws a new line. I'm trying to allow a file to be opened, drawn over, and saved.
This is my code for opening a file onto the canvas so far. (I know, Visual Basic..It's going to be in C# when I'm done with this tech demo)
[code]
Dim openfiledialog1 As New OpenFileDialog()
openfiledialog1.Filter = "Bitmap Image (*.bmp)|*.bmp |Icon Files (*.ico)|*.ico|Cursor Files (*.cur)|*.cur|PNG Files (*.png)|*.png|JPEG Files (*.JPEG/JPG)|*.jpeg|All Files|*.*"
If openfiledialog1.ShowDialog() = DialogResult.OK Then
PictureBox1.Image = Image.FromFile(openfiledialog1.FileName)[/code][/QUOTE]
After[code]PictureBox1.Image[/code]Add [code]PictureBox1.Invalidate()[/code]
Does that fix it?
Nope, does the same thing. :sigh:
Hmm...
Do you have teamviewer? Perhaps I could take a look at your problem and your code, see if we can fix it.
OK, so Raccoon is banned and he's wondering how to make it so in Source, after you've done the trace and such, how you can make the entity go flying backwards
here's his code:
[cpp]
void ForcePush()
{
CBasePlayer *ply = CBasePlayer::GetLocalPlayer();
trace_t tr;
Vector v_Begin, v_Stop, v_Dir;
AngleVectors(ply->EyeAngles(), &v_Dir);
v_Begin = ply->EyePosition();
v_Stop = v_Begin + v_Dir * MAX_TRACE_LENGTH;
UTIL_TraceLine(v_Begin, v_Stop, MASK_ALL, ply, COLLISION_GROUP_BREAKABLE_GLASS | COLLISION_GROUP_NPC, &tr);
if(tr.m_pEnt)
{
CBaseEntity *ent = tr.m_pEnt;
if(tr.m_pEnt->IsNPC())
{
ent->PhysicsImpact(ent, tr);
}
}
}
ConCommand force_push("force_push", ForcePush, "Use the force", NULL);
[/cpp]
it doesn't do anything when he runs the concommand, but it shows up, so it has to be the function.
Anyways, what function can he use to do what he wants?
[QUOTE=Chris220;21669479]Hmm...
Do you have teamviewer? Perhaps I could take a look at your problem and your code, see if we can fix it.[/QUOTE]
I'll PM you a link to all the source.
Is there any documentation of the functions and such in Source, grouped in a logical way? I don't have a clue where to start with my mod.
The documentation on the VDC didn't have anything I could easily use :/
First: I hate Linker Errors They dont make any sense
[code]
------ Build started: Project: forceconvar, Configuration: Debug Win32 ------
Linking...
Creating library C:\Users\Koen\Documents\Visual Studio 2008\Projects\forceconvar\Debug\forceconvar.lib and object C:\Users\Koen\Documents\Visual Studio 2008\Projects\forceconvar\Debug\forceconvar.exp
main.obj : error LNK2019: unresolved external symbol __imp___ExitOnFatalAssert referenced in function "public: __thiscall Vector2D::Vector2D(float,float)" (??0Vector2D@@QAE@MM@Z)
main.obj : error LNK2019: unresolved external symbol __imp__DoNewAssertDialog referenced in function "public: __thiscall Vector2D::Vector2D(float,float)" (??0Vector2D@@QAE@MM@Z)
main.obj : error LNK2019: unresolved external symbol __imp__ShouldUseNewAssertDialog referenced in function "public: __thiscall Vector2D::Vector2D(float,float)" (??0Vector2D@@QAE@MM@Z)
main.obj : error LNK2019: unresolved external symbol __imp___SpewMessage referenced in function "public: __thiscall Vector2D::Vector2D(float,float)" (??0Vector2D@@QAE@MM@Z)
main.obj : error LNK2019: unresolved external symbol __imp___SpewInfo referenced in function "public: __thiscall Vector2D::Vector2D(float,float)" (??0Vector2D@@QAE@MM@Z)
C:\Users\Koen\Documents\Visual Studio 2008\Projects\forceconvar\Debug\forceconvar.dll : fatal error LNK1120: 5 unresolved externals
Build log was saved at "file://c:\Users\Koen\Documents\Visual Studio 2008\Projects\forceconvar\forceconvar\Debug\BuildLog.htm"
forceconvar - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========[/code]
I found a solution here [url]http://developer.valvesoftware.com/wiki/Compiling_under_VS2005[/url] One Problem is that i am using 2008 not 2005 and i am not compiling the sdk just parts of it i use a module for gmod. And that the solution wont help
There is a "Compiling under VS2008" page as well ;)
[QUOTE=ZeekyHBomb;21650763]Getting a microcontroller is a neat thing.
Maybe you should check out that Arduino thread.[/QUOTE]
Or maybe start with a Atmel or PIC chip and a pickit / usb tiny isp instead. It's better to learn it like that, a arduino gets boring and lacks pins very fast.
[QUOTE=Yumyumbublegum;21669704]OK, so Raccoon is banned and he's wondering how to make it so in Source, after you've done the trace and such, how you can make the entity go flying backwards
here's his code:
[cpp]
void ForcePush()
{
CBasePlayer *ply = CBasePlayer::GetLocalPlayer();
trace_t tr;
Vector v_Begin, v_Stop, v_Dir;
AngleVectors(ply->EyeAngles(), &v_Dir);
v_Begin = ply->EyePosition();
v_Stop = v_Begin + v_Dir * MAX_TRACE_LENGTH;
UTIL_TraceLine(v_Begin, v_Stop, MASK_ALL, ply, COLLISION_GROUP_BREAKABLE_GLASS | COLLISION_GROUP_NPC, &tr);
if(tr.m_pEnt)
{
CBaseEntity *ent = tr.m_pEnt;
if(tr.m_pEnt->IsNPC())
{
ent->PhysicsImpact(ent, tr);
}
}
}
ConCommand force_push("force_push", ForcePush, "Use the force", NULL);
[/cpp]
it doesn't do anything when he runs the concommand, but it shows up, so it has to be the function.
Anyways, what function can he use to do what he wants?[/QUOTE]
Any help?
[QUOTE=raccoon12;21679616]Any help?[/QUOTE]
Using PhysicsImpact makes no sense:
[code]
//-----------------------------------------------------------------------------
// Purpose: Two entities have touched, so run their touch functions
// Input : *other -
// *ptrace -
//-----------------------------------------------------------------------------
void CBaseEntity::PhysicsImpact( CBaseEntity *other, trace_t &trace )[/code]
I'd rather try ent->SetVelocity( tr.plane.normal * -velocity )
For players you have to use VelocityPunch (or Push, can't remember), maybe for the NPCs as well.
[QUOTE=Chris220;21673163]Is there any documentation of the functions and such in Source, grouped in a logical way? I don't have a clue where to start with my mod.
The documentation on the VDC didn't have anything I could easily use :/[/QUOTE]
Nope.
Sorry, you need to Log In to post a reply to this thread.