dMZX Forums: Strings question - dMZX Forums

Jump to content

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

Strings question

#1 User is offline   weasel 

  • bleh
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 7,915
  • Joined: 23-December 00
  • Gender:Male
  • Location:Hillsboro, Oregon

Posted 20 April 2002 - 02:28 AM

Is there any way to check if an inputted string is NOT a number? I'm working on a custom setup menu for Hidden Intentions and are adding the ability to change the speed with a textbox.
Blaugh!
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
0

#2 User is offline   Galladin 

  • Threadkiller
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,266
  • Joined: 08-January 02
  • Gender:Male
  • Location:Finland

Posted 20 April 2002 - 05:15 AM

you should use the Mzx2.62b!
Interactive (F) Fantasies

<Beige> In Finland, they defecate on each other's sleeping areas.
<Beige> It's a cultural sign of respect.
0

#3 User is offline   Jester 

  • Senior Comrade
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,692
  • Joined: 08-January 02
  • Gender:Male
  • Location:Finland

Posted 20 April 2002 - 06:39 AM

No! he Shouldn't..
Shred like the Devil.
0

#4 User is offline   weasel 

  • bleh
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 7,915
  • Joined: 23-December 00
  • Gender:Male
  • Location:Hillsboro, Oregon

Posted 20 April 2002 - 09:24 PM

I NEED MZX 2.62b for my adventure games engine to work! If EMS is that much of a problem for you people then turn off the sounds. Now back on topic, I still need a solution for this robotic problem.
Blaugh!
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
0

#5 User is offline   Galladin 

  • Threadkiller
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,266
  • Joined: 08-January 02
  • Gender:Male
  • Location:Finland

Posted 21 April 2002 - 06:04 AM

:blahblah
input string "blahblah"
if input <= 9 speed&input&
goto blahblah

:speed1
set speed to 1 or whatever
and so on....

or something like that  I'm probably wrong but it's how I would have done it.
Interactive (F) Fantasies

<Beige> In Finland, they defecate on each other's sleeping areas.
<Beige> It's a cultural sign of respect.
0

#6 User is offline   FlashBlast 

  • Strawberry Milk
  • PipPipPip
  • Group: Members
  • Posts: 167
  • Joined: 14-July 01

Posted 21 April 2002 - 07:37 AM

: "invalid"
input string "Please Pick your game speed"
goto "speed&input&"
goto "invalid"

: "speed1"
: "speed2"
: "speed3"
: "speed4"
: "speed5"
: "speed6"
: "speed7"
: "speed8"
: "speed9"
set "mzx_speed" "input"
. "the rest of your code here"


only the numbers 1 - 9 will work here... and its quicker and more memory concerving then marcus's one... i had made this for my game, then scraped it for an automatic version. just make sure you dont use the lables Speed10 to Speed32768

-Flash

(And Exo thinks I know nothing!)
0

#7 User is offline   Galladin 

  • Threadkiller
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,266
  • Joined: 08-January 02
  • Gender:Male
  • Location:Finland

Posted 21 April 2002 - 10:59 AM

heh ? yeah ? ? I actually used the same tactic in my Character Creation-engine yesterday. like dis:

set Str to random 3 thru 18
set Dex to random 3 thru 18
set Con to random 3 thru 18
if Con = 3 go1
dec Con 1
:go1
set Int to random 3 thru 18
if Int = 3 go2
dec Int 1
:go2
set Wis to random 3 thru 18
inc Wis 1
set Cha to random 3 thru 18
inc Cha 1
goto Str&Str&

:Str3
set StrMod to -4
goto StrMain

and something like that ? it took me about 1-3 hours to make it since there's 6 abilities and they're set to random 3 thru 18 (+1/-1) ?mawhawhwahhwahawhahha ?hahahaha ahahhaa    but I didn't use strings and I'm way off topic once again so I guess I'll just end it up here.
Interactive (F) Fantasies

<Beige> In Finland, they defecate on each other's sleeping areas.
<Beige> It's a cultural sign of respect.
0

#8 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 21 April 2002 - 04:49 PM

Hrrrm... you guys don't get a lot of things. First of all, you can't use input directly as a string. The ONLY place you can use input is in a direct equality statement (like, if "input" = "blahlala" "agh") and you cannot use inequality comparisons on strings. This is because Greg's strcmp replacement sucks *cough*.. that means you can NOT do if "$string0" > 1 or anything like that. If you do it'll always return false.

As it is you can't store in counter the numerical contents of a string, however, one idea is to do this:

set "Local" 1
: "L"
set "&Local&" "Local"
inc "Local" 1
if "Local" != 10 "L"
input string "Enter the speed"
set "$string0" "input"
set "MZX_speed" "$string0"

Or you could use something like FlashBlast's method.. mine uses a bit of counters but is universally applicable, will give you zero if the number is invalid.. you could also turn off the counters when you're done if that helps.

- Exo
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

#9 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 21 April 2002 - 04:52 PM

Using strings (and input string) for this kinda thing is rather silly anyway. If you can, why don't you have an overlay based slider? Then you can easily calculate the value as an offset, not a string...

- Exo
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

#10 User is offline   weasel 

  • bleh
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 7,915
  • Joined: 23-December 00
  • Gender:Male
  • Location:Hillsboro, Oregon

Posted 21 April 2002 - 09:46 PM

Hmm. I would, if I could create a seperate board for options (which i cant, because of the "TURN OFF THE MUSIC DARNIT" option, which disables music on the current board without killing SAMs too).
Blaugh!
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
0

#11 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 21 April 2002 - 10:09 PM

WildWeasel, on April 22 2002,03:46, said:

Hmm. I would, if I could create a seperate board for options (which i cant, because of the "TURN OFF THE MUSIC DARNIT" option, which disables music on the current board without killing SAMs too).

Can't you just set a counter for that?

- Exo
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

#12 User is offline   Galladin 

  • Threadkiller
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,266
  • Joined: 08-January 02
  • Gender:Male
  • Location:Finland

Posted 22 April 2002 - 05:10 AM

heh      I don't use the Mzx2.62b anymore.....   hehheh   ???
Interactive (F) Fantasies

<Beige> In Finland, they defecate on each other's sleeping areas.
<Beige> It's a cultural sign of respect.
0

#13 User is offline   weasel 

  • bleh
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 7,915
  • Joined: 23-December 00
  • Gender:Male
  • Location:Hillsboro, Oregon

Posted 23 April 2002 - 02:43 AM

Exophase, on April 21 2002,15:09, said:

WildWeasel, on April 22 2002,03:46, said:

Hmm. I would, if I could create a seperate board for options (which i cant, because of the "TURN OFF THE MUSIC DARNIT" option, which disables music on the current board without killing SAMs too).

Can't you just set a counter for that?

- Exo

Hmm, I guess you're right...working on that right now!
Blaugh!
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
0

#14 User is offline   Bocco 

  • Some guy
  • PipPipPipPip
  • Group: Members
  • Posts: 514
  • Joined: 09-February 01
  • Gender:Male

Posted 24 April 2002 - 02:37 AM

You don't even need a counter if you use "Mod *" on both the options screen and the screen you're coming from. Then, disabling the music on the options screen will result in no music when you return. Of course, a counter's not too hard to do either. Just a thought.
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