dMZX Forums: Only 12 letters for Input string - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Only 12 letters for Input string For Ranking tables in SaintZZT 7th

#1 User is offline   RinGames06 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 21
  • Joined: 24-March 06
  • Gender:Male
  • Location:Mexico

Posted 05 March 2015 - 08:54 PM

Hi, i am currently working in version 1.3 of SaintZZT and I found this bug in the ending. How I can restrict to only input 12 letters?
I tried stuff but not working well.


Posted Image
Posted Image
- RinGames -
0

#2 User is offline   ThDPro 

  • Brontosaurus-Sea-slug; Gooey and phallic
  • PipPipPipPip
  • Group: Members
  • Posts: 718
  • Joined: 03-December 06
  • Gender:Male
  • Location:Portland, OR

Posted 05 March 2015 - 09:03 PM

...
set "$player_name" "input"
set "$player_name" "$player_name#12"

This post has been edited by ThDPro: 05 March 2015 - 09:03 PM

original soundtracks
Better Than Nothing - DOMINATION - Commander Keen: Heroes Lost - Welkin - A Confectioner's Recipe - random ThDPro music stuff
<Risu21121> if you're not going to make a good game, you might as well make a blatantly racist one.
<Kuddy> Testicles.
"Where are my folder?" - KKairos
0

#3 User is offline   RinGames06 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 21
  • Joined: 24-March 06
  • Gender:Male
  • Location:Mexico

Posted 05 March 2015 - 09:17 PM

Thanks so much!!!
- RinGames -
0

#4 User is offline   Old-Sckool 

  • megazeux breaker
  • PipPipPipPip
  • Group: Members
  • Posts: 649
  • Joined: 07-June 05
  • Gender:Male

Posted 06 March 2015 - 08:12 AM

you can also prompt the user to re-input their name if it's too long, rather than truncating

set "$player_name" "input"
if "$player_name.length" >= 12 "ask_again"

This post has been edited by Old-Sckool: 06 March 2015 - 08:13 AM

<Nadir> mzxers don't make GAMES, usually
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D

<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity
0

#5 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 06 March 2015 - 09:31 AM

I used to use "inputsize" counter:

: "Name"
input string "Type your First Name"
: "typeit"
if "inputsize" > 10 then "clipit"
set "$string1" to "input"
write overlay c0f "&$string1&" at 1 1
end
: "clipit"
input string "Type your First Name (10 letters max)"
goto "typit"

This post has been edited by T-Bone: 06 March 2015 - 09:58 PM

Youtube - teabone3 - Twitter - teabone3 - Twitch - teabone3
0

#6 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 06 March 2015 - 03:52 PM

if you're going to be looping around an input string it's always a good idea to put a wait 1 or a wait 2 before the box shows up again for contingency purposes
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#7 User is offline   RinGames06 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 21
  • Joined: 24-March 06
  • Gender:Male
  • Location:Mexico

Posted 06 March 2015 - 05:28 PM

Oh, yes, thanks for the tip (Y)
- RinGames -
0

#8 User is offline   Old-Sckool 

  • megazeux breaker
  • PipPipPipPip
  • Group: Members
  • Posts: 649
  • Joined: 07-June 05
  • Gender:Male

Posted 06 March 2015 - 05:30 PM

T-Bone: It doesn't make much sense for the input box to become more informative after an error occurs. Would make much more sense to just write it as this (including lach's suggestion)

: "Name"
wait for 1
input string "Type your First Name (10 letters max)"
if "inputsize" > 10 then "Name"
set "$string1" to "input"
write overlay c0f "&$string1&" at 1 1
end


I also didn't realize that inputsize was a thing, but makes sense considering that the input counters came before full string functionality. I wouldn't use it myself though, since it's just easier to copy it to a string and manipulate it as such.
<Nadir> mzxers don't make GAMES, usually
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D

<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users