Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Question involving using Strings to work

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Tue Jun 26, 2007 5:31 pm    Post subject: Question involving using Strings to work Reply with quote

After looking through near every article on strings on the wiki and on the past three pages of this forum, I have yet to get them to work.

Even with the simplest example given from the wiki:

Code:

$1 = "Hello "
$2 = "Bob"

$1 += 2

show string (1) #this will show the string "Hello Bob"


When compiled, will give me a:
Errors and Warnings wrote:

Unrecognized name $1="hello". It has not been defined as script, constant, variable, or anything else.

So I'd just like to know, what am I missing that's preventing me from using strings?

Alternatively, I've had to use a series of [Append Ascii]; however, this becomes troublesome when every string is a single letter (as I have no alternative way to merge strings together).

Help please :_;
Back to top
View user's profile Send private message Send e-mail AIM Address
Ysoft_Entertainment
VB Programmer




Joined: 23 Sep 2003
Posts: 810
Location: Wherever There is a good game.

PostPosted: Tue Jun 26, 2007 6:29 pm    Post subject: Reply with quote

Make sure you got the latest plotscr.hsd and the latest hspeak

Hopefully this helps.
_________________
Try my OHR exporter/importer.
OHRGFX
Striving to become better pixel artist then Fenrir Lunaris. Unfortunately the laziness gets in the way of my goals.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Wed Jun 27, 2007 5:14 am    Post subject: Reply with quote

Whoops.
I guess I should be mentioning that I'm using the latest nightly everythings.
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Jun 27, 2007 6:39 am    Post subject: Reply with quote

TwinHamster wrote:
Whoops.
I guess I should be mentioning that I'm using the latest nightly everythings.


Code:
Unrecognized name $1="hello". It has not been defined as script, constant, variable, or anything else.


The error message means that you are not using the latest hspeak. You have to download it separately from the nightlies of game and custom. http://hamsterrepublic.com/ohrrpgce/nightly/hspeak-win-nightly.zip

If you run hspeak with no command-line option, you should see this help screen:

Code:

HamsterSpeak semicompiler v3Gc (C)2002 James Paige&Hamster Republic Productions
Please read LICENSE.txt for GPL License details and disclaimer of liability
HSPEAK.EXW [-cdfksawyz] source.hss [dest.hs]

   -c colors will be disabled
   -d dump debug report to hs_debug.txt
   -f fast mode. disables some optimization
   -k do not wait for a keypress when finished
   -s print the name of each script as it is compiled
     -a same as -s, but including autonumbered scripts
   -w suppress minor warnings
   -y overwrite the destination file without asking
   -z write error messages to hs_error.htm

For more info about Hamsterspeak visit http://HamsterRepublic.com/ohrrpgce

This is a command-line program. You should either run it from the command-line
(DOS prompt) or you should drag and drop your script file onto it.


If your version is "v3Gc" and you are still seeing the error message, let us know.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Wed Jun 27, 2007 10:38 am    Post subject: Reply with quote

My version of hspeak is v3Gc. Neutral

What's odd is that I can't seem to get this one script to work either my home laptop or my work computer.
Back to top
View user's profile Send private message Send e-mail AIM Address
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Wed Jun 27, 2007 11:26 am    Post subject: Reply with quote

And you have the latest HSD?

Can you post the entire script?
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Wed Jun 27, 2007 12:01 pm    Post subject: Reply with quote

Moogle1 wrote:
And you have the latest HSD?

Can you post the entire script?


Latest .HSD (6/1/07), check.

And...That was the entire script.

Code:

script, unfunctional, begin
$1 = "Hello "
$2 = "Bob"

$1 += 2

show string (1) #this will show the string "Hello Bob"
end
Back to top
View user's profile Send private message Send e-mail AIM Address
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Wed Jun 27, 2007 1:20 pm    Post subject: Reply with quote

Hey, I can reproduce this. Here's my entire file:

Code:
include, plotscr.hsd

script, unfunctional, begin
$1 = "Hello "
$2 = "Bob"

$1 += 2

show string (1) #this will show the string "Hello Bob"
end


It does the same thing with or without a define script. This smells like a bug in HSPEAK.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Wed Jun 27, 2007 1:51 pm    Post subject: Reply with quote

Yay! I'm not alone.

So...could anyone show me a script with strings that actually work?
Back to top
View user's profile Send private message Send e-mail AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Jun 27, 2007 2:00 pm    Post subject: Reply with quote

Oh, wow. The example on the wiki was all wrong. I just fixed it.

Code:
$1 = "foo"


is wrong, and should be replaced by:

Code:
$1="foo"


Which is silly because hamsterspeak is absurdly lenient about spaces everywhere else, so it shouldn't be strict about them in just one place. I filed bug 401 about this.

Second,

Code:
$1 += 2


is wrong, and should be:

Code:
1 $+ 2
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Wed Jun 27, 2007 2:05 pm    Post subject: Reply with quote

I just tried this out, and I seem to be okay now.

Thanks for the help, guys.
Razz
Back to top
View user's profile Send private message Send e-mail AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Jun 28, 2007 12:00 am    Post subject: Reply with quote

No spaces between +", =", $+, $=, or any other operator like := or -- allowed. I guess we could allow whitespace between +, = and ", since they're not operators so much as magic tokens. People might start complaining about $ a += "b" next.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Thu Jun 28, 2007 8:21 am    Post subject: Reply with quote

The Mad Cacti wrote:
No spaces between +", =", $+, $=, or any other operator like := or -- allowed. I guess we could allow whitespace between +, = and ", since they're not operators so much as magic tokens. People might start complaining about $ a += "b" next.


Right, =" is a magic tokens, not an operator. It is not implemented in the same way as other operators, is it?.

Code:
$1="foo"


They aren't likely to realize that =" is an operator. Instead they are more likely to think that = is the operator, and that the "quotes" are just marking the string.

You and I know that there is no operator here at all, just some magic syntax that vaguely resembles operators.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Jun 30, 2007 9:53 pm    Post subject: Reply with quote

Hmm, I was quite wrong. Spaces are allowed inside operators. Anyway, it's changed now.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group