Mirage Source http://www.miragesource.net/forums/ |
|
Guess-The-Phrase System http://www.miragesource.net/forums/viewtopic.php?f=183&t=5295 |
Page 1 of 81 |
Author: | KruSuPhy [ Sat Mar 21, 2009 4:11 pm ] |
Post subject: | Guess-The-Phrase System |
Credits to Giaken for Helping me make the packet and most of the complicated stuff Credit to Me for doing the easy stuff that I didn't need help with xD Kay. First Tutorial. Sorry If I miss something ;D BEFORE ANYTHING: Go to \Data\ (Server Folder)and Add an INI File called phraselist.ini. This is how you're going to change the phrase easily without having to go into the server coding. In the INI File, Put: Code: [PHRASE] Phrase=thisisthephrase --------------- Okay, Make a new form called frmGuessPhrase. This is going to be where the player puts and sends the Word/Phrase. Add a textbox(txtPhrase) and a Command button(cmdEnterPhrase) Next, Go to modInput. Find; Code: ' Whos Online Case "/who" SendWhosOnline (Or any of the other Player Commands, That is) Add This Under it: Code: ' Show Phrase Form Case "/phrase" frmGuessPhrase.Show This Is going to make the frmGuessPhrase appear when the user types '/phrase' into chat Next, We're going to make the Packet in the Client. In ModEnumerations, Find; Code: Public Enum ClientPackets At the very bottom of that list, Add; Code: CPhrase Now, To send the packet to the Server, Go back to frmGuessPhrase, Double click your Command button, And add; Code: Call SendData(CPhrase & SEP_CHAR & txtPhrase.Text & END_CHAR) txtPhrase.Text = vbNullString The Call SendData code will send the phrase to the server to be checked. SERVER-SIDE Go to ModEnumerations, Find: Code: Public Enum ClientPackets Again, at the bottom, Add: Code: CPhrase Go to ModHandleData, And find the list of Case (Whatever). At the bottom of it, Right before the Case Else, Add; Code: Case CPhrase Call HandlePhrase(Index, Parse) At the very bottom of the module, Add: Code: Private Sub HandlePhrase(ByVal Index As Long, ByRef Parse() As String) Dim phrase As String phrase = GetVar(App.Path & "\Data\phraselist.ini", "PHRASE", "Phrase") If Parse(1) = phrase Then Call PlayerMsg(Index, "You got it right!", Green) Call GiveItem(Index, 1, 500) Else: Call PlayerMsg(Index, "You got it wrong!", Red) End If End Sub What it does: Dims phrase as a string. I put the path of the INI File in. You don't have to do this, You can just put If Parse(1) = GetVar(App.Path &....). I did it this way because it seems easier in my head. The If Parse(1) = Phrase Then Checks to see if the Phrase the player entered matches the phrase in your INI File. If they get it right, It will send them a Green PlayerMsg Saying they got it right, And Assuming gold is your Item 1, IT will send 500 Gold to them. The Else is If they put the wrong phrase in, IT will Send them a Red PlayerMsg Telling them they got it wrong. ------------- I think thats it. If It goes wrong, PM me what happened and I'll fix the tutorial. Again, Credits to Giaken for helping me make the packet and get it to send back and forth between server and client. |
Author: | William [ Sat Mar 21, 2009 4:14 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Ey, this is a awesome idea. Skip the item award. And create a new stat or skill or whatever and call it knowledge. Now you need to guess phrases right in order to gain knowledge points. This knowledge points allows you to go on with quests and getting in to secret areas and such. |
Author: | KruSuPhy [ Sat Mar 21, 2009 4:40 pm ] |
Post subject: | Re: Guess-The-Phrase System |
o; Shweet Idea. I might totally look into that xD Not only would that be awesome, It'd be even awesomer If I did it. xD Total Ego boost ;P |
Author: | William [ Sat Mar 21, 2009 4:54 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Eventually if you stick around long enough you will learn to do way more than just this |
Author: | KruSuPhy [ Sat Mar 21, 2009 6:57 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Yea That's the idea. I've got my handy dandy MSN and Giaken Added, And I'm sure If i beg enough He'll help me when i need it xD |
Author: | Robin [ Sat Mar 21, 2009 8:04 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Harold can't even sanatize his own packets. Don't listen to him. |
Author: | GIAKEN [ Sat Mar 21, 2009 9:59 pm ] |
Post subject: | Re: Guess-The-Phrase System |
With Bomberman I was lazy a while ago...it's been a couple of months since most of it has been made. |
Author: | KruSuPhy [ Sun Mar 22, 2009 12:02 am ] |
Post subject: | Re: Guess-The-Phrase System |
Robin wrote: Harold can't even sanatize his own packets. Don't listen to him. Well I don't see your MSN addy anywhere around here, So I guess I'll just deal with him. |
Author: | Mattyw [ Sun Mar 22, 2009 12:09 am ] |
Post subject: | Re: Guess-The-Phrase System |
KruSuPhy wrote: Robin wrote: Harold can't even sanatize his own packets. Don't listen to him. Well I don't see your MSN addy anywhere around here, So I guess I'll just deal with him. Psst. robinperris@hotmail.com. |
Author: | KruSuPhy [ Sun Mar 22, 2009 12:16 am ] |
Post subject: | Re: Guess-The-Phrase System |
Hurry up and edit your post before you get your testies ripped off! |
Author: | Robin [ Sun Mar 22, 2009 12:57 am ] |
Post subject: | Re: Guess-The-Phrase System |
Mattyw wrote: KruSuPhy wrote: Robin wrote: Harold can't even sanatize his own packets. Don't listen to him. Well I don't see your MSN addy anywhere around here, So I guess I'll just deal with him. Psst. robinperris@hotmail.com. Ha-HA! Changed my MSN, bitch. |
Author: | Mattyw [ Sun Mar 22, 2009 1:27 am ] |
Post subject: | Re: Guess-The-Phrase System |
DAMN. I should've suspected this when I saw: Quote: Robin is leaving.
Leave me a message for details. |
Author: | KruSuPhy [ Sun Mar 22, 2009 1:38 am ] |
Post subject: | Re: Guess-The-Phrase System |
xD Back to Giaken. |
Author: | Joost [ Sun Mar 29, 2009 2:21 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Spammng a certain phrase with my g15 keyboard to get 500 gold a second, not a bad idea . |
Author: | KruSuPhy [ Sun Mar 29, 2009 5:48 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Phrase Limit ftw. Too bad I haven't put it in the tutorial yet. |
Author: | Noobz [ Thu Apr 02, 2009 12:50 pm ] |
Post subject: | Re: Guess-The-Phrase System |
this is awesome! i might use it in my game for guessing a quiz. |
Author: | Robin [ Thu Apr 02, 2009 12:54 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Should take away 500 gold if they get it wrong. |
Author: | Jacob [ Thu Apr 02, 2009 12:57 pm ] |
Post subject: | Re: Guess-The-Phrase System |
You should also have a huge list of strings that it can randomly pick one from. When the current one gets guessed, it picks a new random one. |
Author: | KruSuPhy [ Fri Apr 03, 2009 8:39 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Robin wrote: Should take away 500 gold if they get it wrong. I haven't added anything else to the tutorial(i.e wrong answers and limit) But in my source I have it where they lose 1000. Max Limit is 1 for every week(Which is when it should be changed, Weekly.) @Dugor: I was going to have a Hint system. Picking a random phrase out of the blue isn't exactly what I'd call fair at all. But hell, None of us are fair I don't suppose. I just have a Hint thing. |
Author: | wanai [ Sun Jan 02, 2022 5:45 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Econ |
Author: | wanai [ Sun Jan 02, 2022 5:46 pm ] |
Post subject: | Re: Guess-The-Phrase System |
79.8 |
Author: | wanai [ Sun Jan 02, 2022 5:47 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Bett |
Author: | wanai [ Sun Jan 02, 2022 5:48 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Bett |
Author: | wanai [ Sun Jan 02, 2022 5:49 pm ] |
Post subject: | Re: Guess-The-Phrase System |
Dani |
Page 1 of 81 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |