how to add an item to a list box from a text box?

Started by Icey, Fri 14/01/2011 03:46:42

Previous topic - Next topic

Icey

Has any one on AGS played around with the TCP plugin besides Dualnames? If so do you think you can give me a list of were every thing goes? or if it's was in one of your games could you show me a copy of the scripts so I can see were everything is?


Construed

Check out virtual cold beer game.
But im going to tell you ahead of time, TCP/IP plugin is very limited.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Icey

I will try again. I had it in another one of my games but could never finish it so mog.net took over.

Icey

PluginHandler.asc(33): Error (line 33): Type mismatch: cannot convert 'String*' to 'string'

Code: ags


TcpSetString (ServerIndex, Broadcast, SpeechChannel, 0, msg);

Construed

maby comment that line out.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Calin Leafshade

That's the solution to all your coding problems.

Just keep commenting shit out.

Icey

Right...

Any-who, I took the line out and got it working. But can someone tell me how to add an item to a list box from a  text box?

Construed

#7
Your problem is probley that you didnt change the ID number in the script for the text box.
Quote
That's the solution to all your coding problems.

Just keep commenting shit out.

LOL, eventually you would have no code than it would be a perfect world.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Ryan Timothy B

Quote from: Studio3 on Fri 14/01/2011 15:40:53
PluginHandler.asc(33): Error (line 33): Type mismatch: cannot convert 'String*' to 'string'

Code: ags


TcpSetString (ServerIndex, Broadcast, SpeechChannel, 0, msg);


It pretty much told you what the problem was. You're using String instead of string, on if I were to guess, the string variable: msg.
AGS is super case sensitive.

Wyz

Actually the problem is that the plugin uses old style AGS strings. Since the newer version of AGS use a different kind of string type these old style string will not work.
That's btw why I had to write a new plugin for the IRC client project I was working on.
Life is like an adventure without the pixel hunts.

monkey0506

Unless I'm mistaken, can't you use StrCopy with new-style Strings?

Code: ags
string oldmsg;
StrCopy(oldmsg, msg);


IIRC, there would be an issue if the plugin uses string-literals  with old-style string functions..of course I could be entirely wrong.

Icey

@monkey_05_06
  Those dont work any more in ags 3.2

Also I remember before I gave mog.net my game to take over I remembered dualnames fixed the TCP plugin for me a it still had string & not String in it.

Also I have fixed the TCP plugin by my self(I think). I got the game to run with out an errors but I dont know if I am connected or not.

monkey0506

The old-style string functions do still work in AGS 3.2, you just have to set "Enforce new-style Strings" to False..which means you would have to manually change the setting from its default value. So don't just go around saying things no longer work in newer versions of AGS without knowing what you're talking about, please.

Also, saying that you fixed the plugin by removing some AGS-side scripting which you have absolutely no idea what it does sounds a bit..well, ignorant really. You shouldn't edit a script without knowing what you're doing, or at least being intelligent enough to figure out the actual results thereof, and not just, "it compiles now so it must be fixed." Hence Calin's sarcasm a few replies up.

I don't know for sure what the exact interoperability of new- and old-style strings is, but when I can get my hands on a copy of AGS, I, unlike you, would know how to actually test and verify my results before simply saying that it does or doesn't work. I don't always test my code..many a time I've fallen prey to that trap; but the point is that through help offered me here, and through a lot of trial and error, I have learned how to test things if and when the need arises. I would suggest, or recommend, especially given the tremendously large goal you have in mind for your very first game project, that you also learn to do this for yourself.

I'm not trying to berate you, as I myself had absurd expectations when I first started using AGS. I can be as arrogant and hard-headed and belligerent as the next guy, but over time I have learned to accept that I don't always know everything, take on a bit of constructive criticism every once in a while, and generally accept when someone is trying to help me. Not always, but I try to keep these things in mind.

I think you'll be alright with AGS, but take a bit of friendly advice from an experienced monkey..calm down.

If you don't know how to test the functions of the TCP/IP plugin, try looking at the source files for the demo. The demo, as-is, will not compile in newer versions of AGS, but you should still be able to view the source files in order to try and make some sense of them. If you need further help you would be a lot more likely to get useful assistance if you could ask specific questions instead of just posting that you don't know how to tell whether the plugin is functioning as expected.

Wyz

Quote from: monkey_05_06 on Sun 16/01/2011 00:25:17
The old-style string functions do still work in AGS 3.2, you just have to set "Enforce new-style Strings" to False..which means you would have to manually change the setting from its default value. So don't just go around saying things no longer work in newer versions of AGS without knowing what you're talking about, please.

I did knew about that actually but I had reasons not to mention it ;)
Life is like an adventure without the pixel hunts.

Khris

Quote from: Studio3 on Fri 14/01/2011 20:21:16
Right...

Any-who, I took the line out and got it working. But can someone tell me how to add an item to a list box from a  text box?
Code: ags
  Listbox.AddItem(Textbox.Text);
:o

Icey

@monkey_05_06
Ok I understand were your coming from. I must say though that this is not the first time I played around with the tcp plugin. I tried it in a lot of unfinished game on my old PC. Now  every time I played with it I could never get my game to start because it was error after error. But I fully agree with you.

@Khris
Thanks, I will try it out.

SMF spam blocked by CleanTalk