Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: 1 ... 8 9 [10] 11   Go Down

Author Topic: Programming Q&A  (Read 31391 times)

0 Members and 1 Guest are viewing this topic.
Re: Programming Q&A
« Reply #180 on: December 20, 2008, 11:56:18 pm »
  • The king of Awesome
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 198
Does anyone know how to create huds in C#/XNA? I know how to draw the images but not so code them, I'm sure I can code a number based hud system. Can't code a heart engine or a meter based hud yet.
Logged
Re: Programming Q&A
« Reply #181 on: December 21, 2008, 12:01:47 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
In the world of C#, it depends on how you've set up your system, and how much you know and can learn. I could whip up a quick, general mini-tutorial for you, if you are interested.

I warn you, though, when I write tutorials, I explain things and expect you to learn what I'm teaching you to do, rather than you just taking the system and throwing it in without learning any of it. I want you to understand why I do things the way I do.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: Programming Q&A
« Reply #182 on: December 21, 2008, 01:35:25 am »
  • The king of Awesome
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 198
It's not that I don't understand, I just dunno how, I'd appreciate it if you did though^^
Logged
Re: Programming Q&A
« Reply #183 on: December 21, 2008, 01:53:24 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
About half-way done (I started on it earlier). I'll finish it and upload it after I'm done playing TFU
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: Programming Q&A
« Reply #184 on: December 21, 2008, 03:52:23 am »
  • The king of Awesome
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 198
Awesome thanks, this will be a huge help, I'll learn soo much from it^^
Logged
Re: Programming Q&A
« Reply #185 on: December 21, 2008, 04:17:12 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Created. I've posted it in the Tutorials board.

http://www.zfgc.com/forum/index.php?topic=32778.0
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

Xiphirx

wat
Re: Programming Q&A
« Reply #186 on: January 03, 2009, 01:08:01 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
Say I have a ListBox in one program, and I want to get the List from that, convert it to a string, and put it in a text box in my program.

I have tried to get the ListBox's List:
Code: [Select]
hWndPlayers = FindWindowEx(hWndServer, 0&, "WindowsForms10.LISTBOX.app.0.378734a", vbNullString)
Yes this is VB

But, hWndPlayers returns 0... The class name is correct (I used WinSpy ++ 1.7). What could be going on?
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #187 on: March 02, 2009, 04:44:30 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 84
I'm just starting out in using game maker. I just downloaded game maker 7 and I want to learn how to make a zelda engine from scratch. What do I do :huh:
Logged
Re: Programming Q&A
« Reply #188 on: March 02, 2009, 04:58:17 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I'm just starting out in using game maker. I just downloaded game maker 7 and I want to learn how to make a zelda engine from scratch. What do I do :huh:

A part of me really hopes this is a troll... Say you want to learn a language. Not a programming language, a real one. Like French or German or Japanese. You start off with the basics, learn how to introduce yourself, how the words fit together. Then you start to form basic sentances, and so-on.

Learning a programming language is very similar. You learn the basics, what commands do and mean what, how the syntax is organised (if it's not drag & drop) and so-on. You read about the basics, and use them to form sentances, or small programs as is the case. Then you use this acquired knowledge to learn and understand more, until you know enough to effectively communicate in the language, or in the case of programming/dragging-and-dropping-pansy-game-maker-work effectively get a developed and function program up and running.

TL:DR version: Read the tutorials, learn the basics and apply them.
Logged
Re: Programming Q&A
« Reply #189 on: March 02, 2009, 05:03:20 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Posts: 280
You should start by downloading some Game Maker examples and study them, here are a bunch you can download. You could read the help file of Game Maker too, it really helps when you don't know how this or that function works. Game Maker has got an official forum too, there you can get help and you can find lots of tutorials. And finally I think you can ask for help on this forum, I know there are a bunch of people who use Game Maker here.
Logged
Re: Programming Q&A
« Reply #190 on: March 02, 2009, 09:46:23 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I seem to be having an odd C++ linker error. It's probably something simple...

I have a singleton template class. Now, obviously this contains a static templated pointer. This needs to be declared, so I do this in a special cpp file, ISingleton.hpp.

Now, if I do a full-on templated declaration of:
template <class T> T* DOM::System::Tools::ISingleton<T>::_pv_singleton = 0;

I get compile-time errors of undefined references to _pv_singleton. Now, if I do this in main.cpp instead of ISingleton.cpp, it compiles and executes without complaint. Similarily, if I specialise the class in ISingleton.cpp, say:

template <> int* DOM::System::Tools::ISingleton<int>::_pv_singleton = 0;

and then create a singleton of type ISingleton<int>, this also compiles fine.

Anybody got any idea why this is screwing with me like this? :)
« Last Edit: March 02, 2009, 10:59:57 pm by TheDarkJay »
Logged
Re: Programming Q&A
« Reply #191 on: March 02, 2009, 11:07:54 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
Try making it static?  What does the error read?
Logged



i love big weenies and i cannot lie
Re: Programming Q&A
« Reply #192 on: March 02, 2009, 11:15:25 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Try making it static?  What does the error read?

make what static? The pointer in the class is static <_<

Error is just
obj\Debug\CODE\src\main.o||In function `ZN3DOM6System5Tools10ISingletonIfE11getInstanceEv':|
::Create()]+0x1d)||undefined reference to `DOM::System::Tools::ISingleton<float>::_pv_singleton'|
::getInstance()]+0x8)||undefined reference to `DOM::System::Tools::ISingleton<float>::_pv_singleton'|
::getInstance()]+0x15)||undefined reference to `DOM::System::Tools::ISingleton<float>::_pv_singleton'|
::Delete()]+0x8)||undefined reference to `DOM::System::Tools::ISingleton<float>::_pv_singleton'|
::Delete()]+0x12)||undefined reference to `DOM::System::Tools::ISingleton<float>::_pv_singleton'|
||=== Build finished: 5 errors, 0 warnings ===|
Logged
Re: Programming Q&A
« Reply #193 on: March 16, 2009, 07:09:34 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Turns out the problem is with how C++ compilers link together CPP files. They remaie aware of template specialisation but not of the more abstract version. I created a define macro which allows for specialisation easily in CPP files and left it at that, seems like a good approach in the end when I think of it, since I create templates with the likelyhood of them being specialised for certain uses in mind (policy based design has me by the balls).
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #194 on: March 21, 2009, 12:47:41 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
- Removed. I'm dumb.
Logged
  • For The Swarm

Xiphirx

wat
Re: Programming Q&A
« Reply #195 on: April 11, 2009, 09:25:32 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
What is wrong with this?

Code: [Select]
//Everything is good, update the database
$query = "UPDATE news SET title = ".$newstitle.", post = ".$newspost.", date = ".$date." WHERE id = ".$id." LIMIT 1 ";
$result = $connector->query($query);

if ($result==1)
{
header("location:index.php");
}
else
{
$error = "Error, could not insert into database!".$result.$id."";
header("location: index.php?action=error&message=".$error."");
}

I always get the error message "Error, could not insert into database!"...

I have triple checked the query and the actual table.
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #196 on: April 11, 2009, 09:41:23 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Not sure off hand. I usually use mysql manually, I don't use proxy objects.

However the things I would recommend checking is both that the result returns 1 on true (usually its 0 if successfull). And I would also quote all the strings in your query, as well as escape any quotation marks within the values to prevent sql injection.

eg.

Code: [Select]
$query = "UPDATE news SET title = '".addslashes($newstitle)."', post = '".addslashes($newspost)."', date = ".$date." WHERE id = ".$id." LIMIT 1 ";
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #197 on: April 11, 2009, 09:45:07 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
Not sure off hand. I usually use mysql manually, I don't use proxy objects.

However the things I would recommend checking is both that the result returns 1 on true (usually its 0 if successfull). And I would also quote all the strings in your query, as well as escape any quotation marks within the values to prevent sql injection.

eg.

Code: [Select]
$query = "UPDATE news SET title = '".addslashes($newstitle)."', post = '".addslashes($newspost)."', date = ".$date." WHERE id = ".$id." LIMIT 1 ";


$result is returning nothing for some reason.
Code: [Select]
$error = "Error, could not insert into database!".$result.$id."";

For example, would display as "Error, could not insert into database!20"; 20 is the id, so the result = ""...
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #198 on: April 12, 2009, 02:17:52 am »
  • If not now, when?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 520
Assuming that $connector is a PDO object... Try this instead:
Code: [Select]
//Everything is good, update the database
$query = "UPDATE news SET title = ".$newstitle.", post = ".$newspost.", date = ".$date." WHERE id = ".$id." LIMIT 1 ";
$result = $connector->exec($query);

if ($result==1)
{
header("location:index.php");
}
else
{
$error = "Error, could not insert into database!".$result.$id."";
header("location: index.php?action=error&message=".$error."");
}
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #199 on: April 12, 2009, 02:51:21 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
No no, I figured it out. Apparently it wanted single quotes around the values and no quotes around the field names : /

Btw, Connector is a class (lol my first ever php class).
Logged
  • For The Swarm
Pages: 1 ... 8 9 [10] 11   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.066 seconds with 75 queries.

anything