Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 Hello. I'm currently making a script, which I will probably release when it's complete, and I've been looking around to see if SadScript had a command that makes an input box appear, but I haven't found one. What I'm looking for is a command that makes a box pop up, similar to a MsgBox, except with a space for the player to enter information. If there's one, can someone please tell me the syntax? If not, is it possible to create one? Also, if you were to type text in the input box, what would the variable for the text be? Thanks. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 14, 2009 Share Posted July 14, 2009 You'd be looking for the Query Box; here is a tutorial on it (as well as prompts):http://www.touchofdeathforums.com/smf/index.php/topic,15084.0.html Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 Thanks a lot! Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 I didn't think it would be worth it to make another topic, so I'll ask my simple question here. How would I go about making a String a certain number of characters long? Here's an example:```If Value > 3 Then```Something like that doesn't seem to work. The variable, **Value**, is a String. Link to comment Share on other sites More sharing options...
emblem Posted July 14, 2009 Share Posted July 14, 2009 ```Dim ValueValue = "rofl!"If Len(Value) > 3 Then Call PlayerMsg(Index, "Value is a string bigger than three characters!", BRIGHTGREEN)End If```For the length of a string. Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 Thanks! Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 I just have one more simple question. Is there a way to add a title to a QueryBox, similar to a MsgBox? Here's an example of a MsgBox syntax:```MsgBox "(message)", 0, "(title)"```I know that a QueryBox takes this form:```Call PlayerQueryBox(Index, Message, Script)```So, is it possible to stick in a title? Whenever the QueryBox comes up, it shows the VB6 form symbol and then "QueryBox," which doesn't look very good, in my opinion. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
emblem Posted July 14, 2009 Share Posted July 14, 2009 I don't think so, but you can edit the source and change the title to your game name or something.Which version are you using, EE2.7 or EE2.8? Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 I'm using Eclipse Evolution 2.7. Link to comment Share on other sites More sharing options...
emblem Posted July 14, 2009 Share Posted July 14, 2009 Hmm, want me to change the title in the source for you? xD Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 I can probably figure it out, but if I can't, I'll post here again. Thanks for the help!Sorry about this, but one final small concern. Say the variable, **Value**, was typed into a QueryBox.This isn't working for me:```Case 1 Select Case ValueCase "hi"Call PlayerMsg(Index, "That is invalid!", WHITE) Case Else Call PutVar("Events.ini", "Data", "Events", Value) End Select End Select```This is just an example.My concern is with the **Call PutVar("Events.ini", "Data", "Events", Value)** part. That part is supposed to replace the current value of the **Events** variable with the value of the **Value** variable. For some reason, it's not working. Link to comment Share on other sites More sharing options...
emblem Posted July 14, 2009 Share Posted July 14, 2009 Hmm. I don't see why that wouldn't work. Unless your not allowed to have a select case within a select case.Or, it might be a type mismatch.Try putting Trim() around value.```Call PutVar("Events.ini", "Data", "Events", Trim(Value))```And changing the second select case to an If Then … Else Statement. Link to comment Share on other sites More sharing options...
Bobosk Posted July 14, 2009 Share Posted July 14, 2009 You can have Select Cases within other cases..i think the general problem is that you're only puvaring "value"..try this:```Call PutVar("Events.ini", "Data", "Events", Value & "")``` Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 Thanks for the help guys! <>'s method worked, but I didn't do the whole thing. I simply changed it to:```Call PutVar("Events.ini", "Data", "Events", Trim(Value))```I didn't change the cases or anything else.When I restart the client, however, the value for the **Events** variable reverts back to how it was before.As for the QueryBox title, I've removed a certain section of the "querybox" packet in **modHandleData** that displays the VB6 form model, but it didn't seem to remove it. Do you think I can get some help with that, please? Link to comment Share on other sites More sharing options...
Bobosk Posted July 14, 2009 Share Posted July 14, 2009 yeah, for some reason, EE have issues only using a dimmed/defined object as a variable… so putting & "" or something like trim() usually works.. Link to comment Share on other sites More sharing options...
Kimimaru Posted July 14, 2009 Author Share Posted July 14, 2009 Okay, and do you think you can help me with the issue I previously posted? When I restart the client, the value for the Events variable reverts back to how it was before. It doesn't change permanently, for some reason. Link to comment Share on other sites More sharing options...
Bobosk Posted July 14, 2009 Share Posted July 14, 2009 Not without seeing some of your other subs, like onserload and such.. Link to comment Share on other sites More sharing options...
Kimimaru Posted July 15, 2009 Author Share Posted July 15, 2009 Oh, okay. Sorry about that. I didn't change them at all. Here they are:```' Executes when the server initially loads.Sub OnServerLoad() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub``````' Executes when the scripts are reloaded.Sub OnScriptReload() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub```I don't know what else you need to see. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now