Game Development Community

Torque scripting question

by David Dougher · in Torque Game Engine · 06/13/2003 (11:38 am) · 6 replies

I am curious about the ability of the scripting system to parse through strings of data. I haven't found anything that says if this is possible and if so, how to do it. And the regular tutorials I've seen so far don't cover anything like this.

Anybody have a pointer to a useful tutorial?

About the author

Owner - Pariah Games, Adjunct Professor - Bristol Community College, Mentor - Game Design - Met School Newport, Mentor - Game Design - Met School Providence


#1
06/13/2003 (12:01 pm)
not having the source handy,
im pretty sure what your looking for is getWord(..)
#2
06/13/2003 (12:13 pm)
The following string functions are available:

strcmp     - Compare Strings
stricmp    - Case insensitive Compare
strlen     - length of string
strstr     - Returns the start position of a substring in a string
strpos     - returns position of string within a string, can search from offset
ltrim      - left trim
rtrim      - right trim
trim       - trim
stripChars - remove characters from a string
strlwr     - converts string to lowercase
strupr     - converst string to uppercase
strchr     -
strreplace - replace text within a string
getSubStr  - get n chars from string starting from x
getWord    - Get the n word from the string
getWords   - get n - z words from the string
setWord    - replace word n with new word
removeWord - remove word n from string
getwordcount - number of words in the string
getfirstword - first word in the string
restwords    - everything but the first word in the string
#3
06/13/2003 (12:30 pm)
Thank you. Thank you. Thank you!

Is there any write up on the syntax for these functions anywhere?
#4
06/13/2003 (1:00 pm)
If you open then console and type the command ie: getWord(); it will return some info on the command.
#5
06/13/2003 (1:06 pm)
Excellent. You would think with all the time I have spent with this system I would know a lot more about it than I do... Still discovering things every time I turn around.
#6
12/15/2004 (7:40 pm)
Strchr - compares 2 strings