Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
madiik wrote:Create a successful "left" message tutorial.
I think that i know what espanol jabatheblob1 would just do in the if (m.Type == "left")
Hint:
if (Players.ContainsKey(m.GetInt(0))) { Players.Remove(m.GetInt(0)); }
So how will you plan to use that code with custom classes? I'd really like to see that happen.
shh i have returned
Offline
Srna wrote:madiik wrote:Create a successful "left" message tutorial.
I think that i know what espanol jabatheblob1 would just do in the if (m.Type == "left")
Hint:
if (Players.ContainsKey(m.GetInt(0))) { Players.Remove(m.GetInt(0)); }
So how will you plan to use that code with custom classes? I'd really like to see that happen.
->class Player{}
--> add a dictionary<int,Player>
userid as key, Player class as value
-> when a player leave, remove it from the dictionary.
Players.Remove(m.GetInt(0));
Offline
madiik wrote:Srna wrote:madiik wrote:Create a successful "left" message tutorial.
I think that i know what espanol jabatheblob1 would just do in the if (m.Type == "left")
Hint:
if (Players.ContainsKey(m.GetInt(0))) { Players.Remove(m.GetInt(0)); }
So how will you plan to use that code with custom classes? I'd really like to see that happen.
->class Player{}
--> add a dictionary<int,Player>
userid as key, Player class as value-> when a player leave, remove it from the dictionary.
Players.Remove(m.GetInt(0));
Or use OOP. http://pastebin.com/NwKPsX42
Offline
Or
struct Player { public string Name; public int Wins; public bool isPlaying;} Dictionary<int, Player> Players = new Dictionary<int, Player>(); Dictionary<string, int> wins = new Dictionary<string, int>(); //... // TODO: Read the wins file and save it to the wins dictionary. //... if (e.Type == "add") { Players.Add(e.GetInt(0), new Player(){Name = e.GetString(1), Wins = wins[e.GetString(1)], isPlaying = false}); } // Set isPlaying to true once the player joins the playing area, and whenever you wanna check, do // foreach (var player in Players) { if (player.isPlaying) {/*Do whatever you want.*/}} // Or, if you want a specific player // foreach (var player in Players) { if (player.isPlaying && player.Name == Players[e.GetInt(0)].Name) {/*More random stuff*/} } if (e.Type == "left") { Players.Remove(e.GetInt(0)); // Player is removed, along with their "isPlaying" status. }
Offline
Offline
Does anyone want more tutorials?
If you would like me to make a bot for you, go here.
Offline
You should learn SOME C# before trying to make bots.
Meh , i used bots for ee to learn c# , not learn c# to write ee bots
Offline
I still think the tutorials would be much better (but perhaps a bit more boring) if you'd explain everything through audio (aka, speaking).
If you prefer not to do it yourself you can ask somebody else to put a voice over after you made the video, or write a 'script' and let somebody else do the vids (obviously the video would still be uploaded to your channel since it's basically yours.
I volunteer for either jobs c:
Offline
Xfrogman43 wrote:You should learn SOME C# before trying to make bots.
Meh , i used bots for ee to learn c# , not learn c# to write ee bots
I did this too so I would learn c# from making bots.
Anyways, put up the load/saving levels tutorial in the OP since you do not have it linked yet.
"Description: Description: is definitely orginal!" ~ Fastmapler The
Offline
I still think the tutorials would be much better (but perhaps a bit more boring) if you'd explain everything through audio (aka, speaking).
If you prefer not to do it yourself you can ask somebody else to put a voice over after you made the video, or write a 'script' and let somebody else do the vids (obviously the video would still be uploaded to your channel since it's basically yours.I volunteer for either jobs c:
i can voice over it
Anyways, put up the load/saving levels tutorial in the OP since you do not have it linked yet.
just changed it
If you would like me to make a bot for you, go here.
Offline
This is too complex for some people. I know many people who saw these tutorials and did total nonsense in their Visual Studio and I had to go to their PC in teamviewer and rebuild their connect code from scratch.
Otherwise, it's all good.
Offline
This is too complex for some people. I know many people who saw these tutorials and did total nonsense in their Visual Studio and I had to go to their PC in teamviewer and rebuild their connect code from scratch.
Otherwise, it's all good.
You didn't "have" to, you're just a nice guy and wanted to help.
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
This is too complex for some people. I know many people who saw these tutorials and did total nonsense in their Visual Studio and I had to go to their PC in teamviewer and rebuild their connect code from scratch.
Otherwise, it's all good.
What type of things were wrong?
If you would like me to make a bot for you, go here.
Offline
alkazam1448 wrote:This is too complex for some people. I know many people who saw these tutorials and did total nonsense in their Visual Studio and I had to go to their PC in teamviewer and rebuild their connect code from scratch.
Otherwise, it's all good.
What type of things were wrong?
Some kestus guy messed up the entire connect code. He wrote some connect code even outside the namespace.
Offline
Jabatheblob1 wrote:alkazam1448 wrote:This is too complex for some people. I know many people who saw these tutorials and did total nonsense in their Visual Studio and I had to go to their PC in teamviewer and rebuild their connect code from scratch.
Otherwise, it's all good.
What type of things were wrong?
Some kestus guy messed up the entire connect code. He wrote some connect code even outside the namespace.
i didn't want a name, that was kind of disrespectful. I just asked what went wrong. He should just rewatch the video a few times, it's a quick video.
If you would like me to make a bot for you, go here.
Offline
alkazam1448 wrote:Jabatheblob1 wrote:alkazam1448 wrote:This is too complex for some people. I know many people who saw these tutorials and did total nonsense in their Visual Studio and I had to go to their PC in teamviewer and rebuild their connect code from scratch.
Otherwise, it's all good.
What type of things were wrong?
Some kestus guy messed up the entire connect code. He wrote some connect code even outside the namespace.
i didn't want a name, that was kind of disrespectful. I just asked what went wrong. He should just rewatch the video a few times, it's a quick video.
Well it's not the problem with the video. It is just that he didn't know C#. Well, now he's doing fine. I saw his code now, it's not bad.
Offline
for thsoe who have been struggling *cough jawap* i made a new connection video that has a voiceover and shows you exactly step by step what to do.
If you would like me to make a bot for you, go here.
Offline
How to make a ban list. (along with saving the file)
Offline
How to make a ban list. (along with saving the file)
http://botbits.yonom.org/examples/bans
It's botbits, but it's preety easy to change it into PlayerIOClient.
Offline
Offline
I'm learning C# on the way... If you already know how to code it's just a question of translation
SUGGESTION: what kinda stresses me out is the total absence of usage for the static void main, which is quite necessary for any Java/C/Python programmer.... I know C# needs everything to run in a method, but is it possible to have a loop going outside any given method (or at least have a method that can be identified as MAIN)? Can such aspect be outlined in the tutorials?
Btw the tutorials are neither too short nor too messy... They are just right... You pause, understand and then code yourself!
Offline
This is more of a question not suited for the tutorials page... it's not even EE related. BUT...
There is a static void main. On consoles (probably where you're thinking), it's the entry point for the program's execution. Actually, the same is true for forms. You just don't see it because vs20** automatically gives you three lines to run 'em. In short, they run your form. The reason you can't really run [long] loops on your form's events is because you'd be using the thread that runs your form. This means that rendering, events, etc. all wait until your code is done running. The fix to that is to create a thread outside that of the form's thread. Though it is suggested you use Task instead of thread. Keep in mind, threads are a bit of a can of worms to open... depending on how deep you're going.
To be direct: No, all code goes inside something. In this case, we're talking methods. There is a method "identified" as main. It's called "main". In your form project, find Program.cs
Offline
Thank you very much for your answer! I now see it... Though do variables and everything else need to be global for them to be recognized outside their particular method (in such a way that they may be called in the main)?
Offline
[ Started around 1732856251.9655 - Generated in 0.118 seconds, 12 queries executed - Memory usage: 1.86 MiB (Peak: 2.15 MiB) ]