Incredibly basic string question

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
TheMan
Red Slime
Posts: 31
Joined: Wed Jul 05, 2017 8:42 pm

Incredibly basic string question

Post by TheMan »

So I'm a string noob, and whenever I try to define a string in my scripts, I always get an error. It seems like I should be doing everything right. Eg,

Code: Select all

plotscript, script name, begin
  $1 =“String goes here�
end
comes up with

Code: Select all

$ may only be used as part of a $...="..." or $...+"..." construct
I feel that I'm missing something really obvious here, but I've tried formatting it in many different ways. Any help would be appreciated
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

That space between the 1 and the = is suspicious. That's the only thing I can imagine being wrong with it.
My pronouns are they/them
Ps. I love my wife
User avatar
TheMan
Red Slime
Posts: 31
Joined: Wed Jul 05, 2017 8:42 pm

Post by TheMan »

Stuff like

Code: Select all

  $1=“String goes here�,   $1 = “String goes here�
And other combinations of spaces don't seem to work either.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Strange... I have the same syntax in the load game script for ROK, and it works just fine. Can you post the context for the rest of your script? There may be something interfering.
Attachments
Screen Shot 2018-10-20 at 12.04.06 PM.png
Screen Shot 2018-10-20 at 12.04.06 PM.png (15.78 KiB) Viewed 1175 times
My pronouns are they/them
Ps. I love my wife
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

It's the smart quotes you're using. Retype the quotes in Notepad then try again. They should be the normal "straight" version of quotes (like what comes up when you type a message here on Slime Salad). Plotscript doesn't recognize unusually formatted marks like smart quotes, smart ellipses, M-dashes, etc. It wants everything in its purest, nonformatted form.
Last edited by Pepsi Ranger on Sat Oct 20, 2018 7:36 pm, edited 1 time in total.
Place Obligatory Signature Here
User avatar
TheMan
Red Slime
Posts: 31
Joined: Wed Jul 05, 2017 8:42 pm

Post by TheMan »

Pepsi Ranger wrote:It's the smart quotes you're using. Retype the quotes in Notepad then try again. They should be the normal "straight" version of quotes (like what comes up when you type a message here on Slime Salad). Plotscript doesn't recognize unusually formatted marks like smart quotes, smart ellipses, M-dashes, etc. It wants everything in its purest, nonformatted form.
Yep, this was it. Thanks for the help
Post Reply