Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Icey on Fri 14/01/2011 03:46:42

Title: how to add an item to a list box from a text box?
Post by: Icey on Fri 14/01/2011 03:46:42
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?

Title: Re: TCP plugin
Post by: Construed on Fri 14/01/2011 11:35:18
Check out virtual cold beer game.
But im going to tell you ahead of time, TCP/IP plugin is very limited.
Title: Re: TCP plugin
Post by: Icey on Fri 14/01/2011 13:22:32
I will try again. I had it in another one of my games but could never finish it so mog.net took over.
Title: Re: TCP plugin
Post by: Icey on Fri 14/01/2011 15:40:53
PluginHandler.asc(33): Error (line 33): Type mismatch: cannot convert 'String*' to 'string'



TcpSetString (ServerIndex, Broadcast, SpeechChannel, 0, msg);
Title: Re: TCP plugin
Post by: Construed on Fri 14/01/2011 19:54:44
maby comment that line out.
Title: Re: TCP plugin
Post by: Calin Leafshade on Fri 14/01/2011 19:57:00
That's the solution to all your coding problems.

Just keep commenting shit out.
Title: Re: TCP plugin
Post by: Icey 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?
Title: Re: how to add an item to a list box from a text box?
Post by: Construed on Sat 15/01/2011 06:56:45
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.
Title: Re: TCP plugin
Post by: Ryan Timothy B on Sat 15/01/2011 13:28:16
Quote from: Studio3 on Fri 14/01/2011 15:40:53
PluginHandler.asc(33): Error (line 33): Type mismatch: cannot convert 'String*' to 'string'



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.
Title: Re: how to add an item to a list box from a text box?
Post by: Wyz on Sat 15/01/2011 13:44:00
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.
Title: Re: how to add an item to a list box from a text box?
Post by: monkey0506 on Sat 15/01/2011 20:24:07
Unless I'm mistaken, can't you use StrCopy with new-style Strings?

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.
Title: Re: how to add an item to a list box from a text box?
Post by: Icey on Sat 15/01/2011 22:11:24
@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.
Title: Re: how to add an item to a list box from a text box?
Post by: monkey0506 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.

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.
Title: Re: how to add an item to a list box from a text box?
Post by: Wyz on Sun 16/01/2011 00:31:27
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 ;)
Title: Re: TCP plugin
Post by: Khris on Sun 16/01/2011 05:06:37
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?
  Listbox.AddItem(Textbox.Text); :o
Title: Re: how to add an item to a list box from a text box?
Post by: Icey on Sun 16/01/2011 05:37:18
@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.