OMG... Zero

Blitz3D Forums/Blitz3D Beginners Area/OMG... Zero

SuperSonic7(Posted 2007) [#1]
Ok, i was working on the beginning of this game, and when i tested it, I had this part that had you type your name in, and then it would say "Welcome, (name)", but when I tried it, the question "whats your name" didnt appear! I typed in my name (Jon) anyway and then it said "Welcome, 0"
Whats the solution to my dilema? My code is under here...

Graphics 800,600,16

AppTitle "Jonathan F's VG Trivia 1.0"

Font = LoadFont("Arial, 18, True, False, False")
SetFont Font

ssi1 = LoadImage("JonCoLogo.bmp")
ssi2 = LoadImage("Splashscreen.bmp")
clearscreen = LoadImage("Black.bmp")

DrawImage(ssi1, 0,0)
Delay (3000)
DrawImage(ssi2, 0,0)
Delay (3000)
DrawImage(clearscreen, 0,0)

name = Input$("What's your name?")
Color 70,70,70
Text 300,200, ("Welcome, ") + name
Color 70,70,70
Delay (3000)


big10p(Posted 2007) [#2]
Use name$ instead of just name.


SuperSonic7(Posted 2007) [#3]
Thanks, it solved the welcome 0 prob, but I still need help on the Question.


GfK(Posted 2007) [#4]
Doesn't answer your question, but is there any reason you're using a black BMP image to clear the screen instead of using Cls?


SuperSonic7(Posted 2007) [#5]
good point (i accedentaly named it wrong. its white).


SuperSonic7(Posted 2007) [#6]
Gfk, you'd be surprised, but that does solve my problem. it made the background black.
(i guess you cant change the color of input text)


(tu) sinu(Posted 2007) [#7]
check color and clscolor, you'd be suprised :-)


Yo! Wazzup?(Posted 2007) [#8]
Do this to clear the screen white:
;Changes the color that the screen clears to to white. (r:255 g:255 b:255)
Clscolor 255,255,255
;clear the screen
Cls
Delay 5000
End



To give input text color do:
;everything after this will be red
Color 255,0,0
blah=Input(“Blah Blah Blah”)
Color 255,255,255
;Sets the color back to white



To make the input text and user input different colors do this:
 Color 255,0,0
Write "Hi! "
Color 255,255,255
Input("")
Delay 5000
End





And the reason it returned 0 is because a variable by default is an integer. You use a $ to show that you want it to be a string (any amount of letters or spaces). A # means a floating-point and a %(default) means an integer. A letter counts as zero, so "blah blah blah" would mean 0.