Switchable Object hyperlinks not showing (Answered! :)

niekitty
I'm new here, so I'm sure that I'm doing something thoroughly ignorant here, but I'm trying to go through the tutorial and ran into an issue.
I created the TV object for the lounge, and got to the "switchable" part for turning it on and off. Did everything as indicated in the tutorial word for word. The object is in the game, and even works, but the commands for turning it on and off do not appear in the hyperlink menus. Typing "Turn on X" works fine, but clicking on the object name shows only "look at" and a "search" verb I added while experimenting around some.

What'd I screw up? XD

HegemonKhan
******************************************************************************************************************

in the GUI~Editor:

http://quest5.net/wiki/Upgrade_Notes

I use quest's 540 (5.40) version, ' <asl version="540"> ', so here's the paths for the options~settings of it:

(This below should be in the upgrade notes... but it isn't put there yet by someone, and I'm too lazy to do it myself)

1. game (Object) -> Room Descriptions (Tab) -> (automatically generate object display verbs lists)

2. "whatever" (Object) -> Object (Tab) -> Display Verbs -> (lots of options)

*******************************************************************************************************************


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

Commands as of themselves don't show up as hyperlinks and~or as buttons, you'll have to make a Verb for hyperlinks and~or buttons.

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

in code, to add more Verbs as your hyperlinks~buttons:

<object name="blah">
-> <inherit name="editor_object" />
-> <attr name="blah_1" type="script">
->-> msg ("hi")
-> </attr>
-> <attr name="blah_2" type="script">
->-> msg ("how are you")
-> </attr>
-> <attr name="blah_3" type="script">
->-> msg ("bye")
-> </attr>
-> <take />
-> <drop />
-> <look />
-> <open />
-> <attr name="displayverbs" type="simplestringlist">look;take;open</attr>
-> <attr name="inventoryverbs" type="simplestringlist">look;open;drop</attr>
-> <attr name="displayverbs" type="listextend">blah_1;blah_3</attr>
-> <attr name="inventoryverbs" type="listextend">blah_1;blah_2</attr>
</object>

type="listextend", adds to the special list, attr name="displayverbs", (these are your displayed, ie hyperlinks and~or buttons, Verbs):

original list items (let's say): look, take, open
"extended" list items: look, take, open, blah_1, blah_3

attr name="inventoryverbs", does the same thing, for when the item~object is in your inventory (ie: you wouldn't have "take" as one of your inventory verbs, lol. As, instead, you'd have the "drop" Verb).

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

there's a way to connect a Command (or a Verb) to~as a Verb (or a Command) also, I believe anyways, but I'm not quite sure how it is done (it's in some libraries or other sources ~ if I knew which one though... sigh, sorry).

On your Verb Element, you add in the ' <pattern></pattern> ' (as this has to do with the 'typing in ability' of Commands ~ I think), but I think there's also more needed to make it work as both a Verb and Command... not sure...

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

here's the two elements (Verbs and Commands) in coding form:

http://quest5.net/wiki/Command_element
http://quest5.net/wiki/Verb_element

and there's also the displayment of them as hyperlinks~buttons:

http://quest5.net/wiki/Displayverbs
http://quest5.net/wiki/Inventoryverbs

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

I hope this helps, and if you need any help with any of it, please ask, and I'll help if I can, or try to explain it better for you.

niekitty
Gah, okay. XD
Thanks Hegemon.

I'm more an artist than a coder, but I can probably stumble my way through this scripting, it isn't too complex. From reading the tutorial i understood that checking the "Can Be Switched On/Off" flag on an object automatically created the verbs (it sure did create a complex script with a verb label set in the verb list) as viewable options in the hyperlinks.

Ah well; can't have it TOO easy, right? :)

HegemonKhan
the bolded part's #1 and #2 at the top of my previous post, should be all you need to mess with. All the other stuff below is indeed some explanation and with via working on code, so you can ignore that, until~when~if you're ready for it, lol.

if you don't understand what I mean by

game (object) -> room descriptions (Tab) -> ....

"whatever" (object) -> objects (Tab) -> ....

let me know, and I'll explain it in more detail so you do understand it.

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

these "toggle" options (the checkboxes) were added because... err..gh... this is going to be hard to try to explain clearly... lol

let's say the default Verbs (hyperlinks~buttons) for an object are:

open, take, look

but you can also add to this list of Verbs too, such as, let's say:

learn, read, drink

some game creators may want initially all the objects to only have the Verbs of: open, take, look

while other game creators may want initially all the objects to have all of the Verbs of: open, take, look, learn, read, drink

and still some other game creators may want the initial Verbs of all objects to be: sleep, rest, play, work

and then, while the game creator wanted most objects to have certain verbs, they didn't want all objects to have (or not have) these same certain verbs, which creates a problem if you only have a check box of "all or~vs none", so an option was added to each individual object, to remove it from that "all" checked off box, so that you can set up that object's verbs differently.

anyways, you have to mess with the options, to probably better (or just outright, lol) understand, what I'm trying to poorly explain to you.

and those options are found in my bolded part at the top of my previous post (hopefully I'm still not missing any other spot of options related to the Verbs' displayment of hyperlinks~buttons).

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

P.S.

I'd remove your "(answered!)" in your thread's title, so you can get a precise clear answer~help~explanation, than mine (which isn't at all, argh. I'm more of a... confuse'r, than an explain'er, wink, heh).

try asking the mods, jaynabonne (if he doesn't mind helping yet another person, lol), and~or the other knowledgeable users, as they can help you with this (and in understanding it too) much more so, than I can do so.

niekitty
Actually, as complex as your answer was, i did get enough of it that i'm starting to get somewhere with the thing. More trying to figure out the variable system right now so i can make some proper stats and skills with my little learning project. the way it handles variables is a little different than anything i've slogged through before...

HegemonKhan
hopefully, this will be of some help

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

The Two Super Scripts (you can do ~ 90% of everything~anything that you want with just these two scripts used together):

In the GUI~Editor: run as script -> add a script -> Scripts -> If...
~AND~
In the GUI~Editor: run as script -> add a script -> variables -> set a variable or attribute

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

Variable (are not attached to objects, which means they can only be used for that single script block that it is used within):

Variable = Value_or_Expression

example of using a Value:

you_go_first = false
color = black
x = 3

example of using an Expression:

x = (x + 1) / 2
primary_pigment_colors = split ("blue;yellow;red",";")

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

Attribute (are attached to objects, which means you can use them anywhere, so long as the Object still exists of course):

Object.Attribute = Value_or_Expression

example of using a Value:

HK.strength = 100
HK.dead = false
HK.favorite_color = black

example of using an Expression:

HK.damage = weapon.damage + weapon.damage * (HK.strength - orc.endurance) / 100

and it's 'tagging' too:

(in the GUI~Editor: "whatever" Object -> Attributes Tab -> Attributes -> Add)

<object name="HK">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="strength" type="int">100</attr>
<attr name="damage" type="int">0</attr>
<attr name="dead" type="boolean">false</attr>
<attr name="favorite_color" type="string">black</attr>
<attr name="attack" type="script">
HK.damage = weapon.damage + weapon.damage * (HK.strength - orc.endurance) / 100
</attr>
</object>


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

Addition:

Object.Attribute = Object.Attribute + your_number_amount
example: HK.strength = HK.strength + 100

Subtraction:

Object.Attribute = Object.Attribute - your_number_amount
example: HK.strength = HK.strength - 100

Multiplication:

Object.Attribute = Object.Attribute * your_number_amount
example: HK.strength = HK.strength * 100

Division:

Object.Attribute = Object.Attribute / your_number_amount
example: HK.strength = HK.strength / 100

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

conceptual example:

Old: HK.strength = 25

HK.strength = HK.strength + Value
HK.strength (new) = HK.strength (old) + 50 (Value)
HK.strength (new) = 25 (old) + 50 (Value)
HK.strength (new) = 75 (Value)

New: HK.strength = 75

niekitty
Aaaah! That actually helps a TON! Thanks! =^^=
i still need to figure the whole showmenu thing out, since chosen background affects stats, but this makes things work a LOT better. XD

...I keep telling myself that some day i'm going to go for a small project just to learn from with a new engine, but somehow my projects always just keep growing as I work on them...

HegemonKhan
here's some links:

General Links:

01. http://quest5.net/wiki/Main_Page
02. http://quest5.net/wiki/Tutorial
03. http://quest5.net/wiki/How_to (guides)
04. viewforum.php?f=18 (more guides: libraries and code samples)
05. http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
06. http://quest5.net/w/index.php?title=Cat ... t#mw-pages (page 2, range: S-Z)
07. http://quest5.net/wiki/Object_element
08. http://quest5.net/wiki/Attribute_Types
09a. http://quest5.net/wiki/ASLX_Elements
09b. http://quest5.net/wiki/Category:ASLX_Elements


Specific Links:

1. http://quest5.net/wiki/Showing_a_menu (you select a choice from a popup menu window during game play)
2. http://quest5.net/wiki/Get_input (you type in your choice during game play)
3. http://quest5.net/wiki/Character_Creation
4. http://quest5.net/wiki/Using_Lists
5. http://quest5.net/wiki/Stringlist
6. http://quest5.net/wiki/Split
7. http://quest5.net/wiki/If
8. http://quest5.net/wiki/Switch (a different way of doing the same thing as multiple "if" scripts)
8a. http://quest5.net/wiki/Hs-multiple
8b. http://quest5.net/wiki/Hs-case

here's a coding of mine that you can take a look at, use~change, and~or play with, hehe:

(you can simply copy and paste this into a new game file, deleting the initial default code first of course, save it, and then open your game file up in the GUI~Editor, to see how it's done~looks in the GUI~Editor, or if you're comfortable with working with code, then you can do that too)

<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>cd102f9d-370a-4bda-b6ea-ca42288f619c</gameid>
<version>1.0</version>
<start type="script">
msg ("What is your name?")
get input {
msg ("- " + result)
player.alias = result
show menu ("What is your gender?", split ("male;female" , ";"), false) {
player.gender_x = result
show menu ("What is your race?", split ("human;elf;dwarf" , ";"), false) {
player.race = result
show menu ("What is your class?", split ("warrior;cleric;mage;thief" , ";"), false) {
player.class = result
msg (player.alias + " is a " + " " + player.gender_x + " " + player.race + " " + player.class + ".")
}
}
}
}
</start>
<turns type="int">0</turns>
<statusattributes type="simplestringdictionary">turns = </statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_player" />
<inherit name="editor_object" />
<alias_x type="string"></alias_x>
<gender_x type="string"></gender_x>
<strength type="int">0</strength>
<intelligence type="int">0</intelligence>
<agility type="int">0</agility>
<statusattributes type="simplestringdictionary">alias = Name: !;gender_x = Gender: !;strength = ;intelligence = ;agility = ;level = ;experience = ;cash = </statusattributes>
<level type="int">0</level>
<experience type="int">0</experience>
<cash type="int">0</cash>
</object>
<object name="potion100">
<inherit name="editor_object" />
<alias>potexp100</alias>
<take />
<displayverbs type="simplestringlist">Look at; Take; Drink</displayverbs>
<inventoryverbs type="simplestringlist">Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
player.experience = player.experience + 100
</drink>
</object>
<object name="potion300">
<inherit name="editor_object" />
<alias>potexp300</alias>
<take />
<displayverbs type="simplestringlist">Look at; Take; Drink</displayverbs>
<inventoryverbs type="simplestringlist">Look at; Use; Drop; Drink</inventoryverbs>
<drink type="script">
msg ("You drink the exp potion, receiving 300 experience.")
player.experience = player.experience + 300
</drink>
</object>
</object>
<turnscript name="global_events_turnscript">
<enabled />
<script>
leveling_function
game.turns = game.turns + 1
</script>
</turnscript>
<function name="leveling_function"><![CDATA[
if (player.experience >= player.level * 100 + 100) {
player.experience = player.experience - (player.level * 100 + 100)
player.level = player.level + 1
switch (player.gender_x) {
case ("male") {
player.strength = player.strength + 1
}
case ("female") {
player.agility = player.agility + 1
}
}
switch (player.race) {
case ("dwarf") {
player.strength = player.strength + 2
}
case ("elf") {
player.agility = player.intelligence + 2
}
case ("human") {
player.strength = player.strength + 1
player.agility = player.agility + 1
}
}
switch (player.class) {
case ("warrior") {
player.strength = player.strength + 2
}
case ("cleric") {
player.intelligence = player.intelligence + 1
player.agility = player.agility + 1
}
case ("mage") {
player.intelligence = player.intelligence + 2
}
case ("thief") {
player.strength = player.strength + 1
player.agility = player.agility + 1
}
}
leveling_function
}
]]></function>
</asl>


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

making a game, takes a long long long long time, lol

I wanted to have something completed and to give back to this awesome site~program(quest), so I made something as simple (and thus quick lol) as possible: a "rock, paper, and scissors" game:

viewtopic.php?f=5&t=4094

super simple, but that's the point, I actually finished it, lol.

while I slowly work on building my code skills and trying to make a real (an ambitious RPG) game... lol

niekitty
Thanks again. =^^=
It's all the List and Dictionary things that keep throwing me off with the menu stuff, but i'm getting there i think. I do appreciate all the help. the wiki tutorials show me a lot, but don't explain a lot of "Why"s, so it's hard to figure out what the different bits of code are doing. sort of a "oh, yes, that does that, but how do i do something other than the tutorial stuff with it?" kinda thing.
plus half the time if i just go with the wiki stuff straight out of the box to test it, it doesnt quite seem to work right. XD

As far as making a game goes, i figure that as long as i'm having fun doing it, and maybe improving myself somehow along the way, then it isnt a waste of time. =^^=

HegemonKhan
what do you need help with in regards to "show menu", "lists", and~or "dictionaries" ???

what do you need explained in terms of the "whys" of something ???

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

I'd recommend first trying to go through most of the tutorial, being able to do most of it successfully (ask us if you need any help on anything ~ if you can't get it to work right ~ or at all). Once, you got the tutorial down well, then try to work on the "character creation", understanding it and getting it to work correctly. Then, find something else small, and work on it, and slowly build up more knowledge and understanding, and a mindset of "code logic" brain thinking, for example, "if~check thinking" :

"fight" Verb of an "orc" Object:

if (orc.dead = true) {
-> msg ("The orc is already dead, silly.")
} else if (orc.dead = false) {
-> orc.hp = player.damage - orc.hp
-> msg ("You attack the orc.")
-> if (orc.hp <= 0) {
->-> orc.dead = true
->-> msg ("You killed the orc.")
-> } else if (orc.hp > 0) {
->-> player.hp = orc.damage - player.hp
->-> msg ("The orc attacks you.")
->-> if (player.hp <= 0) {
->->-> msg ("You were killed by the orc.")
->->-> msg ("GAME OVER")
->->-> finish
->-> } else if (player.hp > 0) {
->->-> msg ("You survived the orc's attack.")
->-> }
-> }
}

more advanced coding logic brain thinking:

"string comparisons"

if (string_1 = string_2) {
-> // do script_1
} else if (not string_1 = string_2) {
-> // do script_2
}

"not equals" conditional: "<>" or "not"
1. if (string_1 <> string_2) {
~OR~
2. if (not string_1 = string_2) {

player_1:
alias = "aladdin"
loves = "jasmine"

player_2:
alias = "jasmine"
loves = "aladdin"

if (player_1.loves = player_2.alias or player_1.alias = player_2.loves) {
// conceptual: if (jasmine = jasmine or aladdin = aladdin) {
-> msg ("Aladdin and Jasmine love each other, and get married, happily ever after.")
} else {
-> msg ("Unfortunately love must be both ways, and thus Aladdin and jasmine never marry each other happily ever after, this isn't how it is suppose to end! Disney movies are supposed to have happy endings!")
}

// example of unhappy ending:
//
// player_1:
// alias = "aladdin"
// loves = "gold"
//
// player_2:
// alias = "jasmine"
// loves = "jafar"

if (player_1.loves = player_2.alias or player_1.alias = player_2.loves) {
// conceptual: if (gold = jasmine or aladdin = jafar) {
-> // NOPE, because: "g-o-l-d" is not the same as "j-a-s-m-i-n-e" or nor is "a-l-a-d-d-i-n" the same as "j-a-f-a-r"
-> msg ("Aladdin and Jasmine love each other, and get married, happily ever after.")
} else {
-> // YEP, sadly we've got an unhappy ending here
-> msg ("Unfortunately love must be both ways, and thus Aladdin and jasmine never marry each other happily ever after, this isn't how it is suppose to end! Disney movies are supposed to have happy endings!")
}

--------

one of the hardest parts of learning to code is in trying to train your brain to start thinking in terms of ' coding~computer logic '

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

Support

Forums