[quote]({if player.race=elven: Blah blah different text.)[/quote]
if (player.race = "elven") {
msg ("The trees are really magical here.")
}
else {
msg ("The trees are boring.")
}
if (Object_name.Attribute_name OPERATOR Value_or_Expression) {
// msg ("text" + Object_name.Attribute_name + "text")
// or
// Object_name.Attribute_name = Value_or_Expression
}
Neonayon wrote:
({if player.race=elven: Blah blah different text.}) <--- putting the second bracket in. But all that comes up is () still.
<!--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>
msg ("{if player.race="elven":your_text} {if player.race="dwarf":your_text} {if player.race="neko":your_text}")
Perhaps your variable player.race is not set properly?
msg ("blah {if player.race=elven:blah {if player.haircolor=black:blah}} blah {if player.race=dwarf:blah {if player.haircolor=white:blah}} blah")
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)
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
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?
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>"
("{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>}")"
{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>}
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>}")
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?"
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>"
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?
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.
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?
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?
\"Not at all, he was an elf ({if player.race=elven:Much like yourself...})
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.
{"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>)"}
<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>
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!.."})
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.")
}
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:"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:("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:("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.")}
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.
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?
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>}
You have:
{if player.breastsize=D-Cup:...
but the value you put in the "breastsize" variable is "D-cup". And case matters!