Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

String variable values?

11 years ago

Okay, I have absolutely no knowledge of scripting or even working with the advanced editor. However, I'm doing a test for a game which I am writing with the advanced editor and I have a question. Is it possible to make variables with a string value? E.g. in stead of displaying LOCK1 is 0 the game would display LOCK1 is Locked, or something like that.
 

String variable values?

11 years ago

%%LOCK1%=%0%The first door is locked%%

You can find more about this on berka's guide: http://chooseyourstory.com/help/articles/article.aspx?ArticleId=3850

String variable values?

11 years ago

You can get around it in the way that galobtter mentions but as is, variables cannot explicitly contain strings.

String variable values?

11 years ago

IF %LOCK = 0 THEN 

BEGIN

$PAGETEXT := "LOCK1 is Locked" + "</BR> + "</BR> + "$PAGETEXT

END

 

There you go. Enjoy! :D

Oh yeah, make sure to put it on the page script of the page you want it on, not the link script. 

 

String variable values?

11 years ago

Thank you! It worked, but I decided not to implement the string values just yet as it looks very messy and unprofessional in my game because of the double spacing but thingy.

String variable values?

11 years ago

If you do Shift+Enter you can do normal spacing in your game.

It looks cluttered while you're writing it though.

String variable values?

11 years ago

Alex is planning to fix this though, so I wonder if using shift enter will make you have to go back through everything and replace with normal enters once he does.