Stats affectng Text

Anonynn
HK was helping me with this before but I can't seem to make it work. Pain in the butt!

Okay, so in the beginning of my game there is a character creation... below is one of the examples of what happens when the player picks the elven race

{if player.race="elven": pointed}

But I was wondering if there was a way to take it a step further and have character stats affecting how conversations go, or if certain character stats could affect in-game descriptions and conversations. HK suggested this...

({if player.race = "elven": Blah blah different text.)

But for some reason, that isn't working and in the "room" descriptions for example and conversation texts all that happens is this ......... ( ) ....and when I remove the parenthesis nothing shows up at all. Can anyone help?

Pertex
Two points:don't use spaces in the expression and don't use " even if it is a string

({if player.race=elven: Blah blah different text.)

Anonynn
I'll give that a shot then! Thanks!

Oh, am I supposed to close the box with a }) ? Or just the parenthesis?

[quote]({if player.race=elven: Blah blah different text.)[/quote]


^ I tried this as well as well as...

({if player.race=elven: Blah blah different text.}) <--- putting the second bracket in. But all that comes up is () still.

Hm.

TM123
For me, it prints:
{if player.race=elven: Blah blah different text.}

You can run scripts for descriptions - on room and object descriptions choose "run script" instead of text.
and put in a script like this:
if (player.race = "elven") {
msg ("The trees are really magical here.")
}
else {
msg ("The trees are boring.")
}

HegemonKhan
@neonayon:

Are you trying to do this stuff through the GUI~Editor's options~drop down menus~etc, or in code ???

-------------

you *ALWAYS MUST HAVE* have matching equal numbers of parenthesis~brackets~curly_brackets~double_quotes on the left and the right when you use them correctly for what~when needs them, as they are used to encase~encapulate something inside~between them when writing directly in code. For example: if you got 5 left parenthesis, you must have 5 right parenthesis too.

Confusion occurs when using the GUI~Editor, as depending on what you're using within the GUI~Editor... determines whether you need to include the double quotes (as the quest engine ~ GUI~Editor does it for you, hiddenly, depending on what you used in the GUI~Editor, for example, the: [message] vs [expression] options).

-----------

if you're doing this through the GUI~Editor, an example:

*** make sure you choose 'run as script' if it's available, as TM123 beat me to it already, laughs ***

'npc1' Object -> 'talk' Verb -> (see below)

run as script -> add new script -> scripts -> 'if' Script -> (see below)

// you can *NOT* use the text processor commands when using the 'if [expression]' Script

if [expression] = player.race="elven"
-> msg ("Ah, so you are an elf, how fairs the forests?")
// etc 'else ifs' and~or an 'else'

-------

GUI~Editor:

to use the text processor commands, they're actually ONLY FOR USE with the 'msg' Script, which means you got to choose 'run as script' if it's available, and then for your 'msg' Script you HAVE to choose [expression] too.

so like this:

run as script -> add new script -> output -> 'print a message' Script -> (see below)

// your text and text processor commands MUST be within double quotes

print [expression] "{if player.race="elven":your_text} {if player.race="dwarf":your_text} {if player.race="neko":your_text}"

-------

in code:

// using the text processor commands:

// if it doesn't work or you get problems, then remove the double quotes from 'elven'
// each~every~all of the entire text processor commands, MUST be within the curly brackets

// lastly, you need to actually use the 'msg' script, so you can't just do: {player.race="elven":your_text}

// for the 'msg' Script, your text and text processor commands must with within (where the xxx is) this: msg ("xxx")

msg ("{if player.race="elven":your_text} {if player.race="dwarf":your_text} {if player.race="neko":your_text}")

HegemonKhan
@TM123:

for your reference, here's the text processor commands:

http://docs.textadventures.co.uk/quest/ ... essor.html

if you possibly are confused about them too, let me know, and I'll try to help you and neonayon.

neonayon likes using the text processor commands as they're not quite as confusing as the normal scripting (see below) is, neonayon still hasn't fully learned how to do the normal scripting and its syntax~format, yet.

normal scripting (of text+VARIABLES in msg script or an assignment script) :

if (Object_name.Attribute_name OPERATOR Value_or_Expression) {
// msg ("text" + Object_name.Attribute_name + "text")
// or
// Object_name.Attribute_name = Value_or_Expression
}


------

P.S.

in quest:

assignment: =
comparison: =

there's no '==' used
nor '!=' as well

I'm not sure if quest supports: '++' and etc usage...

quest engine is built to parse it, knowing what operation is needed.

and the 'not equals' is: <> // if you use this directly in code, then you need to encase your entire scripting within: <![CDATA[ entire scripting ]]>, to tell quest that your '<' and '>' are not the 'creation tags' ( '<object name="orc">content</object>' ), being math~string operators. Obviously using them as greater~lesser than~equals you need the 'CDATA' as well, again to tell quest that they ( '<' and '>' ) are indeed math operators.

or an alternative for not equals: if (not VARIABLE = Value_or_expression) { script }

--------

quest's OPERATORS:

Math OPERATORS:

addition: +
subtraction: -
multiplication: *
division: /
modulus (remainder): %
equals: =
not equals A: <>
not equals B: not xxx = xxx
greater than: >
lesser than: <
greater than and~or equal to: >=
lesser than and~or equal to: <=

String Operators:

assignment: =
comparison: =
contrastion A: <>
contrastion B: not xxx = xxx
concatenation: +

Bitwise Operators:

and: and
or~xor: or
not A: not xxx = xxx
not B: <>

Pertex
Neonayon wrote:
({if player.race=elven: Blah blah different text.}) <--- putting the second bracket in. But all that comes up is () still.


Perhaps your variable player.race is not set properly? Here is a demogame with the working textprocessorcommand:

<!--Saved by Quest 5.6.5621.18142-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="teste">
<gameid>52a7ffd5-32c9-496b-9628-f459e2c47e91</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<feature_asktell />
<start type="script">
player.race = "elven"
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<description>{if player.race=elven: Blah blah different text.}</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="man">
<inherit name="editor_object" />
</object>
</object>
</asl>

jaynabonne

msg ("{if player.race="elven":your_text} {if player.race="dwarf":your_text} {if player.race="neko":your_text}")


As Pertex said, this *doesn't* work. You have quotes inside your quotes. The text processor treats everything as strings anyway, so you would leave the quotes off "elven", etc.

Anonynn
Well, all the conversations of the game take place in a msg ...and these different race, or stat based responses are spread all throughout it. I'm still just getting

blah blah blah lots of text () ....argh.

I pretty much write everything in a script form. This is what I have exactly...

("{if player.race=elven: paying particular attention to the color of your glowing {player.eyecolor} eyes}")

which seems to be what you all are talking about me thinks.

@ Pertex

Perhaps your variable player.race is not set properly?



I'm pretty sure it's set properly. The Character Creator works great and so do a lot of the other little tidbits like, for example {player.eyecolor} eyes and so forth throughout the text. It only doesn't seem to be working when I try that stuff above. Of course, I'm just a newbie at this though so maybe I'm missing something.

-------------------------
Hk, by the way! Have you been working on your game? Also, Alex took care of the listing for my game. So the next update I do, I can upload to the Quest website too. Weee!

Hey Jayna, how've you been?

HegemonKhan
just make sure you don't have any typos+etc, and it should be working...

are you using 'elven' or 'elf' for your 'race' String Attribute? (just making sure, as if you're using 'elf', then if you use 'elven' it doesn't work, as 'elven' is not 'elf', or vice versa)

also... make sure all of your text processor commands are indeed using curly brackets and not normal brackets... (I just made such a typo in this post, laughs)

and sorry, you don't add in the double quotes for your Value inside of the text processing commands, as Pertex and Jay have been correcting me in their posts. My apologizes for the incorrect syntax I had in my previous posts.

msg ("blah {if player.race=elven:blah {if player.haircolor=black:blah}} blah {if player.race=dwarf:blah {if player.haircolor=white:blah}} blah")


------------

haven't been working on my game at all... haven't had much time to do any coding of my own, due to the reading (and sleeping+eating of course, lol)... in my breaks... I come on here and try to answer questions and~or I play a game and~or watch tv. That's my life right now... sighs.

jaynabonne
Neonayon, I've been all right. :) Been busy with more things than I time or brain cells for - but at least it's not dull. lol

Anonynn

just make sure you don't have any typos+etc, and it should be working...

are you using 'elven' or 'elf' for your 'race' String Attribute? (just making sure, as if you're using 'elf', then if you use 'elven' it doesn't work, as 'elven' is not 'elf', or vice versa)



I've been with you a lot on this particular aspect, so I'm pretty careful now. I double check all the spellings/identical spelling whenever I use the brackets. lol

("{if player.race=elven: paying particular attention to the color of your glowing {player.eyecolor} eyes}")

Yeah, that's what I have right there but for some reason it still isn't working. All it shows is () where that text is supposed to be.

It is a script, msg as well, and the Value matches up with the spelling and grammar.

Neonayon, I've been all right. :) Been busy with more things than I time or brain cells for - but at least it's not dull. lol



@Jayna Yeah, I feel that. This game is wracking my brain and I just finished with an intensive Summer course. It's a pain. Got an A though! Woo.

HegemonKhan
maybe try this...

I'm just spacing the stuff so it's easier for you to see it

msg ( " { if player.race = elven : " paying particular attention to the color of your glowing { player.eyecolor } eyes " } " )

nevermind... this is not correct syntax...

hmm... we may need to look at your entire game code (and~or the libraries you're using too), and~or have you made any changes to any of the built-in stuff (using the 'copy' button in the GUI~Editor) ??

the other possibility... the error~typo is somewhere else, such as in the X lines above and~or below your: msg ( " { if player.race = elven : paying particular attention to the color of your glowing { player.eyecolor } eyes } " ) line

can you post the *entire* block~section_chunk that your ' msg ( " { if player.race = elven : paying particular attention to the color of your glowing { player.eyecolor } eyes } " ) ' line is within for us?

if you don't know what I mean by 'block or section chunk'... let's just try this:

can you post the 20 lines above your ' msg ( " { if player.race = elven : paying particular attention to the color of your glowing { player.eyecolor } eyes } " ) ' line to the 20 lines below it, as a single continous~contiguios posting for us?

HegemonKhan
just thought of this too:

are you actually changing your 'player' Player Object's 'race' over~into the 'elven' Race during game play? (if you're still the 'human' race when this msg script occurs, then it fails the 'if' test, and thus no message is shown... if this ' msg ( " { if player.race = elven : paying particular attention to the color of your glowing { player.eyecolor } eyes } " ) ' is your entire message ...

-------

but if you got this msg (and you start out as the 'human' race):

msg ("{if player.race=elven:blah1} {if player.race=human:blah2}")

then it should output~display~message: blah2

--------

or, you can also directly test it, by changing in the game code, either having your 'player' Player Object start as the 'elven' race, or change your 'msg("{if player.race=elven}")' to whatever race you start as, like probably human: 'msg("{if player.race="human"}")', or you can change the message to like the one above.

Anonynn

if you don't know what I mean by 'block or section chunk'... let's just try this:

can you post the 20 lines above your ' msg ( " { if player.race = elven : paying particular attention to the color of your glowing { player.eyecolor } eyes } " ) ' line to the 20 lines below it, as a single continous~contiguios posting for us?



Welllllllllllllllllllll I was giving you the censored version! But I could certainly post the blocks of conversation if you like. Do you want me to post it here or in a PM? I mean, it's not TOO bad. It's just a remark to the characters er...chest size since the character the player is talking to is a bit of a pervert. It's not explicit though.

HegemonKhan
ya... that's a problem (I was hoping it wasn't the case, hoping the chunk of your code would be 'pg', lol)... you could pm~email it to me... except I'm really busy... I just realized I go back to school on the 17th (next week) not the 28... HK was~is an idiot, laughs. So, I'm even more time crunched...

maybe you could see if you can pm~email it to someone else... and if no error is found in this chunk (you could try a larger chunk, say 40 lines above and 40 lines below)... and ultimately, you may need to pm~email your entire game code, to troubleshoot the issue with why it's not working.

Anonynn
I should be fine...I don't think it's that bad. I'll go through the text and make sure all the non-pg stuff is removed. If any exists.

Here it is.

What!? You can hardly believe your eyes. You mean you're only alive because he <i>happened</i> to be resting his eyes --- and felt pity? Your pride took quite a blow from that one and you aren't sure how to respond at all, except with a gaped jaw. Should you be upset? Frustrated? Sad? There was a plethora of emotions surging through you at that moment, but the urge to thank him for his intervention was the last thing you wanted to do now. You certainly didn't want his pity...

"I don't know what to say..."

"<i>I asked you not to say anything. Or have you forgotten already</i>?" and then he grimaced with irritation and continued looking you over for a moment longer, "<i>Now you can speak. I'm sure you have many questions. But firstly, you want to know how I knew your name, and why I helped you?</i>" Now that you think about it, those were pretty immediate concerns when you first arrived at his door. He notices that look in your eyes too, and continues, "<i>The answer to the first is quite simple actually --- I'm far more intelligent than you are. I was easily able to read your mind, even from here. That includes a few past memories too.</i>" and then a sly grin appeared on his face, "<i>Your mind...to put it bluntly, is an open book, which makes the process of reading it even easier.</i>("{if player.intelligence=8:</i>Although, I have to admit, you are actually smarter than most {player.race} that I've come across. Most impressive.</i>}")"

You curl your {player.lips} lips and exasperatedly sigh. After that, your slender arms cross underneath your bust. As much as you hated to admit it, he <i>was</i> probably smarter than you but that didn't mean you tolerated his enjoyment as he rubbed it in your face. Rather than dwell on it further though (or have him piss you off anymore), you decide to change topics and find out about the second question, "Fair enough. I <i>am</i> rather open to new experiences, I guess. But..."

He interrupted, "<i>Why did I save you?</i>" Well, that was getting annoying fast.

"Mrs.Picksnap told me about what happened to you both, and that you kind of went out of your way to live in seclusion without interferring with the outside world...so I was curious...

"<i>Why I decided to bend that particular rule for you?</i>"


HegemonKhan
unfortunately, we actually do need the non-pg stuff, as the error~s could possibly with it...

I think you're probably going have to email the game file to someone (such as the moderators or maybe some user you can hopefully trust like me) or me (though I've no idea when 'd have the time to work on it, and I have a harder time finding the issues as well than the good coders)

------

something you can do is just make a new game and test it a 'msg + text processor command' Script... though if you do have these working throughout your game already, and just one of them isn't... then there's no reason to make a test game... you got some mistake error related to that part of the code (the error~s could be anywhere), which means you and~or someone else has to scour through your entire game code...

-------

ah, I see something that maybe you can try...

maybe you jsut got to take out the italize~bold~etc stuff: '<i></i>', '<b></b>'

as maybe you can't do that stuff with the text processor commands...

--------

try changing this:

("{if player.intelligence=8:</i>Although, I have to admit, you are actually smarter than most {player.race} that I've come across. Most impressive.</i>}")"


to this:

{if player.intelligence=8:<i>\"Although, I have to admit, you are actually smarter than most {player.race} that I've come across. Most impressive.\"</i>}


so it should look like this (in code):

msg ("<i>\"I asked you not to say anything. Or have you forgotten already?\"</i> and then he grimaced with irritation and continued looking you over for a moment longer, <i>\"Now you can speak. I'm sure you have many questions. But firstly, you want to know how I knew your name, and why I helped you?\"</i> Now that you think about it, those were pretty immediate concerns when you first arrived at his door. He notices that look in your eyes too, and continues, <i>\"The answer to the first is quite simple actually --- I'm far more intelligent than you are. I was easily able to read your mind, even from here. That includes a few past memories too.\"</i> and then a sly grin appeared on his face, <i>\"Your mind...to put it bluntly, is an open book, which makes the process of reading it even easier.\"</i> {if player.intelligence=8:<i>\"Although, I have to admit, you are actually smarter than most {player.race} races that I've come across. Most impressive.\"</i>}")


if I didn't mess up in the above, it should look (output) like this (pretending your intelligence is 8 and your race is human):

"I asked you not to say anything. Or have you forgotten already?" and then he grimaced with irritation and continued looking you over for a moment longer, "Now you can speak. I'm sure you have many questions. But firstly, you want to know how I knew your name, and why I helped you?" Now that you think about it, those were pretty immediate concerns when you first arrived at his door. He notices that look in your eyes too, and continues, "The answer to the first is quite simple actually --- I'm far more intelligent than you are. I was easily able to read your mind, even from here. That includes a few past memories too." and then a sly grin appeared on his face, "Your mind...to put it bluntly, is an open book, which makes the process of reading it even easier." "Although, I have to admit, you are actually smarter than most human races that I've come across. Most impressive."

--------------

to display double quotes to the person playing the game, within your textual parts, you do (type in) this:

\"

for example:

msg ("")
// outputs: (null~nothing; an empty line)

msg (" ")
// outputs: (empty space character~symbol: space bar keyboard key)

msg (" \" ")
// outputs: "

msg (" \" \" ")
// outputs: " "

msg ("hi")
// outputs: hi

msg (" \"hi\" ")
// outputs: "hi"

also...

<xxx> is the start~beginning
</xxx> is the finish~ending

so, you need to make sure you got this syntax:

<i>your_text</i>

since the 'your_text' is between the beginning '<i>' and the ending '</i>', it is italized

it's easy to mess up on the (cursing) forward slash... either wrongly putting it in the beginning tag or wrongly not putting it in the ending tag... (HK always has a huge problem, messes up with typing of it, with the forward slash... laughs):

this is often HK's wrong code (using horizontal structure examples):

</xxx>xxx<xxx>

or

<xxx>xxx<xxx>

or

</xxx>xxx</xxx>

correct code:

<xxx>xxx</xxx>

jaynabonne
Neo: for that block of text above, what actually gets printed out? Do some of the text processor commands work, or do they all fail? Is your player race "elven" or "Elven"? Where are you actually using that block of text?

If you could at least show what the above gives as a result, it would help, as you actually print the "player.race" value out straight.

Anonynn
No problem.

This is what it looks like "in game"

What!? You can hardly believe your eyes. You mean you're only alive because he happened to be resting his eyes --- and felt pity? Your pride took quite a blow from that one and you aren't sure how to respond at all, except with a gaped jaw. Should you be upset? Frustrated? Sad? There was a plethora of emotions surging through you at that moment, but the urge to thank him for his intervention was the last thing you wanted to do now. You certainly didn't want his pity...

"I don't know what to say..."

"I asked you not to say anything. Or have you forgotten already?" and then he grimaced with irritation and continued looking you over for a moment longer, "Now you can speak. I'm sure you have many questions. But firstly, you want to know how I knew your name, and why I helped you?" Now that you think about it, those were pretty immediate concerns when you first arrived at his door. He notices that look in your eyes too, and continues, "The answer to the first is quite simple actually --- I'm far more intelligent than you are. I was easily able to read your mind, even from here. That includes a few past memories too." and then a sly grin appeared on his face, "Your mind...to put it bluntly, is an open book, which makes the process of reading it even easier.()"

You curl your average lips and exasperatedly sigh. After that, your slender arms cross underneath your bust. As much as you hated to admit it, he was probably smarter than you but that didn't mean you tolerated his enjoyment as he rubbed it in your face. Rather than dwell on it further though (or have him piss you off anymore), you decide to change topics and find out about the second question, "Fair enough. I am rather open to new experiences, I guess. But..."

He interrupted, "Why did I save you?" Well, that was getting annoying fast.

"Mrs.Picksnap told me about what happened to you both, and that you kind of went out of your way to live in seclusion without interfering with the outside world...so I was curious...

"Why I decided to bend that particular rule for you?"



((the bold is where the stat description would or wouldn't be if it worked.))

This is what it looks like in the script.

What!? You can hardly believe your eyes. You mean you're only alive because he <i>happened</i> to be resting his eyes --- and felt pity? Your pride took quite a blow from that one and you aren't sure how to respond at all, except with a gaped jaw. Should you be upset? Frustrated? Sad? There was a plethora of emotions surging through you at that moment, but the urge to thank him for his intervention was the last thing you wanted to do now. You certainly didn't want his pity...

"I don't know what to say..."

"<i>I asked you not to say anything. Or have you forgotten already</i>?" and then he grimaced with irritation and continued looking you over for a moment longer, "<i>Now you can speak. I'm sure you have many questions. But firstly, you want to know how I knew your name, and why I helped you?</i>" Now that you think about it, those were pretty immediate concerns when you first arrived at his door. He notices that look in your eyes too, and continues, "<i>The answer to the first is quite simple actually --- I'm far more intelligent than you are. I was easily able to read your mind, even from here. That includes a few past memories too.</i>" and then a sly grin appeared on his face, "<i>Your mind...to put it bluntly, is an open book, which makes the process of reading it even easier.</i>("{if player.intelligence=8:</i>Although, I have to admit, you are actually smarter than most {player.race} that I've come across. Most impressive.</i>}")"

You curl your {player.lips} lips and exasperatedly sigh. After that, your slender arms cross underneath your bust. As much as you hated to admit it, he <i>was</i> probably smarter than you but that didn't mean you tolerated his enjoyment as he rubbed it in your face. Rather than dwell on it further though (or have him piss you off anymore), you decide to change topics and find out about the second question, "Fair enough. I <i>am</i> rather open to new experiences, I guess. But..."

He interrupted, "<i>Why did I save you?</i>" Well, that was getting annoying fast.

"Mrs.Picksnap told me about what happened to you both, and that you kind of went out of your way to live in seclusion without interferring with the outside world...so I was curious...

"<i>Why I decided to bend that particular rule for you?</i>"



Hope that helps!
----------------------------------------------------
@HK I'm not sure the italics matter because I have other places where I tried to use the stat thing that doesn't have qoutes and it has the same result. I'll re-read what you said and try some of the suggestions in the meantime.

----------------------------------------------------
@ Jayna

Neo: for that block of text above, what actually gets printed out? Do some of the text processor commands work, or do they all fail? Is your player race "elven" or "Elven"? Where are you actually using that block of text?



It's "elven" I haven't had any problems with like {player.eyecolor}, {player.haircolor}, {player.race} and so on. It's only when I've been trying to use the stats to add or take away conversations. The Integer portion works no problem... {if player.hairlength=0: making you bald} <--- this is for the player description.

jaynabonne
Could you do a simple test and add "{player.race}" somewhere into the block above, in an always-printed section, so we can see how it prints out?

This "pulling teeth" would be so much less necessary with the full source of the game... :) I'm sure it's just something simple, but it could be any of a handful of different simple things, some of which I don't even know to suggest.

jaynabonne
You do have a problem in your "intelligence=8" section. You have a closing </i> tag before "Although" instead of an opening <i> tag.

And I don't see the part checking player.race. Is intelligence actually 8 in this case?

Anonynn

Could you do a simple test and add "{player.race}" somewhere into the block above, in an always-printed section, so we can see how it prints out?



Well, those have been working throughout the game, I've already tested that a million times. It's when I try to change the dialogue based on certain attributes/stats that I'm running into problems --- but only when it's not an Integer value.

This "pulling teeth" would be so much less necessary with the full source of the game... :) I'm sure it's just something simple, but it could be any of a handful of different simple things, some of which I don't even know to suggest.



I could always email you the game so you can see for yourself just be aware that some of it is adultish.

You do have a problem in your "intelligence=8" section. You have a closing </i> tag before "Although" instead of an opening <i> tag.



Oh! Nice catch! I didn't even see that. Just goes to show multiple eyes are better than two!

And I don't see the part checking player.race. Is intelligence actually 8 in this case?



Yes, the intelligence was 8 in that demonstration.

jaynabonne
I had asked you to add "{player.race}" not to prove it worked but to see directly and verify the value. It was the best way I could think of (short of seeing the game) to directly see the value you were using in your 'if'.

Emailing would be great. If you click on my name, you should be able to email me from my profile page. (If not, let me know, and I'll PM you my email address.)

Anonynn
Oh, sorry about that. I attempted to email you three times....but the new Windows 10 email is a piece of junk. So I'll try directly through gmail this time. Hopefully, that will yield better results! Lemme know if you get them, please.

Forgot to add. The places you're looking for are located in "Rold's Laboratory"

jaynabonne
Ok, I have the files. Would you be able to give me a command sequence that leads to the problem, since there's quite a bit here?

The only place I see you comparing the race to elven, you have this (partial):

\"Not at all, he was an elf ({if player.race=\"elven\":Much like yourself...})

and it needs to be:

\"Not at all, he was an elf ({if player.race=elven:Much like yourself...})

Anonynn

Ok, I have the files. Would you be able to give me a command sequence that leads to the problem, since there's quite a bit here?



I have no idea what a command sequence is...BUT all of the stat changes (they are relatively new since the character creator was recently made) in the paragraphs are done in the first "Starting Topic Conversation" with Rold or "goblinesque_man" in the Laboratory.


\"Not at all, he was an elf ({if player.race=elven:Much like yourself...})



I'll give this a shot when I get back on Friday. Do I need the beginning \ in there too?

jaynabonne
By command sequence, I mean can you give me a list of commands to type, in order, to get me to the room where the problem is? If you can say "type this, then type this, then... and then when you get here, you'll see it's wrong", then I can reproduce those steps and see what you're seeing.

The leading slash is just what is used to quote the quote. It's actually part of a longer string. None of that needs to change. The part to focus on (and all you need to change) is to delete the quotes around "elven".

Anonynn
Oh, to get to the place, just zip through the creation
go south, then inside, northeast. Talk to woman, southwest, west, use key, north, down, down down, right, right, right, and then talk to man. That should get you to him.

Pick Teacher as a career, and a gnome as well.

jaynabonne
So when I do that, I see two "glitches".

"Huh?" his unnaturally glowing, light blue eyes looking you over for a moment in study (""),

because I wasn't endowed enough. The other is the part you indicated above, because my intelligence wasn't 8. (It's been 10, 9, 11, 9, etc. but I haven't randomly hit 8 yet.) Checking for equality with 8 is a bit odd, since you can have higher values. Did you perhaps mean ">=8" instead?

Regardless, if you have some text that can randomly not show up, then you need to be sure to include all the related stuff with it in the "if". For example, in the first case above, the parens and quotes should be inside the "if" as well, as they don't make sense if the text inside is empty. And do the same with the intelligence one, so you don't end up with empty ()'s.

Anonynn

The other is the part you indicated above, because my intelligence wasn't 8. (It's been 10, 9, 11, 9, etc. but I haven't randomly hit 8 yet.) Checking for equality with 8 is a bit odd, since you can have higher values. Did you perhaps mean ">=8" instead?



Yeah, that's what I meant to do is greater than 8. So I just put...

({if player.intelligence>=8: You are smurt!..}) ?


Regardless, if you have some text that can randomly not show up, then you need to be sure to include all the related stuff with it in the "if". For example, in the first case above, the parens and quotes should be inside the "if" as well, as they don't make sense if the text inside is empty. And do the same with the intelligence one, so you don't end up with empty ()'s.



I'm not sure what you mean here. You mean like this...?

({"if player.intelligence>=8: You are smurt!.."})

Also, I was curious --- is it possible to have multiple checks in those lines, like for example...

({"if player.race=elven;human;dwarf: You are multi-racial!.."})

jaynabonne
Well think about what it means to do this:

({"if player.intelligence>=8: You are smurt!.."})

The part inside the {} is going to disappear if the "if" is false, leaving you with this:

()

which I imagine you wouldn't want. So what you probably want to do instead is to place the parens *inside* with the text:

{"if player.intelligence>=8: (You are smurt!..)"}

so that when the "if" doesn't kick in, you're not left with odd punctuation pieces lying around. I just meant for you to consider what the text looks like both with the part in the "if" and without.

As far as the multiple checks, sadly no. The text processor is limited to quite simple sorts of expressions. You can't even use things like "and" or "or" (as far as I know).

Anonynn
Thanks, I'll check all that out then and move onto the next stuff! Thank you very much for all your help, Jay!

UPDATE

Nope. Didn't work unfortunately.

This is what it printed in game with "intelligence" being 9.
{"if player.intelligence>=8: (Although, I have to admit, you are a little bit smarter than most gnome that I've come across, which made the reading much harder than normal. Most impressive.)"}


here's the code I used for that...


{"if player.intelligence>=8: (<i>Although, I have to admit, you are a little bit smarter than most {player.race} that I've come across, which made the reading much harder than normal. Most impressive.</i>)"}



and the "endowed" text was the same. :/

HegemonKhan
I think you got to move your left double quote over to the text (after~to the right of the colon), and to display quotes you use: \", and lastly, I'm assuming you don't want the parenthesis to be displayed (and gnome needs to be plural ~ catching some grammer mistakes, lol), so that it should look like this:

msg (" {if player.intelligence>=8:\"Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.\"} ")

(if player.intelligence>=8), outputs:

"Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive."

***IMPORTANT***

if you're writing this in code... then you MUST have your scripting encased in the 'cdata' tag:

<![CDATA[ scripting ]]>

Jay can help you with getting the 'cdata' tag placement+syntax correct with the scripting block of yours

here's an example:

<function name="xxx"><![CDATA[
msg (" {if player.intelligence>=8:\"Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.\"} ")
]]></function>


---------

the parenthesis are NOT used with text processor commands, but if you weren't using text processor commands, then parenthesis is need for (example: if) expressions.

the 'msg' script:

msg ("") ~~~ blank~null message; an empty line
// output: null (blank; an empty line)

msg ("Hi, my name is HK.") ~~~ msg with text only
// outputs: Hi, my name is HK.

msg (player.alias) ~~~ msg with a VARIABLE only
// outputs (for example): HK

msg (player.strength) ~~~ msg with a VARIABLE only
// outputs (for example): 100

msg ("Hi, my name is " + player.alias + ".") ~~~ msg with text+VARIABLE
// outputs (for example): Hi, my name is HK.

msg (" \"Hi, my name is " + player.alias + ".\" ") ~~~ msg with text+VARIABLE
// outputs (for example): "Hi, my name is HK."

msg script with a text processor command used inside of it:

msg (" {if player.intelligence>=8:\"Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.\"} ")

not as a text processor command, using normal expression scripting, in this case, the 'if' Script:

if (player.intelligence>=) {
msg (" \"Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.\" ")
}
// outputs: "Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive."


-------------

neonayon wrote:Also, I was curious --- is it possible to have multiple checks in those lines, like for example...

({"if player.race=elven;human;dwarf: You are multi-racial!.."})


I don't know if it can be done, and if yes, then I don't know how it would be done, via the text processor

but it can be done without using the text processor command, using a normal (if script) expression:

if (player.race = "elven" and player.race = "dwarven" and player.race = "human") {
msg ("You're tri-racial (in this case, elf+dwarf+human).")
} else if (player.race = "elven" and player.race = "dwarven") {
msg ("You're bi-racial (in this case, elf+dwarf).")
} else if (player.race = "elven") {
msg ("You're an elf.")
} else if f (player.race = "dwarven") {
msg ("You're a dwarf.")
} else if f (player.race = "human") {
msg ("You're a human.")
}

Anonynn
I tried some variations but this is how HK's model showed up in-game.

(" "Although, I have to admit, you are a little bit smarter than most gnome that I've come across, which made the reading much harder than normal. Most impressive." ")

and here is how it look out of the game.

(" {if player.intelligence>=8: <i>"Although, I have to admit, you are a little bit smarter than most {player.race} that I've come across, which made the reading much harder than normal. Most impressive.</i>"} ")

jaynabonne
HK has shown you how it should look (good spot on his part to see that about the quotes, which I missed):

msg (" {if player.intelligence>=8:\"Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.\"} ")


I don't know what you mean above by "out of the game". If you mean when you're inputting it, then that's not right, on its own. You would only have quotes around the outside if you're explicitly putting it in a "msg" command in code view.

One thing is are you editing in code view or in the GUI? If you're in code view, it would look like the above. If you're in the GUI, then your string would just look like:

{if player.intelligence>=8:"Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive."}

jaynabonne
Actually, you once again have the problem with parens outside the "if", which are going to remain on their own when the "if" doesn't kick in. So if you're in the GUI, what you want is:

{if player.intelligence>=8:("Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.")}


so that they disappear when the inner text does.

Anonynn

{if player.intelligence>=8:("Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.")}



Unfortunately, this isn't working either. In game it looks like this now (when it applies)...

("Although, I have to admit, you are a little bit smarter than most gnomes that I've come across, which made the reading much harder than normal. Most impressive.")


and in the msg (GUI) it looks like...

{if player.intelligence>=8: (<i>"Although, I have to admit, you are a little bit smarter than most {player.race}s that I've come across, which made the reading much harder than normal. Most impressive.</i>")}

and the "endowment" parts aren't showing up at all. *sadface* But fear not! We will prevail!

jaynabonne
Well, then I'm lost. What do you want it to look like? :) That's the problem with these little snippets. Is it part of the a larger conversation such that you don't want the quotes? If so, then just get rid of the quotes. Otherwise, let me know what you want it to actually look like.

Anonynn

Well, then I'm lost. What do you want it to look like? :) That's the problem with these little snippets. Is it part of the a larger conversation such that you don't want the quotes? If so, then just get rid of the quotes. Otherwise, let me know what you want it to actually look like.



Well, I just want it to smooth into the conversation if it applies, and not be there at all if it doesn't apply. For example...

When it applies...

"I asked you not to say anything. Or have you forgotten already?" and then he grimaced with irritation and continued looking you over for a moment longer, "Now you can speak. I'm sure you have many questions. But firstly, you want to know how I knew your name, and why I helped you?" Now that you think about it, those were pretty immediate concerns when you first arrived at his door. He notices that look in your eyes too, and continues, "The answer to the first is quite simple actually --- I'm far more intelligent than you are. I was easily able to read your mind, even from here. That includes a few past memories too." and then a sly grin appeared on his face, "Your mind...to put it bluntly, is an open book, which makes the process of reading it easy. Although, I have to admit, you are a little bit smarter than most {player.race}s that I've come across, which made the reading much harder than normal. Most impressive."

And when not applying (like when the player doesn't have intelligence passed 7)

"I asked you not to say anything. Or have you forgotten already?" and then he grimaced with irritation and continued looking you over for a moment longer, "Now you can speak. I'm sure you have many questions. But firstly, you want to know how I knew your name, and why I helped you?" Now that you think about it, those were pretty immediate concerns when you first arrived at his door. He notices that look in your eyes too, and continues, "The answer to the first is quite simple actually --- I'm far more intelligent than you are. I was easily able to read your mind, even from here. That includes a few past memories too." and then a sly grin appeared on his face, "Your mind...to put it bluntly, is an open book, which makes the process of reading it easy."

and so on :)

jaynabonne
So if you don't want the quotes or parens, then just do it like this:

{if player.intelligence>=8: <i>Although, I have to admit, you are a little bit smarter than most {player.race}s that I've come across, which made the reading much harder than normal. Most impressive.</i>}

The "in-game" text you showed before had replaced {player.race} with "gnome", so that seems to be working. Or am I reading that wrong?

Anonynn

The "in-game" text you showed before had replaced {player.race} with "gnome", so that seems to be working. Or am I reading that wrong?



Yeah, those work just fine. It's the text affected by stat changes that isn't so far. Argh.


So if you don't want the quotes or parens, then just do it like this:

{if player.intelligence>=8: <i>Although, I have to admit, you are a little bit smarter than most {player.race}s that I've come across, which made the reading much harder than normal. Most impressive.</i>}



Okay then. I'll give this a shot and see if it works!

UPDATE:

So I tried it out and the intelligence thing works, yay...but the "endowment" part doesn't yet. It doesn't show up at all.

jaynabonne
You have:

{if player.breastsize=D-Cup:...

but the value you put in the "breastsize" variable is "D-cup". And case matters!

Anonynn

You have:

{if player.breastsize=D-Cup:...

but the value you put in the "breastsize" variable is "D-cup". And case matters!



Well....I feel like a real heel. Good catch on that one, I probably would have hung myself trying to figure out the problem. One day I will be as good as you, Pixie, HK, and TMI at coding....AND THEN I WILL RULE THE WORLD!

Thank you very much for that. I think the issues are officially solved for the time being. I'll double check to see if this works.

UPDATE:

IT WORKS! I FINALLY INVENTED SOMETHING THAT WORKS!

This is what makes Stat Variation possible! The "text processor!"

HegemonKhan
typos~spelling~grammer mistakes are SOOOO annoying.... they're so hard to notice~spot... on one hand, you're relieved that the problems were just stupid simple typos~spelling~grammer mistakes, and not a total failure of your code design, but on the other hand, you're PEEVED that you spent all that time to figure out the problem, when the problem was just a (cursing) simple stupid typo~spelling~grammer mistake... I mean for the time it took... it should be a more serious problem to make the time it took to find~fix it, to be worth the time it took... GRRR! :D

jaynabonne
One tool I used for this is the Quest "debugger". It allows you to look at all the objects in a game while it's running along with all of their attributes. So once I had made a character selection, I just opened up the debugger, found "player" in the side panel, and then looked at all the attributes to see what they ended up. (Much easier than looking through code! :) )

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums