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.
Hmmm... I will try updating. Thanks again for your help
[EDIT] Ok, works now. Thanks!
Last edited by Happychubbybubby (Jul 22 2013 12:56:39 am)
Squad wrote:I'm currently running .NET Framework 4.0, and I have tried multiple times to download .NET Framework 4.5 so I can use this SDK. Any ideas? I've tried completely redoing the Framework too.
Hm... it should be using 4.0 already.
https://github.com/Seist/Skylight/blob/ … csproj#L12
I would recommend reinstalling the SDK.
I don't know when the last time the puush download link was updated. You could have downloaded it before I downgraded from 4.5 to 4.0, which would create a problem.
Re-downloaded, works brilliantly. Thanks.
Thank you eleizibeth ^
I stack my signatures rather than delete them so I don't lose them
Offline
Maybe something for the sdk? http://pastebin.com/Q6frEeg7
Offline
Maybe something for the sdk? http://pastebin.com/Q6frEeg7
I actually already had a list, but forgot to sync it up. But thanks for the efforts.
Yeah, well, you know that's just like, uh, your opinion, man.
Offline
Hi again... :rolleyes:
I've got everything up and running. Except for one thing.
I'm making a rename the room command, I.E. !name.
To do this, I tried:
if(args[0] = !name) { MyBot.Push.Title(args[1]); }
But upon doing this, realised that if the room name was more than one word, it would only take the first word.
I tried lots of different things, but could come up with no way of determining the length of "args", considering it is a []string.
If anyone could help me, that would be great thanks
I'm assuming you're splitting the string by spaces.
An easy way to go about doing this is by using the substring method, or the replace method. I'm about to go to bed and don't really feel like explaining this in detail, but it's really easy so try googling it.
Offline
Ok... Thanks for your help anyway.
[EDIT]
I figured out what substring does.
I'm gonna need more detail. Not today, but sometime.
I tried, and it tells me substring doesn't exist.
I have to leave for now, good night. If anyone could explain in detail what I should do, I will talk tomorrow.
Last edited by Happychubbybubby (Jul 30 2013 4:47:27 am)
You can always just use a different character for the split, like a dash, so then it will be something like !name-HBC's Boss.
However, I'm a progamming nub so I'm not sure if you should take my advice.
thx for sig bobithan
Offline
But upon doing this, realised that if the room name was more than one word, it would only take the first word.
I tried lots of different things, but could come up with no way of determining the length of "args", considering it is a []string.
If anyone could help me, that would be great thanks
You would need to use String.Join in order to get the full name.
if (args[0] == "!name") { MyBot.Push.SetTitle(String.Join(' ', args.Skip(1))); }
That will make one string out of your arguments, separated by a space (' ').
The `args.Skip(1)` will return a new array without the "!name" argument because it shouldn't be in the title.
Last edited by xXExpress0Xx (Jul 30 2013 6:31:21 am)
Thanks to gustav9797, who ported the physics engine to C#, I will be working on implementing precise characteristics, like X, Y, speed, etc.
If you're not convinced that's an important feature, try to think of some of the possibilities:
? change your trail color (by placing blocks and then replacing them)
? actually move your bot fluently; have it complete challenges or give players a hint
? estimate how far they have traveled (up to 9 decimal places)
? reliably know where players are, and act accordingly
? tell when they hit a key, collect a coin, etc.
? open and close a door as they move (something you can't really do)
and much more. Not pivotal, but definitely a big improvement. It will take a week or so to work out, since physics are very complicated (and I have other obligations aside from flash games).
Also, you can expect more support for minimap colors in the somewhat near future.
Yeah, well, you know that's just like, uh, your opinion, man.
Offline
Takoman, i would like this sooo much, but sadly it comes to late. Its so sad seeing this game die. And its so sad too to see you put so much effort in it. If this would came out like 1 year before oh my god, imaging what these people could have done..
Offline
i'm imprting phsycsi to skylight! yahy!!!1
YEEEES. I'm going to do magic with this, I can't wait!
Offline
You would need to use String.Join in order to get the full name.
if (args[0] == "!name") { MyBot.Push.SetTitle(String.Join(' ', args.Skip(1))); }
That will make one string out of your arguments, separated by a space (' ').
The `args.Skip(1)` will return a new array without the "!name" argument because it shouldn't be in the title.
Thanks a lot
I tried and fiddled and got it to work to some extent.
Now what I am left with is:
MyBot.Push.SetTitle(String.Join(line args.Skip(1))); MyBot.Push.Say("New world title - " + String.Join(line, args.Skip(1)) + ".");
When I do this, it still includes !name somewhere along the line in the title, even if I change the integer in args.Skip().
BTW:
string line = c.Message.ToLower(); string[] args = line.Split(' ');
just to clarify.
Getting there. Any more help?
Last edited by Happychubbybubby (Jul 31 2013 1:45:26 am)
@Happychubbybubby:
I would do it this way:
string line = c.Message.ToLower(); string[] args = line.Split(' '); string newName = ""; for(int i = 1; i < args.Length; i++){ newName += args[i] + ' '; } MyBot.Push.SetTitle(newName);
Done
I tried and fiddled and got it to work to some extent.
Now what I am left with is:MyBot.Push.SetTitle(String.Join(line args.Skip(1))); MyBot.Push.Say("New world title - " + String.Join(line, args.Skip(1)) + ".");
When I do this, it still includes !name somewhere along the line in the title, even if I change the integer in args.Skip().
The problem might be because you are passing `line` as the first argument to `String.Join`. Instead, you should pass a character like ' ' (space). That will be the character between each argument.
Here is an example:
string[] fruits = { "Apple", "Orange", "Banana" }; Console.WriteLine(String.Join(" ", fruits)); //This should output: Apple Orange Banana Console.WriteLine(String.Join(", ", fruits)); //While this will output: Apple, Orange, Banana
Here is some more information about `String.Join`.
Last edited by xXExpress0Xx (Jul 31 2013 5:58:54 am)
Sounds like something I might experiment with later.
@Happychubbybubby:
I would do it this way:string line = c.Message.ToLower(); string[] args = line.Split(' '); string newName = ""; for(int i = 1; i < args.Length; i++){ newName += args[i] + ' '; } MyBot.Push.SetTitle(newName);
Done
Thanks so much. Works almost perfectly now. +1.
Happychubbybubby wrote:I tried and fiddled and got it to work to some extent.
Now what I am left with is:MyBot.Push.SetTitle(String.Join(line args.Skip(1))); MyBot.Push.Say("New world title - " + String.Join(line, args.Skip(1)) + ".");
When I do this, it still includes !name somewhere along the line in the title, even if I change the integer in args.Skip().
The problem might be because you are passing `line` as the first argument to `String.Join`. Instead, you should pass a character like ' ' (space). That will be the character between each argument.
Here is an example:
string[] fruits = { "Apple", "Orange", "Banana" }; Console.WriteLine(String.Join(" ", fruits)); //This should output: Apple Orange Banana Console.WriteLine(String.Join(", ", fruits)); //While this will output: Apple, Orange, Banana
Yes, I understand. I know what you're trying to do, and I understand the logic . I Appreciate the help, but it just didn't work in my bot. Thanks anyway for the effort
All done and working. Thanks guys!
Although I respect my fellow programmers, I highly suggest you do it a different way. It would be much easier to do it like this:
//... string chatMessage = m.GetString(1); //... if (chatMessage.StartsWith("!name ") { MyBot.Push.Title(chatMessage.Substring(6)); } //...
It may be a bit flawed, but it should work as a great, easy alternative.
Last edited by BuzzerBee (Aug 1 2013 3:22:16 am)
Offline
Tako is thy God.
Tako, thanks for putting in all this work for us (and continue working) I would hug you, but the next best thing a rep is all I can give.
Hi.
Not needing help, but reporting a glitch.
I have a certain amount of commands that respond to chat in game.
For example:
if (args[0] == "!help") { MyBot.Push.Say(c.Speaker.Name + ": " + "Help: !help !version !creator //etc."); } if (args[0] == "!version") { MyBot.Push.Say(c.Speaker.Name + ": " + "This is version 1.0.0 Beta."); } if (args[0] == "!creator") { MyBot.Push.Say(c.Speaker.Name + ": " + "The creator of this bot is HappyChubbyBubby."); }
Out of all these commands, only !version works.
I have checked my spelling.
I have checked the code.
Why does this happen? C# doesn't report an error, but the MyBot.Push.Say() doesn't come up in the level!
TakoMan02 (or anyone else, for that matter), if you could help, that would be great.
I hope I haven't made another stupid error. I hate that...
[EDIT]
Only just read the last couple of posts.
Although I respect my fellow programmers, I highly suggest you do it a different way. It would be much easier to do it like this:
//... string chatMessage = m.GetString(1); //... if (chatMessage.StartsWith("!name ") { MyBot.Push.Title(chatMessage.Substring(6)); } //...
It may be a bit flawed, but it should work as a great, easy alternative.
Thanks for the suggestion.
I haven't tried it yet, but does it recognise capital and lowercase letters? I am currently trying Krock's suggestion, and it works but doesn't recognise capital letters.
If it does, I will give it a try.
Last edited by Happychubbybubby (Aug 2 2013 3:56:15 am)
Actually, I have the same problem as HCB, whenever I make a new command, I get no errors and it looks fine, but it doesn't work when I'm debugging. Actually I made a two new commands, !removeblock and !help, but only !removeblock works, !help doesn't.
I had this problem before, and Tako said it was fine when I PMed him, but it didn't work for me. However I rewrote the code in a new C# project exactly the same and then it worked. This will hopefully work again, but for now I want to add more commands before I rewrite it.
thx for sig bobithan
Offline
BuzzerBee wrote:Although I respect my fellow programmers, I highly suggest you do it a different way. It would be much easier to do it like this:
//... string chatMessage = m.GetString(1); //... if (chatMessage.StartsWith("!name ") { MyBot.Push.Title(chatMessage.Substring(6)); } //...
It may be a bit flawed, but it should work as a great, easy alternative.
Thanks for the suggestion.
I haven't tried it yet, but does it recognise capital and lowercase letters? I am currently trying Krock's suggestion, and it works but doesn't recognise capital letters.
If it does, I will give it a try.
Here, I can make it work a little better for your bot:
//... if (args[0].ToLower().StartsWith("!name ") { MyBot.Push.Title(args[0].Substring(6)); } //...
Updated so that it works with any case, and uses your "args[0]" string.
Last edited by BuzzerBee (Aug 2 2013 9:22:11 am)
Offline
Would be better if skylight had it's own forum. This thread is getting huge soon. And have the tutorials how to use skylight on that forum.
Scrolling through this thread just to understand how to use skylight takes forever.
Last edited by doh (Aug 2 2013 9:58:36 am)
Offline
Sounds like a good idea. I have my pages set to 50 posts so I didn't realize it was getting lengthy.
http://skylight.lefora.com
I'll spam topics later. Not much to see now. Make an account if you feel so inclined.
Yeah, well, you know that's just like, uh, your opinion, man.
Offline
TakoMan02: Did you read my earlier post?
Why do some commands work, while others don't? Is it something to do with the SDK, my coding, or a plain C# glitch?
Please help.
[ Started around 1732234217.5027 - Generated in 0.426 seconds, 12 queries executed - Memory usage: 1.78 MiB (Peak: 2.05 MiB) ]