Scrolling Game Development Kit Forum

SGDK Version 1 => Script => Topic started by: Zorb Burger on 2006-03-09, 09:45:20 AM

Title: I gots a query...
Post by: Zorb Burger on 2006-03-09, 09:45:20 AM
i rember seein' somfin calld 'notepad+' on dis place...  i cant fin it.  I was wonering if yall can help me find it.  i am trin teh scritp!  tanks fer ya help.
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-09, 10:44:16 AM
NM yall i found it... but i be havin trouble wit getin ma code teh work!  i sav ma file as vbs, then i tri runin it and i gots dis error mess. sayin line:1, char: 17.  wat dat suppose teh mean!?  i need a rela programmer teh help me out!!
Title: Re: I gots a query...
Post by: durnurd on 2006-03-09, 03:35:57 PM
It means that there is an error in your code on the first line, the 17th character in from the left.
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-09, 03:58:02 PM
ever thin abou teh code is right!!  here is teh code.  it be small, but im jus startin out...

Code: [Select]
Dim strFirstName As String
Dim strLastName As String

  strFirstName  = "Zorb"
  strLastName = "Burger"
  MsgBox strLastName & ", " & strFirstName

wat am i doin rong!  i folloewd teh directions an everythin.  it like notepad++ anit readin it or somethin...
Title: Re: I gots a query...
Post by: durnurd on 2006-03-09, 04:04:43 PM
VBScript as a language doesn't have datatypes.  Everything is a variant.  This mean that you don't use "As String" to define what type of variables you're using.

Code: [Select]
Dim strFirstName
Dim strLastName

  strFirstName  = "Zorb"
  strLastName = "Burger"
  MsgBox strLastName & ", " & strFirstName
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-09, 04:05:48 PM
i be tryin dat, tanks fer teh help!

EDIT:  DAYUUMM!!!  U duh man Durnurd!!  it be workin!!!
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-09, 04:57:09 PM
Alrigh yall, nother porb...  i am trin to get it wer ya type somfin into a input box den it display yer thing.  like ya input time an it show up the time o day.
Her be the code.:

Code: [Select]
Dim strRad
Dim strPrompt
 
 strPrompt = "Enter Time or Date: "
 strRad = InputBox(strPrompt)
 if strRad = Time, MsgBox "The time is: " & Time
  end
 if strRad = Date, MsgBox "The Date is: " & Date
  end

not sur wat i be doin rong... ???
Title: Re: I gots a query...
Post by: cbass on 2006-03-09, 06:39:56 PM
I don't think SGDK allows you to use an input box.  To allow input is kind of complicated to script, Bluemonk has an example in the NET demo:

https://sourceforge.net/project/showfiles.php?group_id=70424&package_id=113801
Title: Re: I gots a query...
Post by: hebedaymun on 2006-03-09, 06:41:46 PM
maybe he's talking about general VBScript coding?  Like something not related to SGDK?  I don't know... his first question really didn't fit into the 'SGDK' scripting environment... I could be wrong though.
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-09, 06:54:11 PM
tanks fer teh repli!  but dis anit fer SGDK... i am jus practicing ma skills until i be ready to tackle SGDK...
Title: Re: I gots a query...
Post by: durnurd on 2006-03-09, 07:36:27 PM
What tutorials are you using?  The code syntax is just all wrong with that last piece of code, so you must be using some other kind of Basic.

Here's the correct VBScript code:

Code: [Select]
Dim strRad
Dim strPrompt
 
 strPrompt = "Enter Time or Date: "
 strRad = InputBox(strPrompt)
 if strRad = "Time" then MsgBox "The time is: " & Time
 if strRad = "Date" then MsgBox "The Date is: " & Date
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-09, 07:55:44 PM
durn it  Durnurd, you be a codin power house!!! :D :D  tanks fer teh hlp!!

the tutorial is somfin calld "L-basic".  I only got teh trial version dough...  cna't afford to get som real codin tutorials... 
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-09, 09:07:57 PM
alrigh... i am makin somefin dat solves simple math stuff, lik addin, subtract, etc., but i cant get these darn radicals teh work.  durnurd, or any guy else, think ya can help me again? :)  hers' teh cod, and i tink it be ma finest yet ;D

Code: [Select]
Dim intResult

  intResult = (2 + 2)         'addition
  MsgBox "2 + 2 = " & intResult
  intResult = (3 * 4)         'multiplication
  MsgBox "3 * 4 = " & intResult
  intResult = (4 - 2)         'subtraction
  MsgBox "4 - 2 = " & intResult
  intResult = (6 / 3)         'division
  MsgBox "6 / 3 = " & intResult
  intResult = (2 ^ 3)         'exponents
  MsgBox "2 ^ 3 = " & intResult
  intResult = (Log(4)) 'logarithms
  MsgBox "log(4) = " & intResult
  intResult = ((1/3)-(1/4))/((1/8)+(1/2)) 'complex fraction
  MsgBox "((1/3)-(1/4))/((1/8)+(1/2)) = " & intResult
  intResult = (root(36)) 'SquareRoot
  MsgBox " Radical 36 = " & intResult

hepl be greatly appreciated!! :)
Title: Re: I gots a query...
Post by: bluemonkmn on 2006-03-09, 10:25:37 PM
The square root function in VBScript (and VB) is called SQR rather than ROOT.
Title: Re: I gots a query...
Post by: bluemonkmn on 2006-03-09, 10:38:14 PM
BTW, have you tried looking at Microsoft's VBScript reference?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/cfd87c86-9217-4783-9eba-4fee0261ca06.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/cfd87c86-9217-4783-9eba-4fee0261ca06.asp)
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-10, 08:47:58 AM
DAYUUMM!!  U an ur bro a couple o' coding gods!  wer yall get all teh info on codin!!  yall prolly went teh college... ;D

tank fer teh help, and teh reference!!
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-10, 01:36:08 PM
okay... i am wonderin if yall can mak lik a sample script of lik som e graphx mad wit VBS...  i wanted to lern ow teh doo dat stuff wit an explam.  i be noin dat bulemonk and DUh-Duh-durnurd!! can do it, but if some one else can doo i t i be greatly happy!! ;D
Title: Re: I gots a query...
Post by: bluemonkmn on 2006-03-11, 07:02:09 AM
I don't think it's possible to to graphics in pure VBScript.  You'd need to use a component that does graphics in combination with VBScript.  Of course GameDev is such a component, but maybe that's more complex than you want.  But if your goal is to learn VBScript so that you can use it with GameDev, then maybe it's time to start some simple scripting in GameDev?
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-11, 12:17:10 PM
dat sounds lik a good durn idear!!  if ya could, can ya help me wit a simple script teh learn from?  or sould i be downloadin som gams wit scripts teh get an idea? ???

not ser, how bout you bluemonk?
Title: Re: I gots a query...
Post by: bluemonkmn on 2006-03-12, 07:04:46 AM
My first suggestion would be to look at the top post in this scripting forum where it has information about debugging script.  See if you can figure out (with the help of that post) how to make a script that shows some debug messages on the screen while you're playing the game.
Title: Re: I gots a query...
Post by: Zorb Burger on 2006-03-12, 07:59:04 AM
ok man!  i be chekin dat out now!!  tanks fer teh suggesten :)