Been working all day on networking, which has been a total cunt ass to me, but that's okay. I actually got it communicating now. Now to make it read more than 4 byes of data from a packet.
[editline]17th October 2010[/editline]
I love how UDP sockets are just like, "Server Downtime? What the hell is that? I'm just sendin' me some packets, whatevs man, whatevs."
[QUOTE=NorthernGate;25480809]Been working all day on networking, which has been a total cunt ass to me, but that's okay. I actually got it communicating now. Now to make it read more than 4 byes of data from a packet.
[editline]17th October 2010[/editline]
I love how UDP sockets are just like, "Server Downtime? What the hell is that? I'm just sendin' me some packets, whatevs man, whatevs."[/QUOTE]
Datagrams don't suck but, writing huge amounts of networking code and not having a server to test sucks :P
[QUOTE=geel9;25466417]Faster than a raging Jallen!
[url]http://www.youtube.com/watch?v=Z4tfBLz5uUM[/url]
(Let it process)[/QUOTE]
Yes but I did it in C++ :smugdog:
[QUOTE=Jallen;25481649]Yes but I did it in C++ :smugdog:[/QUOTE]
Yeah, plus a raging Jallen isn't even that fast. He doesn't even find out about the random dumb ratings until about half an hour after it's done. :v:
[QUOTE=Jallen;25481649]Yes but I did it in C++ :smugdog:[/QUOTE]
Proof that choosing another language can be beneficial :D
Working on a system in GMod to upload saved games to our servers, to be played and rated by other players (by a click of a button!!).
So far I've got the saving working, I've got the loading working, and I've got the uploading working. Just need to make it so that once uploaded the player can edit the details (and maybe upload a screenshot too).
Here's some code that means nothing, but I want to test the tags.
[cpp] ILuaObject* pLibrary = g_Lua->RequireGlobal( "gmsave", GLua::TYPE_TABLE );
ILuaObject* pFunction = pLibrary->RequireMember( "SaveMap", GLua::TYPE_FUNCTION );
pFunction->Push();
Push_Entity( pPlayer );
if ( !g_Lua->Call( 1, 1 ) )
return;
ILuaObject* pObject = g_Lua->GetReturn( 0 );
if ( !pObject->isString())
return;
const char* strMapSave = pObject->GetString();
if ( !strMapSave || Q_strlen( strMapSave ) < 5 )
return;
SaveUpload* pUpload = new SaveUpload;
pUpload->player = pPlayer;
HTTPConnection* pConnection = new HTTPConnection();
pConnection->SetCallback( SaveUploadCallback, (void*)pUpload );
pConnection->SetSelfDestruct( true );
pConnection->PostInThread( strURL, (void*)strMapSave, Q_strlen(strMapSave) );[/cpp]
[QUOTE=garry;25484829]Working on a system in GMod to upload saved games to our servers, to be played and rated by other players (by a click of a button!!).
So far I've got the saving working, I've got the loading working, and I've got the uploading working. Just need to make it so that once uploaded the player can edit the details (and maybe upload a screenshot too).
Here's some code that means nothing, but I want to test the tags.
[code] ILuaObject* pLibrary = g_Lua->RequireGlobal( "gmsave", GLua::TYPE_TABLE );
ILuaObject* pFunction = pLibrary->RequireMember( "SaveMap", GLua::TYPE_FUNCTION );
pFunction->Push();
Push_Entity( pPlayer );
if ( !g_Lua->Call( 1, 1 ) )
return;
ILuaObject* pObject = g_Lua->GetReturn( 0 );
if ( !pObject->isString())
return;
const char* strMapSave = pObject->GetString();
if ( !strMapSave || Q_strlen( strMapSave ) < 5 )
return;
SaveUpload* pUpload = new SaveUpload;
pUpload->player = pPlayer;
HTTPConnection* pConnection = new HTTPConnection();
pConnection->SetCallback( SaveUploadCallback, (void*)pUpload );
pConnection->SetSelfDestruct( true );
pConnection->PostInThread( strURL, (void*)strMapSave, Q_strlen(strMapSave) );[/code][/QUOTE]
Nice, will you be able to edit uploaded savegames, or do you have to delete the old one and upload the new one?
[QUOTE=garry;25484829]Working on a system in GMod to upload saved games to our servers, to be played and rated by other players (by a click of a button!!).
So far I've got the saving working, I've got the loading working, and I've got the uploading working. Just need to make it so that once uploaded the player can edit the details (and maybe upload a screenshot too).
Here's some code that means nothing, but I want to test the tags.
[/QUOTE]
You still have Sleep(30000) in your code? :smug:
[QUOTE=efeX;25478450]holy damn is that delphi down there?[/QUOTE]
Yesh, it's still the best (to me) to make small tools when I have an idea.
Eclipse for Java/Android/C++/Ruby and Visual Studio for this semesters course (Tbh, eclipse is more dev. friendly :P)
[QUOTE=AtomiC0l;25469739]You could also split the map into a grid and check for collision on objects that are inside and adjacent to the grid tile you're currently inside to not loop through the ENTIRE list of objects you have in the map.[/QUOTE]
That is a good idea, thank you. However, as this was just a quick demo I don't think I can even actually do that.
[QUOTE=Dlaor-guy;25469136]I beg you, please share the collision code, I'm still clueless after all these months of trying to get platform physics to work! Otherwise I'll get desperate and use a physics engine, which is totally not needed :crying:[/QUOTE]
Well since you asked so nicely, I will share with you how I am doing it. The code is currently messy and has a messy soloution thrown in to calculate collision when moving faster than 1 pixel per frame. But all I am doing is using an AABB rect, and first shifting it by the Y direction, so in my case 1 pixel downwards for gravity and then checking for collision. If I do find a collision I move it back to where it was originally. You then repeat the same thing for the X axis and ta-dah you get yourself some collision. Here is ome rough pseudo-code:
[code]
move player by y axis
if colliding:
move back
move player by x axis
if colliding:
move back
[/code]Now I might as well share the terrible soloution I have for moving more than one pixel, I have two variables, yspeed and xspeed. All I do is in a for loop which loops as many times as there are in each speed variable for the corresponding axis, it does the above section of code and breaks when it finds a collision. So:
[code]
do this yspeed amount of times:
move player by y axis 1 pixel in desired direction
if colliding:
move back
break
do this xspeed amount of times:
move player by x axis 1 pixel in desired direction
if colliding:
move back
break
[/code]
This is probably a really bad way of doing things, but it works which is the important thing for me.
I think i broke it... (entered random shit)
[IMG]http://img254.imageshack.us/img254/8636/88631978.png[/IMG]
[URL="http://img254.imageshack.us/img254/8636/88631978.png"]
[/URL]
[QUOTE=bromvlieg;25485652](entered random shit)[/QUOTE]
did you even learn brainfuck before you made an interpreter
I don't think he did it :v:
I guess you could say brain fucked... fucked...with his brain? Ya know.
Looks correct to me.
[editline]18th October 2010[/editline]
the > at the start is completely pointless though.
Downloaded resharper to try it. Ugh the auto complete stuff pisses me off and the names in the options are so obscure. Why can't they just have 'This option does the annoying "" when you do " '.
[QUOTE=bromvlieg;25485652]I think i broke it... (entered random shit)
[/QUOTE]
You just made an infinite loop.
I didn't think VB6 even worked still on Windows Vista / 7
Move to .NET - you'll laugh, you'll cry, it'll change your life.
[QUOTE=CarlBooth;25486576]I didn't think VB6 even worked still on Windows Vista / 7
Move to .NET - you'll laugh, you'll cry, it'll change your life.[/QUOTE]
For better or for worse?
I'm still at very basic things. Progress is very slow at school and we only get 30 minutes a week with our teacher because our school isn't even supposed to have a programming course anymore.
[code]
import javax.swing.JOptionPane;
//Made by Peyman Torabi, NV2A, Kunskapsgymnasiet Malmo.
public class circle_calc {
public static void main (String[] arg) {
String s = JOptionPane.showInputDialog(null, "Insert the circles radius.",
"Calculate the circumference and area of a circle.", JOptionPane.WARNING_MESSAGE); /*
The user inserts a value, this being the circles radius.*/
double value = Double.parseDouble(s); //We check for the numbers value.
double circumference = Calculations.circumference(value);
//Calling for the Calculation class and the methods circumference and area.
//They do their tasks and then return a value that is stored and displayed in a message box.
double area = Calculations.area(value);
JOptionPane.showMessageDialog(null, "The results are: \n" +
"Circumference = " + circumference + "\nArea = " + area);
}
}
class Calculations {
public static double area(double a) {
double pi = 3.14;
return (pi*a*a);
}
public static double circumference (double b) {
double pi = 3.14;
return (2*pi*b);
}
}
[/code]
That's probably the most advanced thing I've made. I enjoy programming a lot. But it feels like I'm heading for a dead end since I'm shit at maths, or well. I don't have the highest grade at least.
I think I somehow managed to rate myself agree.
[QUOTE=CommanderPT;25487023](The formatting messed up. It doesn't look that bad normally.)[/QUOTE]
You can use [cpp] tags if you don't mind the messed up syntax highlighting.
Also, instead of defining pi yourself, use Math.PI.
I've got a really silly problem, I've got a c# console app and I want to have a box around the content of the app so I've got a char array which I'll put the content where I want it and then I'm simply writing the array to the console when I need to. However when I write the content of the array to the console the very last call to Console.Write() which puts a character in the very bottom right of the console also puts a newline character there as well, so I end up loosing the top line of my content.
I think an example will probably help:
[img]http://img215.imageshack.us/img215/343/capture1cg.png[/img]
There should be plus signs in the top corners and the ones at the bottom should be another line down. Anyone got any ideas how I can do what I want?
[QUOTE=xAustechx;25485818]I guess you could say brain fucked... fucked...with his brain? Ya know.[/QUOTE]
Damn man, your on fire today.
[QUOTE=Wickedgenius;25487256]
There should be plus signs in the top corners and the ones at the bottom should be another line down. Anyone got any ideas how I can do what I want?[/QUOTE]
It would be just easier to make the box 1 line lower. It's not very easy to achieve that. Once I wanted something similar.
[QUOTE=xAustechx;25485223]You still have Sleep(30000) in your code? :smug:[/QUOTE]
hey now don't feed off my content brotha
[QUOTE=Wickedgenius;25487256]I've got a really silly problem, I've got a c# console app and I want to have a box around the content of the app so I've got a char array which I'll put the content where I want it and then I'm simply writing the array to the console when I need to. However when I write the content of the array to the console the very last call to Console.Write() which puts a character in the very bottom right of the console also puts a newline character there as well, so I end up loosing the top line of my content.
I think an example will probably help:
[img_thumb]http://img215.imageshack.us/img215/343/capture1cg.png[/img_thumb]
There should be plus signs in the top corners and the ones at the bottom should be another line down. Anyone got any ideas how I can do what I want?[/QUOTE]
[url]http://www.devsource.com/c/a/Using-VS/Working-with-Console-Screen-Buffers-in-NET/[/url]
This should do.
[QUOTE=raBBish;25487148]You can use [cpp] tags if you don't mind the messed up syntax highlighting.
Also, instead of defining pi yourself, use Math.PI.[/QUOTE]
Oh thanks. You mean I should put in return return (Math.PI*a*a);?
[QUOTE=ZeekyHBomb;25488160][url]http://www.devsource.com/c/a/Using-VS/Working-with-Console-Screen-Buffers-in-NET/[/url]
This should do.[/QUOTE]
I'll take a look at that, thanks :smile:
[QUOTE=Giraffen93;25488631][url]http://braxnet.org/games/japan.swf[/url]
Well, it's something :v:[/QUOTE]
Survived the pit of doom (winner)
Sorry, you need to Log In to post a reply to this thread.