My learning thread.
JestersMagpie
25 Oct 2013, 12:03Hi all,
This is going to be my learning thread. I'm going to put all my starting out questions here as I get to grips with the basics.
At the moment I have the player out Geocaching and pissed off at finding micros and nanos along a muddy footpath. He hears a bleep. At the moment he can look north or South but not move. But once he looks at the bleep/garmin/gps he sees an arrow pointing north and can move along the footpath through a couple of steps to the cache GZ. It'll be the ultimate nasty condition micro, in ivy, cracked lid, damp, full log book and a slug in it lol. From there the Labyrinth game will start and the slug will talk and give him his first clue.
I've added boolean conditions for the gps and the player can't move, which is what I want, It's creating the boolean conditions I'm for 'noticed' the gps I'm having problems with.
I was sent info for immobilising the player (http://quest5.net/wiki/Immobilise_the_player) and managed to do that bit, adding the 'subverted code' and not have this;
Thanks
This is going to be my learning thread. I'm going to put all my starting out questions here as I get to grips with the basics.
At the moment I have the player out Geocaching and pissed off at finding micros and nanos along a muddy footpath. He hears a bleep. At the moment he can look north or South but not move. But once he looks at the bleep/garmin/gps he sees an arrow pointing north and can move along the footpath through a couple of steps to the cache GZ. It'll be the ultimate nasty condition micro, in ivy, cracked lid, damp, full log book and a slug in it lol. From there the Labyrinth game will start and the slug will talk and give him his first clue.
I've added boolean conditions for the gps and the player can't move, which is what I want, It's creating the boolean conditions I'm for 'noticed' the gps I'm having problems with.
I was sent info for immobilising the player (http://quest5.net/wiki/Immobilise_the_player) and managed to do that bit, adding the 'subverted code' and not have this;
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Below Above - Labyrinth">
<gameid>e097b69b-0ff4-4263-8148-7c48bb260466</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<attr name="autodescription_youarein" type="int">0</attr>
<autodisplayverbs type="boolean">false</autodisplayverbs>
</game>
<command name="go_subverted">
<pattern type="string"><![CDATA[^go to (?<exit>.*)$|^go (?<exit>.*)$|^(?<exit>north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]></pattern>
<unresolved>You can't go there.</unresolved>
<script>
if (GetBoolean (player, "immobilised")) {
Print ( player.immobilised = True, player.immobilisedmessage = "What's telling you to do that?", player.immobilised = False)
}
else if (exit.locked) {
msg (exit.lockmessage)
}
else if (HasScript(exit, "script")) {
do (exit, "script")
}
else {
if (exit.lookonly) {
msg ("You can't go there.")
}
else {
player.parent = exit.to
}
}
</script>
</command>
<object name="Cache footpath">
<inherit name="editor_room" />
<description><![CDATA[Whilst out caching one day, you’re starting to get fed up with finding an endless stream of micros and nanos. You traipse through more mud, slipping and sliding towards the next micro. You mutter ‘I wish for a bigger cache!’ <br/>Voices, or is it the wind, mutter, "that’s not the words!" <br/>As if on key, to bring you back to the present you hear a 'bleep']]></description>
<picture>muddy footpath.jpg</picture>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
</object>
<exit alias="south" to="Cache footpath">
<inherit name="southdirection" />
<lookonly />
<look>The muddy footpath back, very uninviting</look>
</exit>
<object name="gps">
<inherit name="editor_object" />
<alias>garmin, bleep, gps</alias>
<scenery />
<noticed type="boolean">false</noticed>
<look type="script">
OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
</look>
</object>
<exit name="look at gps" alias="north" to="foothpath">
<inherit name="northdirection" />
<scenery />
<locked />
<lockmessage>Why?</lockmessage>
</exit>
</object>
<object name="foothpath">
<inherit name="editor_room" />
<exit alias="north" to="foothpath near gz">
<inherit name="northdirection" />
</exit>
<exit alias="south" to="Cache footpath">
<inherit name="southdirection" />
</exit>
</object>
<object name="foothpath near gz">
<inherit name="editor_room" />
<exit alias="south" to="foothpath">
<inherit name="southdirection" />
</exit>
<exit alias="north" to="gz">
<inherit name="northdirection" />
</exit>
</object>
<object name="gz">
<inherit name="editor_room" />
<exit alias="south" to="foothpath near gz">
<inherit name="southdirection" />
</exit>
</object>
<verb>
<property>look</property>
<pattern>look</pattern>
<defaultexpression>"You can't look " + object.article + "."</defaultexpression>
</verb>
</asl>
Thanks
george
25 Oct 2013, 14:54Looks like the paste of the code might have got cut off -- can you paste in the whole game?
Also, surround your paste with forum code tags -- when you're typing/editing your post they're in the toolbar directly above, along with bold, italic, underline, etc.
Also, surround your paste with forum code tags -- when you're typing/editing your post they're in the toolbar directly above, along with bold, italic, underline, etc.
george
26 Oct 2013, 00:40OK, I see a couple of things you need to add. In your custom go command you check for an immobilized attribute on the player, but that's not set on the player yet. So you can create a new Boolean attribute on the player called immobilized and set it to True.
On your GPS the script currently just prints a message, but you'll want it to print a message AND set the player immobilized attribute to false. You'll also want to rig it up so that every time the player looks at the GPS they don't get that same message -- you can use the noticed attribute for that. And, the first time the player looks at the GPS, you can set the GPS.noticed to true.
There's an alternative way to do the GPS too -- the FirstTime script. http://quest5.net/wiki/Firsttime
On your GPS the script currently just prints a message, but you'll want it to print a message AND set the player immobilized attribute to false. You'll also want to rig it up so that every time the player looks at the GPS they don't get that same message -- you can use the noticed attribute for that. And, the first time the player looks at the GPS, you can set the GPS.noticed to true.
There's an alternative way to do the GPS too -- the FirstTime script. http://quest5.net/wiki/Firsttime
HegemonKhan
26 Oct 2013, 04:39this isn't related to your current question, but it could be helpful.
you can also take a look at my own similiar thread for myself, when I was totally new trying to learn quest, here:
viewtopic.php?f=10&t=3348&hilit=noob+help+thread
you can see my own struggles in trying to learn quest and maybe learn some things from it.
---------------
this is related to your question
A good concept that helps out with noobs learning~developing their coding logic~mentality~thought-process for their brains:
*for Attributes*
"CREATION" and "ACTION"
many people do the "ACTION" (the scripting: run as a script -> add a~new script -> whatever scripts) part for their attributes, but forget that they got to actually then "CREATE" (add) the attributes onto the objects that they're doing the "ACTION" (the scripting) upon.
So, remember that with doing any "ACTION" you need to also do "CREATION", you need to add the attributes to the object, so that those attributes now actually exist, as it's hard to do an action with your attributes, when your attributes don't exist yet.
-----------------
for example:
dragon (Object) -> Verbs (Tab) -> Add ->
Verb Name: fight
Verb Scripting: (see directly below)
in Code it looks like this (if you want me to help you with the GUI~Editor scripting I can help, just let me know ~ ask for help):
if (dragon.dead = true) {
-> msg ("The dragon is already dead, silly")
} else if (dragon.dead = false) {
-> if (dragon_slayer_sword.parent=player) {
->-> msg ("You kill the dragon with your dragon slayer sword")
->-> dragon.dead=true // this script changes the dragon to being "dead"
-> } else {
->-> msg ("the dragon kills you")
->-> msg ("GAME OVER")
->-> finish // this command~script stops~ends the game
-> }
}
we've got a problem though... we've done the "ACTION", the scripting, but NOT the "CREATION" !!!!
ERROR !!!! ...
we're using an attribute (Object.Attribute: dragon.dead) in~for our "ACTION" (the scripting), that we've never "CREATED" yet !
so, to "CREATE" (add) this attribute, we do this:
dragon (Object) -> Attributes (Tab) -> Attributes -> Add ->
Name: dead
Type: boolean
Value: false
in Code, it looks like this:
the "CREATION PART" of the "dragon" Object and its Attributes ("dead")
<object name="dragon">
-> <inherit name="editor_object" />
-> <dead type="boolean">false</dead>
</object>
In Scripting Code, it looks like this:
the "ACTION PART", our "dragon" Object's "fight" Verb's scripting
Object.Attribute=Value_or_Expression
dragon.dead=false // we want our dragon enemy~monster to be alive initially (so that we can then fight and kill it), lol. This is already set though via from the "CREATION PART" above. if we wanted to revive the dead dragon, we'd then use this script.
and then to change it to being dead (after~from fighting it ~ within the "dragon" Object's "fight" Verb's scripting):
dragon.dead=true
-------------------
now, the "dead" boolean attribute exists (our "CREATION" needed part) for the "dragon" Object, and thus now the "ACTION" (the scripting) will work, with no ERROR messaging by quest.
you can also take a look at my own similiar thread for myself, when I was totally new trying to learn quest, here:
viewtopic.php?f=10&t=3348&hilit=noob+help+thread
you can see my own struggles in trying to learn quest and maybe learn some things from it.
---------------
this is related to your question
A good concept that helps out with noobs learning~developing their coding logic~mentality~thought-process for their brains:
*for Attributes*
"CREATION" and "ACTION"
many people do the "ACTION" (the scripting: run as a script -> add a~new script -> whatever scripts) part for their attributes, but forget that they got to actually then "CREATE" (add) the attributes onto the objects that they're doing the "ACTION" (the scripting) upon.
So, remember that with doing any "ACTION" you need to also do "CREATION", you need to add the attributes to the object, so that those attributes now actually exist, as it's hard to do an action with your attributes, when your attributes don't exist yet.
-----------------
for example:
dragon (Object) -> Verbs (Tab) -> Add ->
Verb Name: fight
Verb Scripting: (see directly below)
in Code it looks like this (if you want me to help you with the GUI~Editor scripting I can help, just let me know ~ ask for help):
if (dragon.dead = true) {
-> msg ("The dragon is already dead, silly")
} else if (dragon.dead = false) {
-> if (dragon_slayer_sword.parent=player) {
->-> msg ("You kill the dragon with your dragon slayer sword")
->-> dragon.dead=true // this script changes the dragon to being "dead"
-> } else {
->-> msg ("the dragon kills you")
->-> msg ("GAME OVER")
->-> finish // this command~script stops~ends the game
-> }
}
we've got a problem though... we've done the "ACTION", the scripting, but NOT the "CREATION" !!!!
ERROR !!!! ...
we're using an attribute (Object.Attribute: dragon.dead) in~for our "ACTION" (the scripting), that we've never "CREATED" yet !
so, to "CREATE" (add) this attribute, we do this:
dragon (Object) -> Attributes (Tab) -> Attributes -> Add ->
Name: dead
Type: boolean
Value: false
in Code, it looks like this:
the "CREATION PART" of the "dragon" Object and its Attributes ("dead")
<object name="dragon">
-> <inherit name="editor_object" />
-> <dead type="boolean">false</dead>
</object>
In Scripting Code, it looks like this:
the "ACTION PART", our "dragon" Object's "fight" Verb's scripting
Object.Attribute=Value_or_Expression
dragon.dead=false // we want our dragon enemy~monster to be alive initially (so that we can then fight and kill it), lol. This is already set though via from the "CREATION PART" above. if we wanted to revive the dead dragon, we'd then use this script.
and then to change it to being dead (after~from fighting it ~ within the "dragon" Object's "fight" Verb's scripting):
dragon.dead=true
-------------------
now, the "dead" boolean attribute exists (our "CREATION" needed part) for the "dragon" Object, and thus now the "ACTION" (the scripting) will work, with no ERROR messaging by quest.
JestersMagpie
26 Oct 2013, 23:35Well some good news.
I managed to follow part of Georges message and have added the player immobilised true boolean attribute.
I'm unsure of where to add the AND set the player immobilized attribute to false part. Does that go to the player or the gps and I tried to use GPS.noticed as the attribute and got the error message Invalid attribute name.
I like the first time script, I presume that goes into the code, but where please?
HegemonKhan, I think I see where you're going with "CREATION" and "ACTION" but can't yet understand enough to convert it to fit my attributes.
Thanks for the help though, it's part of my learning process to understand how to get Quest to do what I want it to do, which is what it's all about.
Here's the updated code
Jester
I managed to follow part of Georges message and have added the player immobilised true boolean attribute.
I'm unsure of where to add the AND set the player immobilized attribute to false part. Does that go to the player or the gps and I tried to use GPS.noticed as the attribute and got the error message Invalid attribute name.
I like the first time script, I presume that goes into the code, but where please?
HegemonKhan, I think I see where you're going with "CREATION" and "ACTION" but can't yet understand enough to convert it to fit my attributes.
Thanks for the help though, it's part of my learning process to understand how to get Quest to do what I want it to do, which is what it's all about.
Here's the updated code
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Below Above - Labyrinth">
<gameid>e097b69b-0ff4-4263-8148-7c48bb260466</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<attr name="autodescription_youarein" type="int">0</attr>
<autodisplayverbs type="boolean">false</autodisplayverbs>
</game>
<command name="go_subverted">
<pattern type="string"><![CDATA[^go to (?<exit>.*)$|^go (?<exit>.*)$|^(?<exit>north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]></pattern>
<unresolved>What's telling you to do that?</unresolved>
<script>
if (GetBoolean (player, "immobilised")) {
Print ( player.immobilised = True, player.immobilisedmessage = "What's telling you to do that?", player.immobilised = False)
}
else if (exit.locked) {
msg (exit.lockmessage)
}
else if (HasScript(exit, "script")) {
do (exit, "script")
}
else {
if (exit.lookonly) {
msg ("You can't go there.")
}
else {
player.parent = exit.to
}
}
</script>
</command>
<object name="Cache footpath">
<inherit name="editor_room" />
<description><![CDATA[Whilst out caching one day, you’re starting to get fed up with finding an endless stream of micros and nanos. You traipse through more mud, slipping and sliding towards the next micro. You mutter ‘I wish for a bigger cache!’ <br/>Voices, or is it the wind, mutter, "that’s not the words!" <br/>As if on key, to bring you back to the present you hear a 'bleep']]></description>
<picture>muddy footpath.jpg</picture>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
<immobilized />
</object>
<exit alias="south" to="Cache footpath">
<inherit name="southdirection" />
<lookonly />
<look>The muddy footpath back, very uninviting</look>
</exit>
<object name="gps">
<inherit name="editor_object" />
<alias>garmin, bleep, gps</alias>
<scenery />
<noticed type="boolean">false</noticed>
<look type="script">
OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
</look>
</object>
<exit name="look at gps" alias="north" to="foothpath">
<inherit name="northdirection" />
<scenery />
<locked />
<lockmessage>Why?</lockmessage>
</exit>
</object>
<object name="foothpath">
<inherit name="editor_room" />
<exit alias="north" to="foothpath near gz">
<inherit name="northdirection" />
</exit>
<exit alias="south" to="Cache footpath">
<inherit name="southdirection" />
</exit>
</object>
<object name="foothpath near gz">
<inherit name="editor_room" />
<exit alias="south" to="foothpath">
<inherit name="southdirection" />
</exit>
<exit alias="north" to="gz">
<inherit name="northdirection" />
</exit>
</object>
<object name="gz">
<inherit name="editor_room" />
<exit alias="south" to="foothpath near gz">
<inherit name="southdirection" />
</exit>
</object>
<verb>
<property>look</property>
<pattern>look</pattern>
<defaultexpression>"You can't look " + object.article + "."</defaultexpression>
</verb>
</asl>
Jester
HegemonKhan
27 Oct 2013, 06:00the Elements of Quest:
Objects:
In GUI~Editor:
self apparent~explanatory:
"game file object" (the "ROOT" Object) -> Objects (Tab) -> Add -> (create your Object)
"game" (Object) -> (can't create Objects inside of the special: Game Object)
"room" (Object) -> Objects (Tab) -> Add -> (create your Object)
"player" (Object) -> Objects (Tab) -> Add -> (create your Object)
Default New Game Objects: "game file object", "game", "room", and "player"
In-Code:
<asl version="540">
</asl>
<game name="blah">
</game>
<object name="room">
</object>
<object name="player">
</object>
The "game" Object is a special Object, it's thee: Game Object.
the format you see above are called tags for where the Object begins and ends:
Object Beginning:
<asl version="540">
<game name="blah">
<object name="room">
<object name="player">
Object Ending:
</asl>
</game>
</object>
</object>
so these "tags" are our "CREATION" coding, the tags is how we "CREATE" (ADD) Objects to our game in Code.
The use of "Objects" is known as "Object-Oriented Programming", which is much easier to understand than the older programming system with arrays and etc complicated stuff.
By using these "Object tags", we can easily "nest" (put) Objects inside of Objects, as many layers deep as we want:
In GUI~Editor:
"Nesting" ("Indenting" or "Parent'ing<->Child'ing"): ie just like a folder~directory tree organization
".aslx game file" (Object)
-> "game" (Object) -> Objects (Tab) -> Add -> "room" (Object)
-> "room" (Object) -> Objects (Tab) -> Add -> "player" (Object)
->-> "player" (Object) -> Objects (Tab) -> Add -> "pants_with_pockets" (Object)
->->-> "pants_with_pockets" (Object) -> Objects (Tab) -> Add -> "wallet" (Object)
->->->-> "wallet" (Object) -> Objects (Tab) -> Add -> "one_dollar_bill" (Object)
->->->->-> "one_dollar_bill" (Object)
the ".aslx game file" Object is the "Root", because it contains (holds) ALL of the other Objects.
the ".aslx game file" Object is also the Direct "Parent" Object of the "game" and "room" Objects.
the ".aslx game file" Object is the Indirect "Parent" Object of the "player, pants, wallet, 1 dollar" Objects.
the "game" and "room" Objects are the Direct "Child" Object of the ".aslx game file" Object.
the "one_dollar_bill" is an Indirect "Child" Object of the "room" Object.
just like on your computer with its folders ("directories"):
C drive (the "ROOT")
-> programs
->-> quest
->->-> quest.exe file
->->-> core.aslx quest default library file (all the built-in code by Alex that enables quest to work and the coding already available for you to use to create your own coding~game: ie "take", "functions", "objects", "exits", the GUI~Editor "tab" scripting~coding, and etc)
->->-> english.aslx quest default library file (the language of the text displayed is as english)
->->-> your game (.aslx) file
->->-> your library (.aslx) file
anyways...
In Code:
A Game File (.aslx):
<asl version="540">
-> <game name="blah">
-> </game>
-> <object name="room">
->-> <object name="player">
->-> </object>
-> </object>
</asl>
A Library File (.aslx):
<library>
</library>
However, Objects, aren't the only things that use the "tags":
<function name="blah">
</function>
<command name="blah">
</command>
<turnscript name="blah">
</turnscript>
<timer name="blah">
</timer>
<verb name="blah">
</verb>
<type name="blah">
</type>
and etc
recognizing any of these things now? in the GUI~Editor? In Code?
Attributes:
(using an european person as an example)
Attribute: "white_skin"
okay... but "white_skin"... OF WHAT ???
an Attribute MUST be "of" ("attached to") an Object
In GUI~Editor (as "CREATION"):
Add Object -> "european"
"european" (Object) -> Attributes (Tab) -> Attributes -> Add ->
Name: skin_color_string
Type: string
Value: white_skin
a built-in Attribute:
Name: alias
Type: string
Value: (left blank~empty)
In Code (as "CREATION"):
<object name="european">
-> <skin_color_string type="string>white_skin</skin_color_string>
-> // or, in a shortened recognized form by quest engine:
-> // <skin_color_string>white_skin</skin_color_string>
-> // or, a built-in attribute (not the "john" Value though, lol):
-> // <alias>john</alias>
</object>
As Scripting (as "ACTION"):
Object.Attribute=Value_or_Expression
european.skin_color_string=white_skin
Object: "european"
Attachment: "."
Attribute: "skin_color_string"
(Type: string)
Value: white_skin
built-in attribute:
european.alias="john" // the quotes *are required* for the Value of String Attributes
Scripting to Output~Effect~Result During Game Play:
(In GUI~Editor: Run as script -> Add a~new script -> Print a message -> Print [EXPRESSION] -> for example, type this in -> european.skin_color_string)
msg (european.skin_color_string) -> white_skin
msg ("You have " + european.skin_color_string +".") -> You have white_skin.
msg (european.alias) -> john
msg (european.alias + " has " + european.skin_color_string +".") -> john has white_skin.
----------------------
the Types of Attributes:
String Attribute:
a string is merely a collection of characters (not all characters are allowed though), for some examples of some Values:
a
4
fbaofn_46neus_joqbm_888_v6v6v6v6v
red
12345
the quotes *are required* for the Value of String Attributes:
human_typing_this_post.alias="HK" // lol ~ hehe
ball.color="red"
security_door_1.passcode="123456"
security_door_2.passcode="qwerty"
security_door_3.passcode="1_q_2_w_3_e_4_r_5_t_6_y"
Integer Attribute:
integer are non-decimal numbers: ... , -100, -1, 0, 1 , 100, ...
HK.strength=100
HK.current_hit_points=999
HK.maximum_hit_points=999
HK.current_mana_points=99
HK.maximum_mana_points=99
HK.carry_weight=100
HK.cash=0 // I'm very poor, boohoo
HK.experience=999999
HK.level=99
Double Attributes:
doubles are merely decimal numbers
HK.physical_damage=900.73
HK.fire_damage=35.1
HK.water_resistance=0.00008
Boolean Attributes:
the Value is either: "true" or "false"
HK.dead=false
HK.is_super_awesome=true
tv.switched_on=false
HK.walking=false
HK.flying=true
HK.likes_playing_computer_games=true
further explanation of booleans, there's many types of combinations (choose whatever works best)
HK.dead=false // HK is "alive"
HK.alive=true // HK is "alive"
HK.dead=true // HK is "dead"
HK.alive=false // HK is "dead"
HK.walking=false // HK is "running"
HK.running=false // HK is "walking"
HK.running=true // HK is "running"
HK.walking=true // HK is "walking"
we have a starting setting or "flagging" (from our "CREATION"):
dragon.dead=false // dragon is "alive"
we can then toggle the effect in our Verbs:
HK kills the dragon: dragon.dead=true // dragon is now "dead"
HK revives the dead dragon: dragon.dead=false // dragon is "alive" again
HK kills the dragon again: dragon.dead=true // dragon is "dead" again
etc...
booleans are paired with "if" conditionals:
in our "tags" we create the Object and its Attributes (or in GUI~Editor: we add the object, and then we add the attributes for that object):
<object name="dragon">
-> <inherit name="editor_object" />
-> // this, the above code line, is shortened by the quest engine, but it's long form is actually this (I think):
-> // <inherit name="editor_object">
->-> // <enabled type="boolean">true</enabled>
-> // </inherit>
-> <dead type="boolean">false</dead>
</object>
In GUI~Editor: in the "fight" Verb (the "ACTION" usage of our attributes, in here we will switch the dragon from being set~flagged as "alive" to being "dead") of the "dragon" Object:
if (dragon.dead=true) {
-> msg ("the dragon is already dead, silly. you can't kill something that is already dead!")
} else if (dragon.dead=false) {
-> msg ("you kill the dragon") // this tells the game player what happened (the dragon is now "dead"), but the quest engine doesn't recognize this as saying that the dragon is now "dead"
-> dragon.dead=true // this tells the quest engine that the dragon is now set~flagged (changed to) as "dead", but it is invisible to the game player
}
In Code:
<object name="dragon">
-> <inherit name="editor_object" />
-> // this, the above code line, is shortened by the quest engine, but it's long form is actually this (I think):
-> // <inherit name="editor_object">
->-> // <enabled type="boolean">true</enabled>
-> // </inherit>
-> <dead type="boolean">false</dead>
-> <fight type="script">
->-> if (dragon.dead=true) {
->->-> msg ("the dragon is already dead, silly. you can't kill something that is already dead!")
->-> } else if (dragon.dead=false) {
->->-> msg ("you kill the dragon") // this tells the game player what happened (the dragon is now "dead"), but the quest engine doesn't recognize this as saying that the dragon is now "dead"
->->-> dragon.dead=true // this tells the quest engine that the dragon is now set~flagged as "dead", but it is invisible to the game player
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
Script Attributes:
(see the "fight" Script Attribute above ~ these are your added Verbs to~of an Object in the GUI~Editor)
List (String and Object) Attributes:
stringlists:
a built-in stringlist: <displayverbs type="simplestringlist">Look at; Take; Give; Use; Drop; Etc</displayverbs>
<gender_type_string_list type="simplestringlist">male;female</gender_type_string_list>
<elemental_type_string_list type="simplestringlist">fire;water;air;earth</elemental_type_string_list>
<class_type_string_list type="simplestringlist">knight;berserker;archer;ranger;thief;mage;cleric</class_string_list>
<travel_list type="simplestringlist">wasteland;grassland;plains;swampland;desert;tundra;hills;forest;mountains</travel_list>
objectlists:
a built-in objectlist: <inventory type="objectlist">spellbook;wooden_sword;hp_potion;mp_potion;shield;etc</inventory>
<sword_types type="objectlist">short_sword;long_sword;claymore;katana;broad_sword;cutlass;scimitar</sword_types>
<fire_spells type="objectlist">fireball;melt;inferno</fire_spells>
Dictionary (String, Object, and Script) Attributes:
these are a bit more complicated... don't worry about dictionaries for now.
Functions:
these are just like the scripting of verbs, except they're more powerful (parameters) and easier to use (especially "looping" ie "call function"), than Script Attributes (which you use in or as your Verbs).
Commands:
Commands enable you to type in something as a game player (during game play) for a function~scripting to act upon. Though they're less noob-friendly, as you got to understand using functions with parameters. Commands are global.
Verbs:
Verbs are actually a sub-type of Commands, allowing you to attach it directly to an Object, and allowing for the creation of the "buttons" and "hypertexts" features during game play. Verbs are local (specifically for that Object).
etc..
getting tired... lol
-----------------------------
let's see if this helped you with the attributes (such as your "immobilize player" boolean attribute) ...
as for your GPS.noticed...
you must have the typing MATCHING EXACTLY, lower and upper case matter:
"gps.noticed" NOT EQUAL~MATCHING TO "GPS.noticed"
you've got two Attributes, and not a single Attribute.
Attribute_1: GPS.noticed
Attribute_2: gps.noticed
hence the ERROR message you're receiving (for example):
<object name="GPS">
-> <noticed type="boolean">false</noticed>
-> <blah type="script">
->-> if (gps.noticed=false) {
->->-> msg ("I don't see anyone")
->-> } else if (gps.noticed=true) {
->->-> msg ("I see you!")
->-> }
-> </blah>
</object>
Quest engine:
I need to find the Object.Attribute "gps.noticed" so I can do the "blah" script... there's a "GPS.noticed" Object.Attribute, but no "gps.noticed" Object.Attribute, can't compute ("what do I do? I need help, my human coder!")... ERROR.... ERROR!
ya.. coding is annoying... typo'es and simple mistakes... don't go well with coding... lol. You must TYPE exactly for it to be correct and to work properly.
quick coding tip:
using uppercase is annoying (having to do shift_key+letter_key and having to remember to do it too, lol), so try to have everything as lower case, unless you absolutely have to use uppercase for a very important reason.
-----------
for the "immobilized" attribute:
you got it correct, but you've got it initially set as "player.immobilized=true":
<immobilized />
is the same as (it's the shortened "understood" form of)
<immobilized type="boolean">true</immobilized>
here's how it'd look in it's long~full form (if the quest engine didn't automatically convert it to it's shortened form):
so if you want it to be initially set as "false", then change it to look like this:
now, as for changing the attribute back and forth:
you do it in scripting (such as in your verbs):
player.immobilized=true
(to toggle back and forth)
player.immobilized=false
here's an example of a working coding (though I'm not using the "immobilized" as you are, as it doesn't prevent you from clicking on the "fight" button again, lol):
initially, let's have it (created, and) set as "false":
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_object" />
-> <immobilized type="boolean">false</immobilized>
</object>
now let's do the scripting (the Verb), where we'll need to change~switch it to being set as "true", for our Verb to work fully:
<object name="assassin">
-> <inherit name="editor_object" />
-> <fight type="script">
->-> // initially, we've got it set as: player.immobilized=false
->-> if (player.immobilized=true) {
->->-> msg ("the assassin, grinning triumphantly, walking up to your paralyzed body, slashes your throat open, killing you")
->->-> msg ("GAME OVER")
->->-> finish
->-> } else if (player.immobilized=false) {
->->-> msg ("the assassin gets to attack first, using a dart gun with a paralyzing substance coated on the dart, you're paralyzed, oh... %@$# !")
->->-> // now, since you've got paralyzed, we need to tell the quest engine that you're now paralyzed too, by changing the boolean attribute to now being set to "true":
->->-> player.immobilized=true
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
we could also have it instead be initially set as true, and obviously create a new verb scripting to work with it. I just choose to go from: "false" to "true", so, I could've just as well gone from "true" to "false", changing up the scripting in the verb to work.
here's some added script lines, to save you from death, and showing you how we can switch it back from "true" to "false" again:
(see if you can spot the added script lines, and see if you can understand how this all works too, hopefully...lol)
<object name="assassin">
-> <inherit name="editor_object" />
-> <fight type="script">
->-> // initially, we've got it set as: player.immobilized=false
->-> if (player.immobilized=true) {
->->-> if (antedote.parent=player) {
->->->-> msg ("just in time, you poke yourself with an antedote coated needle, unseen by the assassin. you pretend to be paralyzed, and as soon as the gloating assassin is next to you, you suddenly jam your dagger into his chest and heart, killing him, instead of him killing you")
->->->-> player.immobilized.false
->->-> } else {
->->->-> msg ("the assassin, grinning triumphantly, walking up to your paralyzed body, slashes your throat open, killing you")
->->->-> msg ("GAME OVER")
->->->-> finish
->->-> }
->-> } else if (player.immobilized=false) {
->->-> msg ("the assassin gets to attack first, using a dart gun with a paralyzing substance coated on the dart, you're paralyzed, oh... %@$# !")
->->-> // now, since you've got paralyzed, we need to tell the quest engine that you're now paralyzed too, by changing the boolean attribute to now being set to "true":
->->-> player.immobilized=true
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
Objects:
In GUI~Editor:
self apparent~explanatory:
"game file object" (the "ROOT" Object) -> Objects (Tab) -> Add -> (create your Object)
"game" (Object) -> (can't create Objects inside of the special: Game Object)
"room" (Object) -> Objects (Tab) -> Add -> (create your Object)
"player" (Object) -> Objects (Tab) -> Add -> (create your Object)
Default New Game Objects: "game file object", "game", "room", and "player"
In-Code:
<asl version="540">
</asl>
<game name="blah">
</game>
<object name="room">
</object>
<object name="player">
</object>
The "game" Object is a special Object, it's thee: Game Object.
the format you see above are called tags for where the Object begins and ends:
Object Beginning:
<asl version="540">
<game name="blah">
<object name="room">
<object name="player">
Object Ending:
</asl>
</game>
</object>
</object>
so these "tags" are our "CREATION" coding, the tags is how we "CREATE" (ADD) Objects to our game in Code.
The use of "Objects" is known as "Object-Oriented Programming", which is much easier to understand than the older programming system with arrays and etc complicated stuff.
By using these "Object tags", we can easily "nest" (put) Objects inside of Objects, as many layers deep as we want:
In GUI~Editor:
"Nesting" ("Indenting" or "Parent'ing<->Child'ing"): ie just like a folder~directory tree organization
".aslx game file" (Object)
-> "game" (Object) -> Objects (Tab) -> Add -> "room" (Object)
-> "room" (Object) -> Objects (Tab) -> Add -> "player" (Object)
->-> "player" (Object) -> Objects (Tab) -> Add -> "pants_with_pockets" (Object)
->->-> "pants_with_pockets" (Object) -> Objects (Tab) -> Add -> "wallet" (Object)
->->->-> "wallet" (Object) -> Objects (Tab) -> Add -> "one_dollar_bill" (Object)
->->->->-> "one_dollar_bill" (Object)
the ".aslx game file" Object is the "Root", because it contains (holds) ALL of the other Objects.
the ".aslx game file" Object is also the Direct "Parent" Object of the "game" and "room" Objects.
the ".aslx game file" Object is the Indirect "Parent" Object of the "player, pants, wallet, 1 dollar" Objects.
the "game" and "room" Objects are the Direct "Child" Object of the ".aslx game file" Object.
the "one_dollar_bill" is an Indirect "Child" Object of the "room" Object.
just like on your computer with its folders ("directories"):
C drive (the "ROOT")
-> programs
->-> quest
->->-> quest.exe file
->->-> core.aslx quest default library file (all the built-in code by Alex that enables quest to work and the coding already available for you to use to create your own coding~game: ie "take", "functions", "objects", "exits", the GUI~Editor "tab" scripting~coding, and etc)
->->-> english.aslx quest default library file (the language of the text displayed is as english)
->->-> your game (.aslx) file
->->-> your library (.aslx) file
anyways...
In Code:
A Game File (.aslx):
<asl version="540">
-> <game name="blah">
-> </game>
-> <object name="room">
->-> <object name="player">
->-> </object>
-> </object>
</asl>
A Library File (.aslx):
<library>
</library>
However, Objects, aren't the only things that use the "tags":
<function name="blah">
</function>
<command name="blah">
</command>
<turnscript name="blah">
</turnscript>
<timer name="blah">
</timer>
<verb name="blah">
</verb>
<type name="blah">
</type>
and etc
recognizing any of these things now? in the GUI~Editor? In Code?
Attributes:
(using an european person as an example)
Attribute: "white_skin"
okay... but "white_skin"... OF WHAT ???
an Attribute MUST be "of" ("attached to") an Object
In GUI~Editor (as "CREATION"):
Add Object -> "european"
"european" (Object) -> Attributes (Tab) -> Attributes -> Add ->
Name: skin_color_string
Type: string
Value: white_skin
a built-in Attribute:
Name: alias
Type: string
Value: (left blank~empty)
In Code (as "CREATION"):
<object name="european">
-> <skin_color_string type="string>white_skin</skin_color_string>
-> // or, in a shortened recognized form by quest engine:
-> // <skin_color_string>white_skin</skin_color_string>
-> // or, a built-in attribute (not the "john" Value though, lol):
-> // <alias>john</alias>
</object>
As Scripting (as "ACTION"):
Object.Attribute=Value_or_Expression
european.skin_color_string=white_skin
Object: "european"
Attachment: "."
Attribute: "skin_color_string"
(Type: string)
Value: white_skin
built-in attribute:
european.alias="john" // the quotes *are required* for the Value of String Attributes
Scripting to Output~Effect~Result During Game Play:
(In GUI~Editor: Run as script -> Add a~new script -> Print a message -> Print [EXPRESSION] -> for example, type this in -> european.skin_color_string)
msg (european.skin_color_string) -> white_skin
msg ("You have " + european.skin_color_string +".") -> You have white_skin.
msg (european.alias) -> john
msg (european.alias + " has " + european.skin_color_string +".") -> john has white_skin.
----------------------
the Types of Attributes:
String Attribute:
a string is merely a collection of characters (not all characters are allowed though), for some examples of some Values:
a
4
fbaofn_46neus_joqbm_888_v6v6v6v6v
red
12345
the quotes *are required* for the Value of String Attributes:
human_typing_this_post.alias="HK" // lol ~ hehe
ball.color="red"
security_door_1.passcode="123456"
security_door_2.passcode="qwerty"
security_door_3.passcode="1_q_2_w_3_e_4_r_5_t_6_y"
Integer Attribute:
integer are non-decimal numbers: ... , -100, -1, 0, 1 , 100, ...
HK.strength=100
HK.current_hit_points=999
HK.maximum_hit_points=999
HK.current_mana_points=99
HK.maximum_mana_points=99
HK.carry_weight=100
HK.cash=0 // I'm very poor, boohoo
HK.experience=999999
HK.level=99
Double Attributes:
doubles are merely decimal numbers
HK.physical_damage=900.73
HK.fire_damage=35.1
HK.water_resistance=0.00008
Boolean Attributes:
the Value is either: "true" or "false"
HK.dead=false
HK.is_super_awesome=true
tv.switched_on=false
HK.walking=false
HK.flying=true
HK.likes_playing_computer_games=true
further explanation of booleans, there's many types of combinations (choose whatever works best)
HK.dead=false // HK is "alive"
HK.alive=true // HK is "alive"
HK.dead=true // HK is "dead"
HK.alive=false // HK is "dead"
HK.walking=false // HK is "running"
HK.running=false // HK is "walking"
HK.running=true // HK is "running"
HK.walking=true // HK is "walking"
we have a starting setting or "flagging" (from our "CREATION"):
dragon.dead=false // dragon is "alive"
we can then toggle the effect in our Verbs:
HK kills the dragon: dragon.dead=true // dragon is now "dead"
HK revives the dead dragon: dragon.dead=false // dragon is "alive" again
HK kills the dragon again: dragon.dead=true // dragon is "dead" again
etc...
booleans are paired with "if" conditionals:
in our "tags" we create the Object and its Attributes (or in GUI~Editor: we add the object, and then we add the attributes for that object):
<object name="dragon">
-> <inherit name="editor_object" />
-> // this, the above code line, is shortened by the quest engine, but it's long form is actually this (I think):
-> // <inherit name="editor_object">
->-> // <enabled type="boolean">true</enabled>
-> // </inherit>
-> <dead type="boolean">false</dead>
</object>
In GUI~Editor: in the "fight" Verb (the "ACTION" usage of our attributes, in here we will switch the dragon from being set~flagged as "alive" to being "dead") of the "dragon" Object:
if (dragon.dead=true) {
-> msg ("the dragon is already dead, silly. you can't kill something that is already dead!")
} else if (dragon.dead=false) {
-> msg ("you kill the dragon") // this tells the game player what happened (the dragon is now "dead"), but the quest engine doesn't recognize this as saying that the dragon is now "dead"
-> dragon.dead=true // this tells the quest engine that the dragon is now set~flagged (changed to) as "dead", but it is invisible to the game player
}
In Code:
<object name="dragon">
-> <inherit name="editor_object" />
-> // this, the above code line, is shortened by the quest engine, but it's long form is actually this (I think):
-> // <inherit name="editor_object">
->-> // <enabled type="boolean">true</enabled>
-> // </inherit>
-> <dead type="boolean">false</dead>
-> <fight type="script">
->-> if (dragon.dead=true) {
->->-> msg ("the dragon is already dead, silly. you can't kill something that is already dead!")
->-> } else if (dragon.dead=false) {
->->-> msg ("you kill the dragon") // this tells the game player what happened (the dragon is now "dead"), but the quest engine doesn't recognize this as saying that the dragon is now "dead"
->->-> dragon.dead=true // this tells the quest engine that the dragon is now set~flagged as "dead", but it is invisible to the game player
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
Script Attributes:
(see the "fight" Script Attribute above ~ these are your added Verbs to~of an Object in the GUI~Editor)
List (String and Object) Attributes:
stringlists:
a built-in stringlist: <displayverbs type="simplestringlist">Look at; Take; Give; Use; Drop; Etc</displayverbs>
<gender_type_string_list type="simplestringlist">male;female</gender_type_string_list>
<elemental_type_string_list type="simplestringlist">fire;water;air;earth</elemental_type_string_list>
<class_type_string_list type="simplestringlist">knight;berserker;archer;ranger;thief;mage;cleric</class_string_list>
<travel_list type="simplestringlist">wasteland;grassland;plains;swampland;desert;tundra;hills;forest;mountains</travel_list>
objectlists:
a built-in objectlist: <inventory type="objectlist">spellbook;wooden_sword;hp_potion;mp_potion;shield;etc</inventory>
<sword_types type="objectlist">short_sword;long_sword;claymore;katana;broad_sword;cutlass;scimitar</sword_types>
<fire_spells type="objectlist">fireball;melt;inferno</fire_spells>
Dictionary (String, Object, and Script) Attributes:
these are a bit more complicated... don't worry about dictionaries for now.
Functions:
these are just like the scripting of verbs, except they're more powerful (parameters) and easier to use (especially "looping" ie "call function"), than Script Attributes (which you use in or as your Verbs).
Commands:
Commands enable you to type in something as a game player (during game play) for a function~scripting to act upon. Though they're less noob-friendly, as you got to understand using functions with parameters. Commands are global.
Verbs:
Verbs are actually a sub-type of Commands, allowing you to attach it directly to an Object, and allowing for the creation of the "buttons" and "hypertexts" features during game play. Verbs are local (specifically for that Object).
etc..
getting tired... lol
-----------------------------
let's see if this helped you with the attributes (such as your "immobilize player" boolean attribute) ...
as for your GPS.noticed...
you must have the typing MATCHING EXACTLY, lower and upper case matter:
"gps.noticed" NOT EQUAL~MATCHING TO "GPS.noticed"
you've got two Attributes, and not a single Attribute.
Attribute_1: GPS.noticed
Attribute_2: gps.noticed
hence the ERROR message you're receiving (for example):
<object name="GPS">
-> <noticed type="boolean">false</noticed>
-> <blah type="script">
->-> if (gps.noticed=false) {
->->-> msg ("I don't see anyone")
->-> } else if (gps.noticed=true) {
->->-> msg ("I see you!")
->-> }
-> </blah>
</object>
Quest engine:
I need to find the Object.Attribute "gps.noticed" so I can do the "blah" script... there's a "GPS.noticed" Object.Attribute, but no "gps.noticed" Object.Attribute, can't compute ("what do I do? I need help, my human coder!")... ERROR.... ERROR!
ya.. coding is annoying... typo'es and simple mistakes... don't go well with coding... lol. You must TYPE exactly for it to be correct and to work properly.
quick coding tip:
using uppercase is annoying (having to do shift_key+letter_key and having to remember to do it too, lol), so try to have everything as lower case, unless you absolutely have to use uppercase for a very important reason.
-----------
for the "immobilized" attribute:
you got it correct, but you've got it initially set as "player.immobilized=true":
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
<immobilized />
</object>
<immobilized />
is the same as (it's the shortened "understood" form of)
<immobilized type="boolean">true</immobilized>
here's how it'd look in it's long~full form (if the quest engine didn't automatically convert it to it's shortened form):
[code]<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
<immobilized type="boolean">true</immobilized>
</object>[/code]
so if you want it to be initially set as "false", then change it to look like this:
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<scenery type="boolean">false</scenery>
<immobilized type="boolean">false</immobilized>
</object>
now, as for changing the attribute back and forth:
you do it in scripting (such as in your verbs):
player.immobilized=true
(to toggle back and forth)
player.immobilized=false
here's an example of a working coding (though I'm not using the "immobilized" as you are, as it doesn't prevent you from clicking on the "fight" button again, lol):
initially, let's have it (created, and) set as "false":
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_object" />
-> <immobilized type="boolean">false</immobilized>
</object>
now let's do the scripting (the Verb), where we'll need to change~switch it to being set as "true", for our Verb to work fully:
<object name="assassin">
-> <inherit name="editor_object" />
-> <fight type="script">
->-> // initially, we've got it set as: player.immobilized=false
->-> if (player.immobilized=true) {
->->-> msg ("the assassin, grinning triumphantly, walking up to your paralyzed body, slashes your throat open, killing you")
->->-> msg ("GAME OVER")
->->-> finish
->-> } else if (player.immobilized=false) {
->->-> msg ("the assassin gets to attack first, using a dart gun with a paralyzing substance coated on the dart, you're paralyzed, oh... %@$# !")
->->-> // now, since you've got paralyzed, we need to tell the quest engine that you're now paralyzed too, by changing the boolean attribute to now being set to "true":
->->-> player.immobilized=true
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
we could also have it instead be initially set as true, and obviously create a new verb scripting to work with it. I just choose to go from: "false" to "true", so, I could've just as well gone from "true" to "false", changing up the scripting in the verb to work.
here's some added script lines, to save you from death, and showing you how we can switch it back from "true" to "false" again:
(see if you can spot the added script lines, and see if you can understand how this all works too, hopefully...lol)
<object name="assassin">
-> <inherit name="editor_object" />
-> <fight type="script">
->-> // initially, we've got it set as: player.immobilized=false
->-> if (player.immobilized=true) {
->->-> if (antedote.parent=player) {
->->->-> msg ("just in time, you poke yourself with an antedote coated needle, unseen by the assassin. you pretend to be paralyzed, and as soon as the gloating assassin is next to you, you suddenly jam your dagger into his chest and heart, killing him, instead of him killing you")
->->->-> player.immobilized.false
->->-> } else {
->->->-> msg ("the assassin, grinning triumphantly, walking up to your paralyzed body, slashes your throat open, killing you")
->->->-> msg ("GAME OVER")
->->->-> finish
->->-> }
->-> } else if (player.immobilized=false) {
->->-> msg ("the assassin gets to attack first, using a dart gun with a paralyzing substance coated on the dart, you're paralyzed, oh... %@$# !")
->->-> // now, since you've got paralyzed, we need to tell the quest engine that you're now paralyzed too, by changing the boolean attribute to now being set to "true":
->->-> player.immobilized=true
->-> }
-> </fight>
-> <displayverbs type="simplestringlist">Fight</displayverbs>
</object>
HegemonKhan
27 Oct 2013, 06:15Err... my bad, I completely forgot to explain this:
<object name="dragon">
-> <dead>false</dead>
</object>
okay, we've got the "dead" attribute set as "false".
then in our "fight" Verb:
<object name="dragon">
-> <dead>false</dead> // this is the ACTUAL "EXISTING~CREATED" Attribute itself
-> <fight type="script">
->-> msg ("you kill the dragon")
->-> dragon.dead=true
-> </fight>
</object>
we've changed the dragon to being "dead", as I've already explained in my previous post, but what I totally forgot to mention is this:
THIS HAPPENS DURING THE ACTUAL GAME PLAY ITSELF, FROM THE GAME PLAYER CLICKING ON THE "FIGHT" BUTTON (OR THE HYPERTEXT):
the "dragon.dead=true" script line in the "fight" Verb, actually CHANGES the "dead" Attribute's Value TO "true", so this is what it now actually looks like (after you click on the "fight" button of the "dragon" Object during game play):
<object name="dragon">
-> <dead>true</dead> // we now (through the Verb's script line) actually changed the Value of the ACTUAL "EXISTING~CREATED" Attribute itself
-> <fight type="script">
->-> msg ("you kill the dragon")
->-> dragon.dead=true
-> </fight>
</object>
and if, I had and did another verb script that has this script line: dragon.dead=false, then it'd again change to look now like this:
<object name="dragon">
-> <dead>false</dead> // we now actually changed (again) (through the Verb's script line) the Value of the ACTUAL "EXISTING~CREATED" Attribute itself
-> <revive type="script">
->-> msg ("the dragon magically revives back to life")
->-> dragon.dead=false
-> </fight>
</object>
<object name="dragon">
-> <dead>false</dead>
</object>
okay, we've got the "dead" attribute set as "false".
then in our "fight" Verb:
<object name="dragon">
-> <dead>false</dead> // this is the ACTUAL "EXISTING~CREATED" Attribute itself
-> <fight type="script">
->-> msg ("you kill the dragon")
->-> dragon.dead=true
-> </fight>
</object>
we've changed the dragon to being "dead", as I've already explained in my previous post, but what I totally forgot to mention is this:
THIS HAPPENS DURING THE ACTUAL GAME PLAY ITSELF, FROM THE GAME PLAYER CLICKING ON THE "FIGHT" BUTTON (OR THE HYPERTEXT):
the "dragon.dead=true" script line in the "fight" Verb, actually CHANGES the "dead" Attribute's Value TO "true", so this is what it now actually looks like (after you click on the "fight" button of the "dragon" Object during game play):
<object name="dragon">
-> <dead>true</dead> // we now (through the Verb's script line) actually changed the Value of the ACTUAL "EXISTING~CREATED" Attribute itself
-> <fight type="script">
->-> msg ("you kill the dragon")
->-> dragon.dead=true
-> </fight>
</object>
and if, I had and did another verb script that has this script line: dragon.dead=false, then it'd again change to look now like this:
<object name="dragon">
-> <dead>false</dead> // we now actually changed (again) (through the Verb's script line) the Value of the ACTUAL "EXISTING~CREATED" Attribute itself
-> <revive type="script">
->-> msg ("the dragon magically revives back to life")
->-> dragon.dead=false
-> </fight>
</object>
HegemonKhan
27 Oct 2013, 06:34your "firsttime" script should go into your Verb. You can do the same things in the GUI~Editor (somewhere, somehow, you can find and choose to do~use the "firsttime" script in~with the GUI~Editor, but I myself am not that familiar with the GUI~Editor, lol. I moved to learning code, as I realized for me I was better at~with the code, than using the GUI~Editor, and my computer is a bit slow, so opening up quest to work in the GUI~Editor, wasn't as quick as typing in coding, lol. I just needed to then learn quest's coding... lol. It's been at least a year I've been at learning quest's coding... lol)
In Code, it looks like this:
<object name="dragon">
-> <fight type="script"> // the beginning of your "fight" Verb
->-> firsttime {
->->-> msg ("the dragon easily overwhelms you, but somehow you're able to escape, barely...")
->-> } otherwise {
->->-> msg ("you return stronger than ever, and easily defeat the dragon, but you let him live to fight another day, actually it is jsut so I don't need to add in more code lines, lol")
->-> }
-> </fight> // the ending of your "fight" Verb
-> <displayverbs type="simplestringlist">Fight</displayverbs> // this creates the button and hypertext for your "fight" Verb during actual game play for your game player to be able to click on to activate~execute the "fight" Verb
</object>
(you don't need, nor can you have lol, the "if" before the "firsttime" and nor the "otherwise", it is an easy mistake to make)
so, the first time you click on the "fight" button (or the hypertext) during game play, you get the message:
the dragon easily overwhelms you, but somehow you're able to escape, barely...
but the next time (and all subsequent times, based on this very simplistic example of mine), you get the message:
you return stronger than ever, and easily defeat the dragon, but you let him live to fight another day, actually it is jsut so I don't need to add in more code lines, lol
In Code, it looks like this:
<object name="dragon">
-> <fight type="script"> // the beginning of your "fight" Verb
->-> firsttime {
->->-> msg ("the dragon easily overwhelms you, but somehow you're able to escape, barely...")
->-> } otherwise {
->->-> msg ("you return stronger than ever, and easily defeat the dragon, but you let him live to fight another day, actually it is jsut so I don't need to add in more code lines, lol")
->-> }
-> </fight> // the ending of your "fight" Verb
-> <displayverbs type="simplestringlist">Fight</displayverbs> // this creates the button and hypertext for your "fight" Verb during actual game play for your game player to be able to click on to activate~execute the "fight" Verb
</object>
(you don't need, nor can you have lol, the "if" before the "firsttime" and nor the "otherwise", it is an easy mistake to make)
so, the first time you click on the "fight" button (or the hypertext) during game play, you get the message:
the dragon easily overwhelms you, but somehow you're able to escape, barely...
but the next time (and all subsequent times, based on this very simplistic example of mine), you get the message:
you return stronger than ever, and easily defeat the dragon, but you let him live to fight another day, actually it is jsut so I don't need to add in more code lines, lol
JestersMagpie
27 Oct 2013, 10:31WOW thats a lot of info.
I should have mentioned I write all the geocache pages in HTML and I have done some CSS studies for web pages, so I can understand a lot but boolean attributes don't normally come into standard web design, well not the pages I've done anyway lol.
I'll spend some time digesting that lot and see how I get on. Thanks for the time and effort it took to put that all together.
I should have mentioned I write all the geocache pages in HTML and I have done some CSS studies for web pages, so I can understand a lot but boolean attributes don't normally come into standard web design, well not the pages I've done anyway lol.
I'll spend some time digesting that lot and see how I get on. Thanks for the time and effort it took to put that all together.
HegemonKhan
27 Oct 2013, 11:19maybe this will make more sense for you:
think of a boolean as binary (0 or 1), but instead replace the "0 and 1" with "false or true"
binary:
creation and initially set (or "flag") as: <tv type="int">0</tv>
then, you push the power button on the tv remote control, so now it's change (via the script for the tv remote) from "0" to "1", changed (setted or "flagged") now as:
<tv type="int">1</tv>
if (tv.integer_value=0) {
-> // the tv is turned "off"
} else if (tv.integer_value=1) {
-> // the tv is turned "on"
}
it's the exact same concept~model, except instead of it being of "Type: int~integer" and using "0 or 1", it's of "Type: boolean" and using "false or true":
Boolean ("Flag"):
creation and initially set (or "flag") as: <tv type="boolean">false</tv>
then, you push the power button on the tv remote control, so now it's change (via the script for the tv remote) from "false" to "true", changed (setted or "flagged") now as:
<tv type="boolean">true</tv>
if (tv.specific_string_value=false) {
-> // the tv is turned "off"
} else if (tv.specific_string_value=true) {
-> // the tv is turned "on"
think of a boolean as binary (0 or 1), but instead replace the "0 and 1" with "false or true"
binary:
creation and initially set (or "flag") as: <tv type="int">0</tv>
then, you push the power button on the tv remote control, so now it's change (via the script for the tv remote) from "0" to "1", changed (setted or "flagged") now as:
<tv type="int">1</tv>
if (tv.integer_value=0) {
-> // the tv is turned "off"
} else if (tv.integer_value=1) {
-> // the tv is turned "on"
}
it's the exact same concept~model, except instead of it being of "Type: int~integer" and using "0 or 1", it's of "Type: boolean" and using "false or true":
Boolean ("Flag"):
creation and initially set (or "flag") as: <tv type="boolean">false</tv>
then, you push the power button on the tv remote control, so now it's change (via the script for the tv remote) from "false" to "true", changed (setted or "flagged") now as:
<tv type="boolean">true</tv>
if (tv.specific_string_value=false) {
-> // the tv is turned "off"
} else if (tv.specific_string_value=true) {
-> // the tv is turned "on"
JestersMagpie
28 Oct 2013, 09:42I think I've understood a lot of what's been posted, certainly boolean.
However I'm still having problems. When I was trying to set the attribute for GPS.noticed and getting the error message I did try gps.noticed and still got the same message. Thinking about this yesterday I have set a boolean for look at gps but does Quest understand that look at causes the gps to be noticed, should I somehow tell it, or change the noticed to look_at_gps?
It's still a matter of learning who or what to attach the boolean to, game, player, gps etc but I'm beginning to understand I think.
Once I get this sorted I'm sure I'll make some progress but it won't be long before I ask more questions.
Thanks
However I'm still having problems. When I was trying to set the attribute for GPS.noticed and getting the error message I did try gps.noticed and still got the same message. Thinking about this yesterday I have set a boolean for look at gps but does Quest understand that look at causes the gps to be noticed, should I somehow tell it, or change the noticed to look_at_gps?
It's still a matter of learning who or what to attach the boolean to, game, player, gps etc but I'm beginning to understand I think.
Once I get this sorted I'm sure I'll make some progress but it won't be long before I ask more questions.
Thanks
george
28 Oct 2013, 15:58JestersMagpie wrote:When I was trying to set the attribute for GPS.noticed and getting the error message I did try gps.noticed and still got the same message. Thinking about this yesterday I have set a boolean for look at gps but does Quest understand that look at causes the gps to be noticed, should I somehow tell it, or change the noticed to look_at_gps?
Looking at your most recent code here, viewtopic.php?f=10&t=3983&sid=9af648266bcb988f2a05b9cde73cafce#p26738 , no, Quest does not know that look at causes the GPS to be noticed. Currently in the look script for the GPS it prints a message, but doesn't affect the noticed attribute.
JestersMagpie
28 Oct 2013, 23:01Well I was right on that, but no closer to getting an answer to the problem.
I knew this wouldn't be easy, but I didn't realise it would be this hard for me to understand. I'm beginning to think there must be an other way to do this!
I knew this wouldn't be easy, but I didn't realise it would be this hard for me to understand. I'm beginning to think there must be an other way to do this!
HegemonKhan
29 Oct 2013, 00:21I'm not sure what you want to do exactly, if you could explain more, than I could help you do precisely what you want.
--------------------
though, I can offer this for you....
here's your code (part) here:
do you want the "gps.look" (Object Name~ID: "gps", Attribute Name~ID: "look", Connector: ".") Script Attribute to change the "gps.noticed=false" (Object Name~ID: "gps", Attribute Name~ID: "noticed", Connector: ".", Operator: "=", and Value_or_Expression: "false") Boolean Attribute to "true" ???
if so, then that's easy, see here:
or, do you want the "gps.noticed=false" to be changed from the "look at gps" Exit, seen below:
for the Exit, you'd need to add a Script, so you can put the "gps.noticed=true" into it.
------------------
a generic boolean (such a game objective flag: dragon_slayed_quest_completed=false_or_true) can be attached to any Object.
however, a boolean specific to an Object, is attached to that Object (Obviously).
for example:
Attribute: strength
if I want the "strength" to be HK's strength, then obviously I have to add the "strength" Attribute to the "HK" Object:
<object name="HK"
-> <ineherit name="editor_object" />
-> <strength type="int">100</strength
</object>
and then I can change it in scripting (such as a Verb):
(oops, I'm using an Integer Attribute and not a Boolean Attribute, but it doesn't matter, it's the same method either way, just change it, in the Object and in the Scripting, to the proper syntax for a Boolean Attribute, lol)
if (a_50_strength_reducing_potion_is_used_on_HK_by_the_dragon) {
-> HK.strength = HK.strength - 50
}
because, there's a difference between whether you want to change "HK's strength" and "dragon's strength", lol.
<object name="dragon"
-> <ineherit name="editor_object" />
-> <strength type="int">75</strength
</object>
and then I can change it in scripting (such as a Verb):
(oops, I'm using an Integer Attribute and not a Boolean Attribute, but it doesn't matter, it's the same method either way, just change it, in the Object and in the Scripting, to the proper syntax for a Boolean Attribute, lol)
if (a_50_strength_reducing_potion_is_used_by_HK_on_the_dragon) {
-> dragon.strength = dragon.strength - 50
}
hopefully, this should now make sense...
-----------------
within any Scripting (such as a Verb):
you can use any Attribute (because it's an Attribute of some Object), you don't need to use an Attribute of the same Object as that of your Verb-Scripting. A clear example of this is in a "fight" Verb on a monster~enemy Object, as you have script that changes the player's HP when you're damaged in the "fight" Verb-Script, even though that the "fight" Verb-Script belongs to the monster~enemy Object. Though... see below, or read this: you got to CREATE~ADD the "HP" attribute to the "player" Object, to be able to alter it, obviously
HOWEVER, you must CREATE (ADD) the Attributes to the Object, so that it EXISTS, for your Scripting to then alter it's setting.
--------------------
though, I can offer this for you....
here's your code (part) here:
<object name="gps">
<inherit name="editor_object" />
<alias>garmin, bleep, gps</alias>
<scenery />
<noticed type="boolean">false</noticed>
<look type="script">
OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
</look>
</object>
do you want the "gps.look" (Object Name~ID: "gps", Attribute Name~ID: "look", Connector: ".") Script Attribute to change the "gps.noticed=false" (Object Name~ID: "gps", Attribute Name~ID: "noticed", Connector: ".", Operator: "=", and Value_or_Expression: "false") Boolean Attribute to "true" ???
if so, then that's easy, see here:
<object name="gps">
<inherit name="editor_object" />
<alias>garmin, bleep, gps</alias>
<scenery />
<noticed type="boolean">false</noticed>
<look type="script">
OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
gps.noticed=true
</look>
</object>
or, do you want the "gps.noticed=false" to be changed from the "look at gps" Exit, seen below:
<exit name="look at gps" alias="north" to="foothpath">
<inherit name="northdirection" />
<scenery />
<locked />
<lockmessage>Why?</lockmessage>
</exit>
for the Exit, you'd need to add a Script, so you can put the "gps.noticed=true" into it.
------------------
a generic boolean (such a game objective flag: dragon_slayed_quest_completed=false_or_true) can be attached to any Object.
however, a boolean specific to an Object, is attached to that Object (Obviously).
for example:
Attribute: strength
if I want the "strength" to be HK's strength, then obviously I have to add the "strength" Attribute to the "HK" Object:
<object name="HK"
-> <ineherit name="editor_object" />
-> <strength type="int">100</strength
</object>
and then I can change it in scripting (such as a Verb):
(oops, I'm using an Integer Attribute and not a Boolean Attribute, but it doesn't matter, it's the same method either way, just change it, in the Object and in the Scripting, to the proper syntax for a Boolean Attribute, lol)
if (a_50_strength_reducing_potion_is_used_on_HK_by_the_dragon) {
-> HK.strength = HK.strength - 50
}
because, there's a difference between whether you want to change "HK's strength" and "dragon's strength", lol.
<object name="dragon"
-> <ineherit name="editor_object" />
-> <strength type="int">75</strength
</object>
and then I can change it in scripting (such as a Verb):
(oops, I'm using an Integer Attribute and not a Boolean Attribute, but it doesn't matter, it's the same method either way, just change it, in the Object and in the Scripting, to the proper syntax for a Boolean Attribute, lol)
if (a_50_strength_reducing_potion_is_used_by_HK_on_the_dragon) {
-> dragon.strength = dragon.strength - 50
}
hopefully, this should now make sense...
-----------------
within any Scripting (such as a Verb):
you can use any Attribute (because it's an Attribute of some Object), you don't need to use an Attribute of the same Object as that of your Verb-Scripting. A clear example of this is in a "fight" Verb on a monster~enemy Object, as you have script that changes the player's HP when you're damaged in the "fight" Verb-Script, even though that the "fight" Verb-Script belongs to the monster~enemy Object. Though... see below, or read this: you got to CREATE~ADD the "HP" attribute to the "player" Object, to be able to alter it, obviously
HOWEVER, you must CREATE (ADD) the Attributes to the Object, so that it EXISTS, for your Scripting to then alter it's setting.
HegemonKhan
29 Oct 2013, 01:23HK Edited: version 2
here, this is my best effort at explaining attributes, especially booleans, so if this doesn't help you, then I'm unable to to explain this clearly to you, lol:
just type in something and press enter, do repeatedly, see how the Boolean Attributes and the Int (Integer) Attributes are being changed? Now look at it in Code (and~or in the GUI~Editor), to see how it works.
-----------------------
P.S.
to change your Attributes' Values or Expressions (Object.Attributes=Value_or_Expression), you can use any Scripting Block (Verbs~Scripts, Commands, Functions, and Turnscripts). I just used Turnscripts to "automate" the showing of the attributes being changed for you, so you don't have to do anything except to type in something and hit enter to advance the game's turns.
if you want (or need) to see a Verb and~or a Command in action, then let me know, and I'll add it into this testing game file and upload it again in a new post, for you to download, or to copy and paste the code into your own new game file.
Or you can do it yourself, just create (add) some Object to the game (name the Object whatever you want), create (add) a Verb for that Object (name the Verb whatever you want), copy and paste my Turnscript's entire script block into (and for) your Verb's script block, create (add) the "displayverbs" Stringlist Attribute ( http://quest5.net/wiki/Displayverbs ) to your Object (so that you create the button and the hypertext for that Object's Verb), and lastly, delete~remove my entire Turnscript. Now, you'll have to click on the Object's button or hypertext, instead of it being automated for you, and it should work (do the exact same thing as) just like my Turnscript does~did.
here, this is my best effort at explaining attributes, especially booleans, so if this doesn't help you, then I'm unable to to explain this clearly to you, lol:
just type in something and press enter, do repeatedly, see how the Boolean Attributes and the Int (Integer) Attributes are being changed? Now look at it in Code (and~or in the GUI~Editor), to see how it works.
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<game_is_paused type="boolean">false</game_is_paused>
<game_turns type="int">0</game_turns>
<point_score type="int">0</point_score>
<statusattributes type="simplestringdictionary">game_turns =;game_is_paused =;point_score =</statusattributes>
<start type="script">
msg ("NOTE: Type in something in the command box and hit enter on each turn, to see the attributes being changed.")
msg ("")
</start>
</game>
<function name="show_attributes_function">
msg ("")
msg ("Player's Attributes:")
msg ("")
msg ("Flying: " + player.flying)
msg ("Player Turns: " + player.player_turns)
msg ("")
msg ("Game's Attributes:")
msg ("")
msg ("Game Is Paused: " + game.game_is_paused)
msg ("Game Turns: " + game.game_turns)
msg ("Point Score: " + game.point_score)
msg ("")
msg ("Global Data Object's Attributes:")
msg ("")
msg ("Dragon Slayer Sword Acquired: " + global_data_object.dragon_slayer_sword_acquired)
msg ("Dragon Killed: " + global_data_object.dragon_killed)
msg ("Princess Rescued: " + global_data_object.princess_rescued)
msg ("")
msg ("Turnscript's Scripting Steps's Changed Attributes' Results:")
msg ("")
</function>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<flying type="boolean">false</flying>
<player_turns type="int">0</player_turns>
<statusattributes type="simplestringdictionary">player_turns =;flying =</statusattributes>
</object>
</object>
<object name="global_data_object">
<inherit name="editor_object" />
<dragon_killed type="boolean">false</dragon_killed>
<princess_rescued type="boolean">false</princess_rescued>
<dragon_slayer_sword_acquired type="boolean">false</dragon_slayer_sword_acquired>
</object>
<turnscript name="global_events_turnscript">
<enabled />
<script>
show_attributes_function
if (player.flying=false) {
player.flying=true
} else if (player.flying=true) {
player.flying=false
}
if (game.game_is_paused=false) {
game.game_is_paused=true
} else if (game.game_is_paused=true) {
game.game_is_paused=false
}
if (global_data_object.dragon_slayer_sword_acquired=false) {
global_data_object.dragon_slayer_sword_acquired=true
game.point_score = game.point_score + 50
msg ("dragon_slayer_sword_acquired: " + global_data_object.dragon_slayer_sword_acquired)
msg ("Point Score: " + game.point_score)
if (global_data_object.princess_rescued=true) {
global_data_object.princess_rescued=false
msg ("Princess Rescued: " + global_data_object.princess_rescued)
}
}
if (global_data_object.dragon_slayer_sword_acquired=true) {
global_data_object.dragon_killed=true
game.point_score = game.point_score + 250
global_data_object.dragon_slayer_sword_acquired=false
msg ("Dragon Killed: " + global_data_object.dragon_killed)
msg ("Point Score: " + game.point_score)
msg ("dragon_slayer_sword_acquired: " + global_data_object.dragon_slayer_sword_acquired)
}
if (global_data_object.dragon_killed=true) {
global_data_object.princess_rescued=true
game.point_score = game.point_score + 400
global_data_object.dragon_killed=false
msg ("Princess Rescued: " + global_data_object.princess_rescued)
msg ("Point Score: " + game.point_score)
msg ("Dragon Killed: " + global_data_object.dragon_killed)
}
game.game_turns = game.game_turns + 1
player.player_turns = player.player_turns + 5
</script>
</turnscript>
</asl>
-----------------------
P.S.
to change your Attributes' Values or Expressions (Object.Attributes=Value_or_Expression), you can use any Scripting Block (Verbs~Scripts, Commands, Functions, and Turnscripts). I just used Turnscripts to "automate" the showing of the attributes being changed for you, so you don't have to do anything except to type in something and hit enter to advance the game's turns.
if you want (or need) to see a Verb and~or a Command in action, then let me know, and I'll add it into this testing game file and upload it again in a new post, for you to download, or to copy and paste the code into your own new game file.
Or you can do it yourself, just create (add) some Object to the game (name the Object whatever you want), create (add) a Verb for that Object (name the Verb whatever you want), copy and paste my Turnscript's entire script block into (and for) your Verb's script block, create (add) the "displayverbs" Stringlist Attribute ( http://quest5.net/wiki/Displayverbs ) to your Object (so that you create the button and the hypertext for that Object's Verb), and lastly, delete~remove my entire Turnscript. Now, you'll have to click on the Object's button or hypertext, instead of it being automated for you, and it should work (do the exact same thing as) just like my Turnscript does~did.
JestersMagpie
29 Oct 2013, 21:00HegemonKhan I've messaged you, did you receive it?
HegemonKhan
30 Oct 2013, 02:18yes, I've got your message (I'm on west coast~pacific ocean~ U.S., so I think our times are different, are you a european in europe, or you in the U.S.?), and my apologies for not making it clear what would help me, I needed more in regards to the coding, what Scripts (Verbs) and~or Objects do you want to do what? (I't hard for me to jump into someone else's code, and understand what they're trying to do with it and how they want it to be done).
I'm looking over your code, and your "game direction" pm to me, but it may take me some time (and I'm busy with school work ~ I probably won't be able to take a real good look at this until the weekend), so maybe you might want to see if you can get others to help you (unless you don't mind waiting on me to try to help you when I can), in the meantime.
------------------
Also, you may want to take a look (go through it) at the tutorial ( http://quest5.net/wiki/Tutorial ), even if you might understand it already, I think it'd help a bit with understanding and working with the quest's code structure and design.
I've had no coding knowledge at all, my only and sole coding experience has been wtih quest itself, learning it's coding for at least a year now (and a little branching into a computer's basic command prompt~line pseudo-"coding", lol), but I know enough to know that it's very hard to transition between programming languages, and I'm sure HTTP and webpage is very different, than quest, a text adventure game software special kit programming that Alex made for it.
-----------------
by the way... is this what you want? :
or, is this what you want? :
(you still need a script where ever ~ however, to change the "gps.noticed=false" to "gps.noticed=true")
or, do you want something completely else?
--------
let me ask this, to help myself out:
what makes you immobilized (can't move) and what makes you mobilized (able to move) ????
what is the "gps.noticed" attribute used for doing (what do you want this to do or cause for you) ????
---------
P.S.
did my "attribute help" file (in my previous post) help you understand booleans and attributes any better, or did it confuse you even more ???
I'm looking over your code, and your "game direction" pm to me, but it may take me some time (and I'm busy with school work ~ I probably won't be able to take a real good look at this until the weekend), so maybe you might want to see if you can get others to help you (unless you don't mind waiting on me to try to help you when I can), in the meantime.
------------------
Also, you may want to take a look (go through it) at the tutorial ( http://quest5.net/wiki/Tutorial ), even if you might understand it already, I think it'd help a bit with understanding and working with the quest's code structure and design.
I've had no coding knowledge at all, my only and sole coding experience has been wtih quest itself, learning it's coding for at least a year now (and a little branching into a computer's basic command prompt~line pseudo-"coding", lol), but I know enough to know that it's very hard to transition between programming languages, and I'm sure HTTP and webpage is very different, than quest, a text adventure game software special kit programming that Alex made for it.
-----------------
by the way... is this what you want? :
<object name="gps">
<inherit name="editor_object" />
<alias>garmin, bleep, gps</alias>
<scenery />
<noticed type="boolean">false</noticed>
<look type="script">
OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
gps.noticed=true // and~or: player.immobilized=false
</look>
</object>
or, is this what you want? :
(you still need a script where ever ~ however, to change the "gps.noticed=false" to "gps.noticed=true")
<object name="gps">
<inherit name="editor_object" />
<alias>garmin, bleep, gps</alias>
<scenery />
<noticed type="boolean">false</noticed>
<look type="script">
if (gps.noticed=true) {
OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
player.immobilized=false
}
</look>
</object>
or, do you want something completely else?
--------
let me ask this, to help myself out:
what makes you immobilized (can't move) and what makes you mobilized (able to move) ????
what is the "gps.noticed" attribute used for doing (what do you want this to do or cause for you) ????
---------
P.S.
did my "attribute help" file (in my previous post) help you understand booleans and attributes any better, or did it confuse you even more ???
george
30 Oct 2013, 05:03HK, I can help a bit here. This question is based on Jesters earlier thread. I actually suggested the gps.noticed attribute, because Jesters wanted the player to be immobilized until they looked at the GPS. So looking at the GPS would set immobilized to false. But, you'd probably want the normal look the second time, hence the noticed attribute.
However a FirstTime script might make more sense here in the end.
However a FirstTime script might make more sense here in the end.
HegemonKhan
30 Oct 2013, 07:29ah, now I get that! (those were the directions I was seeking!, lol):
(and yep, those directions would indeed use the "firsttime" script)
<object name="player">
-> <inherit name="editor_player" />
-> <inherit name="editor_object" />
-> <immobilized type="boolean">true</immobilized>
</object>
<object name="gps">
-> <inherit name="editor_object" />
-> <alias>garmin, bleep, gps</alias>
-> <scenery />
-> <look type="script">
->-> firsttime {
->->-> OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
->->-> player.immobilized=false
->-> } otherwise {
->->-> // do you want anything here?
->-> }
-> </look>
</object>
in your Exit (or in a "door.locked" Object), you'd have some kind of script, that has this:
data_object.old_room=player.parent
if (player.immobilized=false) {
-> msg ("you walk towards your next destination")
-> player.parent=room_2
-> data_object.old_room=player.parent
} else if (player.immobilized=true) {
-> player.parent=data_object.old_room
}
<object name="room_2">
-> <inherit name="editor_room" />
</object>
<object name="data_object">
-> <inherit name="editor_object" />
-> <old_room type="object">room</old_room> // or: <old_room type="string"></old_room>
</object>
----------------------
do you also want the gps to be hidden (gps.noticed=false ~or~ <scenery /> ~or~ http://quest5.net/wiki/MakeObjectInvisible ) at first,and then revealed (gps.noticed=true ~or~ just "visible": http://quest5.net/wiki/MakeObjectVisible ) by some other script ???
http://quest5.net/wiki/MakeObjectInvisible
http://quest5.net/wiki/MakeObjectVisible
http://quest5.net/wiki/MakeExitInvisible
http://quest5.net/wiki/MakeExitVisible
http://quest5.net/wiki/Interacting_with_objects (scroll down to "scenery")
http://quest5.net/wiki/Scenery
and all the variations of ScopeVisible
------------------
another way to implement "hidden~invisible" and "reveal~visible" is through the Light~Dark features (scripts, attributes, and etc).
http://quest5.net/wiki/SetDark
http://quest5.net/wiki/SetLight
http://quest5.net/wiki/SetObjectLightstrength
http://quest5.net/wiki/SetExitLightstrength
http://quest5.net/wiki/CheckDarkness
http://quest5.net/wiki/Lightstrength
---------------
here's a testing travel code game file:
Type in: help
Type in: explore
Type in: travel
you could implement your "gps.look" with my "area_discovored's explore" and "travel" scripting~coding system~structure. I could help you, and probably George can help you too, if you wanna use this coding of mine.
(and yep, those directions would indeed use the "firsttime" script)
<object name="player">
-> <inherit name="editor_player" />
-> <inherit name="editor_object" />
-> <immobilized type="boolean">true</immobilized>
</object>
<object name="gps">
-> <inherit name="editor_object" />
-> <alias>garmin, bleep, gps</alias>
-> <scenery />
-> <look type="script">
->-> firsttime {
->->-> OutputTextNoBr ("your gps, showing an arrow pointing north and numbers")
->->-> player.immobilized=false
->-> } otherwise {
->->-> // do you want anything here?
->-> }
-> </look>
</object>
in your Exit (or in a "door.locked" Object), you'd have some kind of script, that has this:
data_object.old_room=player.parent
if (player.immobilized=false) {
-> msg ("you walk towards your next destination")
-> player.parent=room_2
-> data_object.old_room=player.parent
} else if (player.immobilized=true) {
-> player.parent=data_object.old_room
}
<object name="room_2">
-> <inherit name="editor_room" />
</object>
<object name="data_object">
-> <inherit name="editor_object" />
-> <old_room type="object">room</old_room> // or: <old_room type="string"></old_room>
</object>
----------------------
do you also want the gps to be hidden (gps.noticed=false ~or~ <scenery /> ~or~ http://quest5.net/wiki/MakeObjectInvisible ) at first,and then revealed (gps.noticed=true ~or~ just "visible": http://quest5.net/wiki/MakeObjectVisible ) by some other script ???
http://quest5.net/wiki/MakeObjectInvisible
http://quest5.net/wiki/MakeObjectVisible
http://quest5.net/wiki/MakeExitInvisible
http://quest5.net/wiki/MakeExitVisible
http://quest5.net/wiki/Interacting_with_objects (scroll down to "scenery")
http://quest5.net/wiki/Scenery
and all the variations of ScopeVisible
------------------
another way to implement "hidden~invisible" and "reveal~visible" is through the Light~Dark features (scripts, attributes, and etc).
http://quest5.net/wiki/SetDark
http://quest5.net/wiki/SetLight
http://quest5.net/wiki/SetObjectLightstrength
http://quest5.net/wiki/SetExitLightstrength
http://quest5.net/wiki/CheckDarkness
http://quest5.net/wiki/Lightstrength
---------------
here's a testing travel code game file:
Type in: help
Type in: explore
Type in: travel
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>eef801a1-4e6b-4b0a-bdbf-8f3ecfa8389c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<turns type="int">0</turns>
<statusattributes type="simplestringdictionary">turns=</statusattributes>
</game>
<object name="homeland">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="grassland">
<inherit name="editor_room" />
</object>
<object name="plains">
<inherit name="editor_room" />
</object>
<object name="desert">
<inherit name="editor_room" />
</object>
<object name="tundra">
<inherit name="editor_room" />
</object>
<object name="swampland">
<inherit name="editor_room" />
</object>
<object name="mountains">
<inherit name="editor_room" />
</object>
<object name="forest">
<inherit name="editor_room" />
</object>
<object name="wasteland">
<inherit name="editor_room" />
</object>
<object name="coastland">
<inherit name="editor_room" />
</object>
<object name="hills">
<inherit name="editor_room" />
</object>
<command name="help_command">
<pattern>help</pattern>
<script>
help_function
</script>
</command>
<command name="explore_command">
<pattern>explore</pattern>
<script>
explore_function
</script>
</command>
<command name="travel_command">
<pattern>travel</pattern>
<script>
travel_function
</script>
</command>
<object name="data_object">
<inherit name="editor_object" />
<travel_string_list type="simplestringlist">homeland</travel_string_list>
<homeland_events_string_list type="simplestringlist">grassland_discovery;plains_discovery;desert_discovery;tundra_discovery;swampland_discovery;forest_discovery;mountains_discovery;hills_discovery;wasteland_discovery;coastland_discovery</homeland_events_string_list>
<homeland_events_script_dictionary type="scriptdictionary">
<item key="grassland_discovery">
list add (data_object.travel_string_list, "grassland")
msg ("You've discovered the grassland! Now, you can travel to the grassland and explore it!")
</item>
<item key="plains_discovery">
list add (data_object.travel_string_list, "plains")
msg ("You've discovered the plains! Now, you can travel to the plains and explore it!")
</item>
<item key="desert_discovery">
list add (data_object.travel_string_list, "desert")
msg ("You've discovered the desert! Now, you can travel to the desert and explore it!")
</item>
<item key="tundra_discovery">
list add (data_object.travel_string_list, "tundra")
msg ("You've discovered the tundra! Now, you can travel to the tundra and explore it!")
</item>
<item key="swampland_discovery">
list add (data_object.travel_string_list, "swampland")
msg ("You've discovered the swampland! Now, you can travel to the swampland and explore it!")
</item>
<item key="forest_discovery">
list add (data_object.travel_string_list, "forest")
msg ("You've discovered the forest! Now, you can travel to the forest and explore it!")
</item>
<item key="mountains_discovery">
list add (data_object.travel_string_list, "mountains")
msg ("You've discovered the mountains! Now, you can travel to the mountains and explore it!")
</item>
<item key="hills_discovery">
list add (data_object.travel_string_list, "hills")
msg ("You've discovered the hills! Now, you can travel to the hills and explore it!")
</item>
<item key="wasteland_discovery">
list add (data_object.travel_string_list, "wasteland")
msg ("You've discovered the wasteland! Now, you can travel to the wasteland and explore it!")
</item>
<item key="coastland_discovery">
list add (data_object.travel_string_list, "coastland")
msg ("You've discovered the coastland! Now, you can travel to the coastland and explore it!")
</item>
</homeland_events_script_dictionary>
</object>
<turnscript name="global_turnscript">
<enabled />
<script>
game.turns = game.turns + 1
</script>
</turnscript>
<function name="help_function">
msg ("Type 'explore' to explore your area.")
msg ("Type 'travel' to travel to different areas.")
</function>
<function name="explore_function"><![CDATA[
switch (game.pov.parent) {
case (homeland) {
result_1 = ListCount (data_object.homeland_events_string_list) - 1
if (result_1 >= 0) {
result_2 = StringListItem (data_object.homeland_events_string_list,GetRandomInt(0,result_1))
invoke (ScriptDictionaryItem (data_object.homeland_events_script_dictionary,result_2))
on ready {
foreach (item_x, split ("grassland_discovery;plains_discovery;desert_discovery;tundra_discovery;swampland_discovery;forest_discovery;mountains_discovery;hills_discovery;wasteland_discovery;coastland_discovery",";")) {
if (result_2 = item_x) {
list remove (data_object.homeland_events_string_list, result_2)
}
}
}
} else {
msg ("There seemingly is nothing left to explore in this area.")
}
}
}
]]></function>
<function name="travel_function">
show menu ("Where do you wish to travel?",data_object.travel_string_list,false) {
if (not game.pov.parent = GetObject (result)) {
game.pov.parent = GetObject (result)
} else {
msg ("You are already at this area.")
ask ("Try again?") {
if (result=true) {
travel_function
} else {
msg ("You realize that you need to discover a new area to travel to first, before you can travel to that place.")
}
}
}
}
</function>
</asl>
you could implement your "gps.look" with my "area_discovored's explore" and "travel" scripting~coding system~structure. I could help you, and probably George can help you too, if you wanna use this coding of mine.
JestersMagpie
30 Oct 2013, 11:12Hi HK and G
Yes that looks like what I need. I'm away from later today for a few days and off caving/geocaching with a group from Belgium (that means another language I'll have to brush up on, French!!).
If I get a chance before I leave I'll look deeper and try to get it sorted, otherwise I'll try in spare moments over the weekend.
There isn't a panic to get the game completed as I have yet to sort out where underground I'm going to send the people, the maps and the route all have to be written as well, there is also the small factor of having a life as well lol.
But hopefully over the next two months all will fall into place.
This is a group at the scene of one of my previous geocaches

Yes that looks like what I need. I'm away from later today for a few days and off caving/geocaching with a group from Belgium (that means another language I'll have to brush up on, French!!).
If I get a chance before I leave I'll look deeper and try to get it sorted, otherwise I'll try in spare moments over the weekend.
There isn't a panic to get the game completed as I have yet to sort out where underground I'm going to send the people, the maps and the route all have to be written as well, there is also the small factor of having a life as well lol.
But hopefully over the next two months all will fall into place.
This is a group at the scene of one of my previous geocaches

JestersMagpie
05 Nov 2013, 20:11I'm back home at last and working on sorting this out at last.
I've been set the challenge of creating 11 geocaches in the next 11 months. This will be one of them I hope.
I'm sure that once I can get started it'll be fine. It's just the getting started.
I've been set the challenge of creating 11 geocaches in the next 11 months. This will be one of them I hope.
I'm sure that once I can get started it'll be fine. It's just the getting started.
JestersMagpie
08 Nov 2013, 21:30I've spent the last two days trying to sort this boolean attribute/lock exit/notice to get it to do what I wanted, without joy so I'm going to rewrite it into s simpler form and get round it that way. A pity, but I can get my head round that 
