My List of Questions

Encrtia
08 Oct 2015, 00:52
Ok, I'm just going to use this thread as a dumping ground for many questions that I'm going to come up with. I don't wish to flood the forum with multiple threads (unless this is acceptable?) & scattering them over loads of individual questions on another medium doesn't seem to appeal. I shall be updating this as I go along my crash-course first project - hopefully I'll be able to get assistance from your wonderful community! Apologies if my queries come across slightly incoherent - I'll naturally clarify if need be.

1) Can you explain/direct me to a tutorial section whereby I can resolve the following scenario:

After asking the Player a question (I'm currently doing it in the "After entering the room" script), several answers become available & he/she'll pick one (or type). How can I do a "If player picks/types answer A/B/C, give Player HiddenObject A/B/C" ? The part that's eluding me, is how to ask a question that gives the player the ability to pick an answer, & then chain it with a resolution.
In case you're wondering, I'm running a very simplistic Object A = High Difficulty, Object B = Medium Difficulty, Object C = Easy Difficulty, to which I'll then be able to run a check later on if the player has Object A/B/C to then play script A/B/C appropriately - as I don't know how else to do this yet x3

So far (without knowing coding in the slightest) I'm unsure how to achieve this using the available "if" commands, i.e. "if play types #text#, do so & so".

Encrtia
08 Oct 2015, 01:13
Update- - -though this wouldn't be where I'd look for my query, I'm currently sifting through http://docs.textadventures.co.uk/quest/ ... ation.html for possible solutions.

XanMag
08 Oct 2015, 03:02
Okay... I'm not sure if this is what you want, but here you go.

DISCLAIMER: This is how I would do it. But, I'm weird when it comes to getting things done. My own way is not always the best way. Someone much wiser and more helpful than me will probably come along and show you the proper way to use a pop-up menu or something like that!

Here is the code for what I did.

  <object name="If Switch Room">
<inherit name="editor_room" />
<enter type="script"><![CDATA[
msg ("You enter the room and are confronted by an angry looking man. He doesn't look too happy that you are here. He asks you a question...<br/><br/>\"What are you doing here, outsider?\" He snarls and waits for your response.<br/><br/>What shall you answer?<br/><br/>\"I'm here to insult your mother!\" - type <b>mother</b><br/><br/>\"I'm here to see if your IQ is greater than your shoe size?\" - type <b>shoe size</b><br/><br/>\"I was told you could put your head up your own rear end! Can I see that?\" - type <b>rear end</b>")
get input {
switch (LCase(result)) {
case ("mother") {
msg ("\"Well played, outsider.\" For your wit, I shall give you this prize.<br/><br/>He hands you a reward for your witty banter.")
MakeObjectVisible (reward)
AddToInventory (reward)
}
case ("shoe size") {
msg ("\"My IQ might be lower than my shoe size, but it is still many times larger than your manhood.\" He snarls at you and tosses you a cookie.")
MakeObjectVisible (cookie)
AddToInventory (cookie)
}
case ("rear end") {
msg ("\"No I cannot do that, but I can shove your head up there!\" He grabs you by the shoulders and sits squarely on your head. Gross. He pops you out just as quickly as he pops you in. You dig the shell of a corn kernel from your teeth. Funny... you didn't eat any corn.")
MakeObjectVisible (corn kernel)
AddToInventory (corn kernel)
}
default {
msg ("\"Your answer does not appease me,\" he yells.")
}
}
}
]]></enter>
<object name="Angry Man">
<inherit name="editor_object" />
<inherit name="namedmale" />
<look>He is large and angry. Be careful.</look>
<talkto>"I am done speaking with you. You had one chance to answer my question and you blew it, so buzz off."</talkto>
</object>
<object name="corn kernel">
<inherit name="editor_object" />
<visible type="boolean">false</visible>
<look>It is the shell of a corn kernel. It smells a little shitty.</look>
<take />
</object>
<object name="reward">
<inherit name="editor_object" />
<visible type="boolean">false</visible>
<look>It is a reward for being a snarky asshole. In fact, it is a certificate that says just that - "Congratulations on being a snarky asshole".</look>
<take />
</object>
<object name="cookie">
<inherit name="editor_object" />
<look>It's a cookie. Wait. Not it isn't. It just looks like a cookie. It's fake and plastic. Worthless.</look>
<visible type="boolean">false</visible>
<take />
</object>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="namedmale" />
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
<look type="script">
if (game.pov = Xanadu) {
msg ("Holy moly! That looks exactly like you! To take control of Magoo, just type 'switch to Magoo'.")
}
else {
msg ("You are a simple being trapped in a test game.")
}
</look>
</object>
</object>


For you, I think maybe the better option is to download this file and play it within the editor so you can see what I did and use it as a template to guide you for what you want to do.



Very briefly... I used a get input followed by a switch command. Make sure you check out the characters used in the case box. You must use "response","response 2", etc... Also, I tried to set it up like a multiple choice question, but for some reason the switch case of "A" is not recognized as an input. Not sure why?

As for objects as rewards, I have those three objects in the room but made them not visible. When the answer is given, I added to the script for each case an add object to inventory and make object visible script.

Please let me know if this works for you or if it is helpful at all. Thanks!
XanMag

HegemonKhan
08 Oct 2015, 04:05
The site actually prefers that you make a thread for every question you got, as we don't get much activity, and your questions can be important for other new people with the same questions, and by making all your questions in a single thread... they get buried... no one wants to go through tons of pages in a single thread, looking for those posts... (HK thought the same as you did, when he first started, and had this explained to him, now he knows betterm lol, anyways, here's my noob single thread, it may be of help for you:

Encrtia
08 Oct 2015, 04:55
Understood HegemonKhan ! Shall do! Can't see your link though.

XanMag, I'm actually editing from the Internet (not on a Windows PC [ at least presently ] ) & so can't view the Demo just yet. As for the Code, I hit Select All & Pasted it into a script within a room to see it play out & then reverse engineer it - but awkwardly, I keep getting the message "Sorry, an internal error has occurred." I must assume that the code is too long for the internet based application ?

However, I am seeing something in your code straight off the bat that I might be able to utlize from what I was able to piece together since my initial post. Essentially, if I go along with the difficulty concept that I stated earlier, that's accomplished by the method below :

  ShowMenu ("Difficulty?", Split ("Easy;Medium;Hard", ";"), false) {
player.difficulty = result


So by doing so, albeit without switches presently, player.difficulty is defining the result globally to draw upon at any point. (what's locally?)

However, drawing upon that result to take the player to a different room for a different scene to unfold (or what not), is what's eluding me still. Reviewing your code, I can see that the LCase( command is going to be key her. Without making use of switches whilst reviewing your code, makes things a little odd - especially outside of the application. & your use of <b>/<br> is similarly something I've not encountered in the scripts elsewhere.

Maybe you know how I could link the defined result from my code attached to 3 different scenes? I keep thinking it's an "if" function of "if LCase(Easy), plonk player in Room3" or something along those lines.

      get input {
switch (LCase(result)) {
case ("mother") {
msg ("\"Well played, outsider.\" For your wit, I shall give you this prize.<br/><br/>He hands you a reward for your witty banter.")


I'm thinking Get input, LCase(result), where the case is "mother", play message & move object.
Then to use another case, just do a new line with case.

Hard coding (as opposed to using the user-friendly-ish buttons) is a bit more tricky.. because, as coding goes, one missing/wrong placed character messes it all up - - - & all I know is that of a mathematician: close all brackets lol

HegemonKhan
08 Oct 2015, 05:14
Sorry, I lost my connection with the site, here's the link to my own noobie thread, it may or may not be of help to you:

viewtopic.php?t=3348

HegemonKhan
08 Oct 2015, 05:37
as to your question, there's a few different ways to go about it:

typed-in input form the person playing the game:

1. getting typed-in input from the person playing the game for their choice selection: using the 'get input' Script

2. via 'Commands' (creating your own commands)

-------

having the person playing the game, select a choice, via a menu:

1. the 'show menu' Script (for the menu popup window)
2. the in-line (within the big text box, as hypertext links in the text) ' showmenu ' Script

-----

and other various methods... like randomly selecting for them..., and etc methods that I'm too tired to think of right now, lol

-------

unfortunately, game making, requires developing your brain, in computer~code logic, regardless of whether you use the GUI~Editor or via coding:

algorithm (step by step of what you need to do to accomplish what you want) logic:

1. display~present the choices to the person playing the game
2. getting and storing their choice
3. comparing their choice (via your VARIABLE: Attribute that is storing the user's choice) to something, to determine what is to be done
4. doing what is determined to be done
5. informing~presenting to the person playing the game, of what was done

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

the character creation guide is a great second step (first step is the tutorial), to learn, as it does deal with some of the basic things, albiet applying the character creation to other stuff you want to do isn't easy for new poeple, even if you learn and are able to do the character creation well.

--------

if you want, search through my posts, but unfortunately there a a lot fo them, lol, and most are code-help posts, but I do ahve some that help in great step by step detail via using the GUI~EDitor, and I also try to explain the stuff well too, lots of posts of mine in trying to help new people, hehe.

look for long massive text-wall posts of mine... they're the very helpful ones, lol

HegemonKhan
08 Oct 2015, 05:53
these could be helpful to you too:

viewtopic.php?f=18&t=5492

-----

this is code... but try reading it, and just seeing if any of it kinda makes sense to you, as it can help give you some ideas on what~how to do what you want:

viewtopic.php?f=18&t=4988
(HK edit: actually, I forgot I use a bit more advanced stuff in it, but there are some parts that may be of help)

not sure if the game file works or not... can't remember, lol.

-------

HK EDit:

try looking at this too, for some ideas:

viewtopic.php?f=10&t=3348&start=120#p22483

-------

I know the code stuff scares you, and this post of mine isn't of much help, but I just don't have the time, at least not right now, to help you better.

Believe me, I understand, you may get some of this stuff, but how do you actually do it in the GUI~Editor, is something else, I've been there too... I was a noob just like you, not knowing anything at all, especially not how to code, but I can now say that quest is a really good resource if you want to learn how to code, or if not, it's still a great resource for making games, though you got to learn it, just like with any game-making software~engine, as I'm now taking programming classes, and quest is so much easier to understand then the programming languages, laughs.

------

look for threads~posts on:

the ' if ' Script and ' set a variable or attribute (Attributes) ' Script, as these are the two SUPER scripts that let you do 90% of everything that you want to do with your game.

Encrtia
09 Oct 2015, 01:45
HegemonKhan wrote: as to your question, there's a few different ways to go about it [...]and etc methods that I'm too tired to think of right now, lol

I was fortunate enough to learn all of the above from reviewing the coding examples in the tutorial provided : )
HegemonKhan wrote: unfortunately, game making, requires developing your brain, in computer~code logic, regardless of whether you use the GUI~Editor or via coding

As the website clearly states:
TextAdventures wrote: You don't need to know how to program. All you need is a story to tell. Your game can be played anywhere. In a web browser, downloaded to a PC, or turned into an app.

I’m hoping your point is not entirely the case, as the main reason I’m here is because of what was advertised just above. However, I’m aware there’s a distinct difference between a very basic concept (queuing scenes) & an advanced concept (implementing a combat system) that’ll no doubt require an understanding of coding to accomplish. So I’m not opposed to trying to understand some coding (which I have already done, & will continue to do so).
HegemonKhan wrote: algorithm (step by step of what you need to do to accomplish what you want) logic:

1. [...] 5. informing~presenting to the person playing the game, of what was done

Thank you for painting the Algorithm Logic picture : P I’m comfortable with storing variables such as the player’s name (player.alias) or any stat (player.strength) & in turn drawing upon it in an expression,
msg (player.alias + " has great " + LCase (player.strength) + ".")
but knowing what LCase actually does, or using an answer from a show menu outcome to take the player object to a new room, not so sure. Step 5 is easy as well.

As for your links: I can’t download any files (or rearrange my room order effectively...) as I’m using the web-based application. More so, I’m unsure where I’m supposed to be copying the codes that you’ve most generously posted in addition – every time I do so, I get an internal error! I’m thinking I’m not supposed to be copying the whole code... &/or I need to copy certain section(s) to the appropriate place(s) for it to work, which currently eludes me. Where/what should I copy from the codes provided to be able to tinker with it in the online-based application?
HegemonKhan wrote: the character creation guide is a great second step (first step is the tutorial), to learn, as it does deal with some of the basic things, albiet applying the character creation to other stuff you want to do isn't easy for new poeple, even if you learn and are able to do the character creation well.

The link you sent from The Pixie has a file that I don’t think is accessible with the online application, & as for the innate Character Creation tutorial, I’ve mastered that already : ) I’m just stuck on what I’m fully aware is the 90% of the time most useful concept – the If function, in regards to immediate Choice & Action scenarios for now.
HegemonKhan wrote: I know the code stuff scares you, and this post of mine isn't of much help, but I just don't have the time, at least not right now, to help you better.

I must confess – your help is very much appreciated, but I’m being bamboozled with areas to comb to find answers instead of an answer, that's leaving me feeling rather lost. I’m not ungrateful, & am (as you can see) going through the links as diligently as I can – but it really is incredibly daunting to someone that’s asked “If I Differentiate 2x^2, what do I need to do to get the answer?” & instead of telling me straight “You times the coefficient (the value in front of x) by the power (^2 in this case) then subtract one from the power, you get the answer 4x”, I’m being told “Listen, look through all these exam questions & solutions where the person firstly applies L’Hopital’s rule, partially differentiating the simultaneous equations after expanding & simplifying all the known equations. These whole processes are a means to acquire the temperatures on distant planets without landing on them or key architectural understandings to know, or other. Within these examples, is a part where you differentiate that you can learn from.”

Again, I reiterate, I am EXTREMELY grateful for the effort you’ve provided, & am trying to work with your posts. My understanding is simply primitive at the moment, so making connections between things in a bunch of coding is proving to be quite troublesome. Especially when I’m fixated on my current dilemma, which is no doubt replicated in different ways throughout your code – but not exactly the way I envision it which is why I’m missing it.

I’ve since yesterday been going through your topics with coding, & will continue to do so, until something (fingers crossed) just “clicks”, or doesn't.. I’ll also try searching for topics relevant to my query to see if I can acquire the solutions I need by myself, as you suggested. If you should happen to have a slither of code that pertains exactly to moving a player (object) from one room to another after picking a direction from a show menu choice - it'd be most appreciated.

HegemonKhan
09 Oct 2015, 02:41
add new script -> output -> 'show a menu' Script -> (see below)

Show menu with caption [text]: Choose one // or whatever~however you want to say whatever here, lol

Options from list/dictionary: split ("A; B; C", ";")

// http://docs.textadventures.co.uk/quest/ ... split.html
// http://docs.textadventures.co.uk/quest/ ... ation.html
// the 'split' Function is a quick way to create a temporary (or a permanent) list, which is often used with~for menus

Allow player to ignore the menu: [no] // presumably, you'd want this to be no, lol

// about 'show a menu' and 'get input' Scripts: quest, automatically (hidden from you), assigns your selection (show a menu) or input (get input), to the variable: result (shown below)
// result = your_menu_selection(show a menu)_or_your_typed_in_input(get input)

-> after choosing, run script -> add new script -> scripts -> "if" Script -> if [expression] result = "A"

// for example, using:
// result = "A"
//
// if (result = "A")
// agebraic substitution done by quest (you do NOT see, NOR do you write~code in, this):
// conceptually ONLY:
// if ( (result) = "A")
// if ( (result = "A") = "A")
// if ( ("A") = "A")
// if ("A" = "A")

// conceptually (if you chose A): if ("A" = "A") -> TRUE -> DO the immediately proceeding 'then' Script(s)
// conceptually (if you chose B): if ("B" = "A") -> FALSE -> do NOT do the immediately proceeding 'then' Script(s)
// conceptually (if you chose C): if ("C" = "A") -> FALSE -> do NOT do the imediately proceeding 'then' Script(s)

->-> then: -> add new script -> objects -> 'Move Object' Script -> move object [object] [your_high_difficulty_object] to [object] [your_player_object]

-> add else if -> Else if [expression] result = "B"

// conceptually (if you chose A): if ("A" = "B") -> FALSE -> do NOT do the immediately proceeding 'then' Script(s)
// conceptually (if you chose B): if ("B" = "B") -> TRUE -> DO the immediately proceeding 'then' Script(s)
// conceptually (if you chose C): if ("C" = "B") -> FALSE -> do NOT do the imediately proceeding 'then' Script(s)

->-> then: -> add new script -> objects -> 'Move Object' Script -> move object [object] [your_medium_difficulty_object] to [object] [your_player_object]

-> add else if -> Else if [expression] result = "C"

// conceptually (if you chose A): if ("A" = "C") -> FALSE -> do NOT do the imediately proceeding 'then' Script(s)
// conceptually (if you chose B): if ("B" = "C") -> FALSE -> do NOT do the immediately proceeding 'then' Script(s)
// conceptually (if you chose C): if ("C" = "C") -> TRUE -> DO the immediately proceeding 'then' Script(s)

->-> then: -> add new script -> objects -> 'Move Object' Script -> move object [object] [your_easy_difficulty_object] to [object] [your_player_object]

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

then when~where ever (some other location~event~action in your game: for example, some other Object's Verb, like maybe a 'door' Object's 'open' Verb, if your A-B-C Objects were keys, for example) you want~need to do whatever based upon what Object you've got in your inventory:

add new script -> scripts -> "if" Script -> if [expression] Got(name_of_your_high_difficulty_object_goes_here)

// http://docs.textadventures.co.uk/quest/ ... y/got.html
// ~OR~
// http://docs.textadventures.co.uk/quest/ ... ntory.html
// http://docs.textadventures.co.uk/quest/ ... tains.html
// ~OR~
// http://docs.textadventures.co.uk/quest/ ... tains.html

-> then: -> add new script -> (whatever script you want to do for this event~action~location if you've got the high difficulty object in your inventory)

add else if -> Else if [expression] Got(name_of_your_medium_difficulty_object_goes_here)

-> then: -> add new script -> (whatever script you want to do for this event~action~location if you've got the medium difficulty object in your inventory)

add else if -> Else if [expression] Got(name_of_your_easy_difficulty_object_goes_here)

-> then: -> add new script -> (whatever script you want to do for this event~action~location if you've got the easy difficulty object in your inventory)

else -> add new script -> (probably a 'print a message' Script: Too bad, you don't have the required difficulty object, or you don't have any of the difficulty objects, go get the right one, or go get them!)

Encrtia
09 Oct 2015, 03:13
UPDATE!!

HegemonKhan wrote:if" Script -> if [expression] result = "A"


I'm still going through your wonderful post to understand the rest, but that right there was Exactly what I was looking for!

Thanks a Lot! Will respond to the rest after I've gone through it all!! :D

HegemonKhan
09 Oct 2015, 03:22
muwaha, you're doing coding, laughs :D

I don't know the GUI~Editor's scripts' drop down menu options very well, so I cheat, using the [expression] drop down menu script option, allowing me to write in the code, instead of figuring out what bloody GUI~Editor script option does what I want it to do, laughs. I had trouble with what those GUI~Editor Scripts' drop down menu options meant~were saying~doing, lol. Too cryptic for my brain...

if you know the correct GUI-Editor's drop down menu script options, then choose those, instead of my usage of the [expression] drop down menu script choice.

Encrtia
09 Oct 2015, 03:26
You caught me hahha, I'm using the GUI as a basis - but looking at the code behind to understand / tweak manually if able :) I'm using [expression] also, as it's the only way I know how to draw upon saved variables with text around it, I think ^_^ but when there's no need for coding, I'll just use [text]

HegemonKhan
09 Oct 2015, 03:34
the [text] or [message] options *ONLY* allow for textual stuff (normal human language writing: words, sentences, paragraphs, lol).

if you want to use VARIABLES + text, then you got to choose the [expression] ( or for game book version: [page+script] or [script] ) option.

for example:

print [message] Hi HK!
// outputs: Hi HK!

print [message] Hi XanMag!
// outputs: Hi XanMag!

// npc.alias = "HK"
print [message] Hi + npc.alias + !
// ERROR !!!!

// npc.alias = "XanMag"
print [message] Hi + npc.alias + !
// ERROR !!!!

vs

// npc.alias = "HK"
print [expression] "Hi " + npc.alias + "!"
// outputs: Hi HK!

// npc.alias = "XanMag"
print [expression] "Hi " + npc.alias + "!"
// outputs: Hi XanMag!

Encrtia
09 Oct 2015, 12:00
The rest makes perfect sense! The conceptual concepts at first scared the bejeezus outta me, but then once I was actually "reading", it all made perfect sense. I'm just making sure you know how thankful I am for typing it up in some baby steps for me! I'm now tinkering with other "functions"(key words such as "Got" or "If"), which'll no doubt bring upon other such confusions haha but with the basics down & understood, it should be an easier process!