• What do you need help with? Version 1
    5,001 replies, posted
I'm trying to make an Evony/Civilization style 'game' for my Visual Basic final project, but I'm having a few problems. I'm having some trouble figuring out how I'm gonna make everything work. What I do have so far is a map (along with four others, so that one of them is randomly chosen when the program is launched), with a grid of picture boxes over it. Those will be enabled/disabled based on which map is being used (and I think I know how to do this). What I'm currently having trouble with is my little intro form that I've created. We haven't learned about child forms, so I had to read ahead and teach myself. I have it so that when the game is launched, the intro from pops up, and when you press continue it closes and you are allowed to play. However, when I close it, it reopens, and the map is randomized each time. It never goes away, and I'm not too sure what is going wrong.
I am working on some Asynchronous sockets and currently looking at : [url]http://msdn.microsoft.com/en-us/library/fx6588te(v=VS.100).aspx[/url] Does anyone know how to block multiple calls from one client ?
How can I draw text on the screen with OpenGL (Tao)? I'm currently trying something with Glut but I'm lost. Some snippets would be appreciated.
[QUOTE=That Ninja;22129342]I'm trying to make an Evony/Civilization style 'game' for my Visual Basic final project, but I'm having a few problems. I'm having some trouble figuring out how I'm gonna make everything work. What I do have so far is a map (along with four others, so that one of them is randomly chosen when the program is launched), with a grid of picture boxes over it. Those will be enabled/disabled based on which map is being used (and I think I know how to do this). What I'm currently having trouble with is my little intro form that I've created. We haven't learned about child forms, so I had to read ahead and teach myself. I have it so that when the game is launched, the intro from pops up, and when you press continue it closes and you are allowed to play. However, when I close it, it reopens, and the map is randomized each time. It never goes away, and I'm not too sure what is going wrong.[/QUOTE] Quoting cause it was the last post on the previous page, I'd never have gotten help with it.
I accidentally cleared with alpha 0.0f.
[QUOTE=Overv;22162176]I'm drawing this simple scene of three colored boxes to a FBO with OpenGL (for post-processing), however as soon as I turn on alphablending with the GL_BLEND state, the situation in the second picture arises: Not clearing the render target causes exactly the same situation and it doesn't look like it has anything to do with that. [b]Edit:[/b] Disabling alpha blending before clearing and enabling it again after it, seems to do the trick. Strange.[/QUOTE] Dude you've been here for a while now, surely you can remember that we need to see your code.
[QUOTE=blankthemuffin;22162213]Dude you've been here for a while now, surely you can remember that we need to see your code.[/QUOTE] Sorry, but I solved it myself.
Did you set alpha of glClearColor to 1?
Yes, but I'm sure I played with alpha blending before and an alpha of 0.0f was fine in glClearColor. Maybe I accidentally avoided the situation with a glClear() call with alpha blending turned on. [b]Edit:[/b] I just tried it again with an alpha of 0.0f, but that does not seem to make any difference at all in the color buffer. It most likely has something to do with the difference between rendering to a texture or the color buffer.
Since the FASM board doesn't seem to be visited too frequently I'll try my luck here again. I'm [url=http://board.flatassembler.net/topic.php?t=11538]having troubles[/url] (*linkedy hint hint*) using [url=http://opengroup.org/onlinepubs/007908775/xsh/select.html]select[/url] in FASM. Any help would be appreciated :)
[QUOTE=ZeekyHBomb;22172398]Since the FASM board doesn't seem to be visited frequently I'll try my luck here again. I'm [url=http://board.flatassembler.net/topic.php?t=11538]having troubles[/url] using [url=http://opengroup.org/onlinepubs/007908775/xsh/select.html]select[/url] in FASM. Any help would be appreciated :)[/QUOTE] whats the code you are using? Also does it compile?
The "having troubles" was linking to the post on the FASM board, which contains the code. Probably should have made that more clear. It also contains more information on how the code performs when run. [edit] It's fixed. The man-page was showing the instructions for newselect, but I called the old select.
How would I get my c++ program to create entities? these entities are going to be used in a class based system, but I do not know how to initialize them. I do know you have to use the "new" function, but I know nothing more.
Using C#, I have a couple of problems. Is there a way to have a Dictionary of Dictionaries where each inner Dictionary's value type is a class extended from a certain class? Like I have a base class "RBase", and two classes that extend it "RSprite" and "RLua". I want a Dictionary which contains Dictionaries for each of these classes, like: [code]Dictionary< String, Dictionary< String, T >> resource_lists = new Dictionary< String, Dictionary< String, T >>() where T : RBase;[/code] Or something like that. And when I add to the outer dictionary I can do: [code]resource_lists.Add( "RSprite", new Dictionary< String, RSprite > ); resource_lists.Add( "RLua", new Dictionary< String, RLua > );[/code] Theres probably a much better way of doing this but I just got out a 3 hour long exam session so my brain is sort of tired. [editline]02:03PM[/editline] And if that is impossible, then if instead I have separate dictionaries for each class that extends RBase like this: [code]private static Dictionary< String, RSprite > list_sprite = new Dictionary< String, RSprite >(); private static Dictionary< String, RLua > list_lua = new Dictionary< String, RLua >();[/code] Then how can I get something like this to work: [code]public static T GetItem< T >( String item_name ) where T : RBase { return GetList<T>()[ item_name ]; } private static Dictionary< String, T > GetList<T>() where T : RBase { switch ( typeof( T ).ToString().Split( ( "." ).ToCharArray() )[ 2 ] ) { case "RSprite": return list_sprite; case "RLua": return list_lua; } return null; }[/code] It says [code]Cannot implicitly convert type 'System.Collections.Generic.Dictionary<string,Lewt.Resource.RSprite>' to 'System.Collections.Generic.Dictionary<string,T>'[/code] When I return a list in GetList()
Covariance my boy: [code] Dictionary<string,RBase> lol; [/code]
[QUOTE=turb_;22192416]Covariance my boy: [code] Dictionary<string,RBase> lol; [/code][/QUOTE] But then I have to ( type ) what I get out to access its specific functions, I was wandering if there was a way without having to do that :saddowns:
[code]public static T GetItem<T>(string name) where T : RBase { return (T)resource_lists[name]; }[/code]
[QUOTE=itsbth;22192631][code]public static T GetItem<T>(string name) where T : RBase { return (T)resource_lists[name]; }[/code][/QUOTE] Could have sworn that didn't work last time I tried.. Thanks everyone!
-snip- [editline]06:03PM[/editline] nvm I'm dumb
Is there a way to check is a some key has a set value or not in a Dictionary? For example if I have Dictionary<string, bool> and want to check if the key "a" has a true value. Is "a" isn't set then dictonary["a"] will throw an error.
[QUOTE=Darwin226;22196886]Is there a way to check is a some key has a set value or not in a Dictionary? For example if I have Dictionary<string, bool> and want to check if the key "a" has a true value. Is "a" isn't set then dictonary["a"] will throw an error.[/QUOTE] Just use .ContainsKey?
Wow... idiot. I swear that method wasn't there when I read the MSDN.
Is there some way to check if my form size has changed and run code if it did? I tried with a while loop and it crashs my program. (I'm using C#)
Listen to the [url=http://msdn.microsoft.com/en-us/library/system.windows.forms.control.resize.aspx]Resize[/url] event.
How can I save the values of a Listbox to a .txt file and load them again next time the program is started? (C#)
Need a little help with some algorithm, I have a n amount of depth ( with depth I mean underground ) and the deeper you get the more rarer the ore gets, I have a array with the rareness like 10, 100, 1000, 10000 I have absolutely no idea how to get it to work so that the deeper you get the more you find the rarer ore and less low quality
[QUOTE=Chad Mobile;22200419]How can I save the values of a Listbox to a .txt file and load them again next time the program is started? (C#)[/QUOTE] StreamWriter/StreamReader and iteration.
OK, I'll try to figure that out. :v:
[QUOTE=quincy18;22200430]Need a little help with some algorithm, I have a n amount of depth ( with depth I mean underground ) and the deeper you get the more rarer the ore gets, I have a array with the rareness like 10, 100, 1000, 10000 I have absolutely no idea how to get it to work so that the deeper you get the more you find the rarer ore and less low quality[/QUOTE] Just look at some common functions like f(x) = x^n and f(x) = n^x (1 > n < 0 and n < 0, too) and play with them a little in some grapher.
Like before I have a dictionary of dictionaries, each containing objects extended from my RBase class. Is there an easy way to add a new object of the correct class if I have the class name as a string? [code]resource_lists[ "R" + new_item_type ].Add( new_item_name, new /*dynamic type*/( new_item_params ));[/code] I don't want to have to use a select case statement or anything if its possible to avoid one.
Sorry, you need to Log In to post a reply to this thread.