Creating / Editing Lists through GUI

DGNXFoxN
Is there a way to create lists and add values to them using the GUI?
People having been mentioning posts with code, but not completely sure what to do with the code.

adammadam
idk if this is what you're looking for or not http://docs.textadventures.co.uk/quest/ ... cript.html

DGNXFoxN
Wasn't exactly what i meant but i did have an issue i was still figuring out where your reply could come in handy.

What im looking for is a literally a list that holds text string values. When certain things in the game happen values will be added to that list. And when needed the list can be fully shown when the requests it. This would be great for an achievement system im working on.

TinFoilMkIV
For the GUI editor you'll want the standalone version for the most access to list related functions, due to the web version not being able to access attributes.

for pure GUI editor use, you'll need to add the list as an attribute of an object. Under the attribute tab of the object, the second box is labelled 'attributes', hit the add button, name it, and set the type to 'String List', then you should have a new button over the attributes info box that allows you to add or remove items from your list.

There is also a script for 'Add a value to a list' under the Variables section.

DGNXFoxN
I'm using the standalone version :)
Thank you very much for your answer! This is very helpfull!

adammadam
yeah so like was said above if you add an attribute to the player called "achievements" have it set to string then also add "achievements" under status attributes as well for the player. Then you can have a "set attribute" script run at the end of any script where the character will complete an achievement (click on add new script, choose "set variable or attribute"), then in the "set variable" box put in player.achievements and in the other box put in player.achievements + "finished school" (or whatever text you want in quotes) then it'll show up under the character status box...

But if you wanted it to be something not shown in the status box but the character types "show achievements" and the list pops up.. I'm not completely sure but there must be some way to do it.. like you can set object flags at the end of anything a character does where they get an achievement "set object flag - school completed" (for the player) then in the command make it so that if the player has that flag it adds the relevant text..

HegemonKhan
@adammadam:

the 'text processor commands' would be the easiest way to do it:

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

<command name="trophy_command">
<pattern>trophy</pattern>
<script>
trophy_function
</script>
</command>

<function name="trophy_function">
msg ("Trophies")
msg ("")
msg ("{if global_data_object.dragon_killed_boolean_attribute: Dragon Slayer}")
msg ("{if global_data_object.behemoth_killed_boolean_attribute: Behemoth Slayer}")
</function>


OR

you can use 'foreach' and Lists~Dictionaries too (too lazy to write up an example though)

--------

@DGNXFoxN:

if~when you're interested in code (or just want to see what conceptually ~ can be done with Lists~Dictionaries), see here:

viewtopic.php?f=18&t=5137
viewtopic.php?f=18&t=5138
viewtopic.php?f=18&t=4988

DGNXFoxN
I had another question regarding lists.

I'm able to put strings into lists but I was wondering if it is possible to see if a list contains a specific string and if so execute a script, if not execute something else.

HegemonKhan
yes, most certainly, though again I don't know how to do so directly via GUI~Editor options~drop down choices, but here's a way of doing it (some of it in code due to laziness):

http://docs.textadventures.co.uk/quest/ ... tains.html
http://docs.textadventures.co.uk/quest/ ... split.html ('split' is a quick way to make a list)

game.colors_list = split ("red;blue;yellow", ";")
// GUI~Editor would be using: 'set a variable or attribute' Script -> [expression] -> (set up to look like above)

// you know how to do the 'if' Script and (just for this example) 'print a message' Script in the GUI~Editor already (so showing it in quasi code):

if [expression] ListContains (game.colors_list, "red") {
msg ("You get an apple!")
} else if [expression] ListContains (game.colors_list, "blue") {
msg ("You get blueberries!")
} else if [expression] ListContains (game.colors_list, "yellow") {
msg ("You get a banana!")
} else {
msg ("You get a lump of coal.")
}


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

and for Dictionaries:

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

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

though if you want to do more fancy (but complicated) stuff, selecting specific and~or random list~dictionary items (the list's~dictionary's Values):

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

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

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

---------

I see from your other thread, that you seem to know network programming~coding~its commands~syntax... I'm still a noob with networking, laughs.

so if you know what 'arrays' are, quest's lists~dictionaries are 'arrays'

DGNXFoxN
@HegemonKhan
Thank you so much! This will actually help a lot for managing the files in my game.

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

Support

Forums