<game name="xxx">
<pov type="object">player</attr>
</game>
<object name="player">
<attr name="flying_boolean" type="boolean">false</attr>
</object>
<command name="fly_command">
<pattern>fly</pattern>
<script>
if (game.pov.name = "Eanatas") {
if (game.pov.flying_boolean = true) {
msg ("You're already flying, silly.")
} else if (game.pov.flying_boolean = false) {
game.pov.flying_boolean = true
msg ("You're flying now!")
}
}
</script>
<
if (player.condition_string = "poisoned") {
player.life_integer = player.life_integer - 50
} else if (player.condition_string = "paralyzed") {
// script(s)
} else if (player.condition_string = "petried") {
// script(s)
}
// etc etc etc
if (player.action_string = "walking") {
// script(s)
} else if (player.action_string = "flying") {
// script(s)
} else if (player.action_string = "running") {
// script(s)
}
// etc etc etc
if (some condition) {
} else if (opposite of some condition) {
}
if (some condition) {
} else {
}
<function name="xxx"><![CDATA[
if (player.strength_integer >= 51) {
msg ("strong")
} else if (player.strength_integer = 50) {
msg ("average")
} else if (player.strength_integer <= 49) {
msg ("weak")
}
]]></function>
<object name="player">
<attr name="food" type="object">empty</attr>
</object>
<object name="empty">
</object>
<object name="apple">
<take />
<eat type="script">
// I'm missing scripting needed to set the: player.food = apple, this is just an example anyways, so I'm too lazy to do it, lol
if (player.food = apple) {
player.life = player.life + 50
msg ("You eat the apple, re-gaining 50 life.")
} else {
msg ("You can't eat an apple that you don't have in your possession, silly.")
}
</eat>
</object>
<object name="player">
</object>
<object name="sword_1">
<alias>katana</alias>
</object>
<function name="equip_sword_function">
player.right_hand = sword_1
msg ("You equip the " + sword_1.alias + " in your right hand.")
// outputs: You equip the katana in your right hand.
</function>
// using Jay's preferred~correct~simple syntax for this example:
<object name="player">
</object>
<object name="orc">
<attr name="dead" type="boolean">false</attr>
</object>
<function name="fight_orc_function">
if (orc.dead) {
msg ("It is already dead, silly.")
} else {
orc.dead = true
msg ("You fight and kill the orc.")
}
</function>
<function name="fight_orc_function">
if (orc.dead = true) {
msg ("It is already dead, silly.")
} else if (orc.dead = false) {
orc.dead = true
msg ("You fight and kill the orc.")
}
</function>
<command name="main_character_information_screen_command">
<pattern>info</pattern>
<script>
ClearScreen
msg ("Name: " + player.alias)
msg ("Gender: " + player.gender_string)
msg ("Race: " + player.race)
msg ("class: " + player.class)
wait {
ClearScreen
}
</script>
</command>
<function name="character_creation_function">
show menu ("Who do you want to be?", split ("player;HK;Conan_the_Barbarian;Frodo_Baggins_from_Tolkien's_Lord_of_the_rings", ";"), false) {
game.pov = result
switch (game.pov) {
case (player) {
player.alias = "hero"
player.gender_string = "male"
player.race = "dwarf"
player.class = "cleric"
}
case (HK) {
player.alias = "HK"
player.gender_string = "male"
player.race = "human"
player.class = "warrior"
}
case (Conan_the_Barbarian) {
player.alias = "Conan"
player.gender_string = "male"
player.race = "human"
player.class = "warrior"
}
case (Frodo_Baggins_from_Tolkien's_Lord_of_the_Rings) {
player.alias = "Frodo"
player.gender_string = "male"
player.race = "hobbit (halfling)"
player.class = "thief"
}
}
}
</function>
<command name="main_character_information_screen_command">
<pattern>info</pattern>
<script>
ClearScreen
if (game.pov.name = "player") {
msg ("Name: " + player.alias)
msg ("Gender: " + player.gender_string)
msg ("Race: " + player.race)
msg ("class: " + player.class)
} else if (game.pov.name = "HK") {
msg ("Name: " + HK.alias)
msg ("Gender: " + HK.gender_string)
msg ("Race: " + HK.race)
msg ("class: " + HK.class)
} else if (game.pov.name = "Conan_the_Barbarian") {
msg ("Name: " + Conan_the_Barbarian.alias)
msg ("Gender: " + Conan_the_Barbarian.gender_string)
msg ("Race: " + Conan_the_Barbarian.race)
msg ("class: " + Conan_the_Barbarian.class)
} else if (game.pov.name = "Frodo_Baggins_from_Toliken's_Lord_of_the_Rings") {
msg ("Name: " + Frodo_Baggins_from_Toliken's_Lord_of_the_Rings.alias)
msg ("Gender: " + Frodo_Baggins_from_Toliken's_Lord_of_the_Rings.gender_string)
msg ("Race: " + Frodo_Baggins_from_Toliken's_Lord_of_the_Rings.race)
msg ("class: " + Frodo_Baggins_from_Toliken's_Lord_of_the_Rings.class)
}
wait {
ClearScreen
}
</script>
</command>
<object name="player">
<alias>hero</alias>
<attr name="object_type_string" type="string">character</attr>
<attr name="gender_string" type="string">male</attr>
<attr name="race" type="string">dwarf</attr>
<attr name="class" type="string">cleric</attr>
</object>
<object name="HK">
<attr name="object_type_string" type="string">character</attr>
<attr name="gender_string" type="string">male</attr>
<attr name="race" type="string">human</attr>
<attr name="class" type="string">warrior</attr>
</object>
<object name="Conan_the_Barbarian">
<alias>Conan</alias>
<attr name="object_type_string" type="string">character</attr>
<attr name="gender_string" type="string">male</attr>
<attr name="race" type="string">human</attr>
<attr name="class" type="string">barbarian</attr>
</object>
<object name="Frodo_Baggins">
<alias>Frodo</alias>
<attr name="object_type_string" type="string">character</attr>
<attr name="gender_string" type="string">male</attr>
<attr name="race" type="string">hobbit (halfling)</attr>
<attr name="class" type="string">thief</attr>
</object>
<object name="orc_1">
<alias>orc</alias>
<attr name="object_type_string" type="string">character</attr>
<attr name="gender_string" type="string">male</attr>
<attr name="race" type="string">orc</attr>
<attr name="class" type="string">berserker</attr>
</object>
<object name="car_1">
<alias>car</alias>
<attr name="object_type_string" type="string">vehicle</attr>
</object>
<object name="table_1">
<alias>table</alias>
<attr name="object_type_string" type="string">furniture</attr>
</object>
<object name="room_1">
<alias>dungeon of doom</alias>
<attr name="object_type_string" type="string">room</attr>
</object>
<command name="any_character_information_screen_command">
<pattern>info #text#</pattern>
<script>
object_variable_1 = GetObject (text)
if (object_variable_1 = null) {
foreach (object_variable_2, AllObjects () ) {
if (object_variable_2.alias = text) {
object_variable_1 = object_variable_2
}
}
if (object_variable_1 = null) {
msg ("Wrong input, please try again.")
} else if (GetString (object_variable_1.object_type_string, "character")) {
if (object_variable_1.parent = player.parent) {
ClearScreen
msg ("Name: " + object_variable_1.alias)
msg ("Gender: " + object_variable_1.gender_string)
msg ("Race: " + object_variable_1.race)
msg ("class: " + object_variable_1.class)
wait {
ClearScreen
}
} else {
msg ("There seemingly is no such character within the room, and no, you don't get god~cheating powers to see any character anywhere within the game either, nice try wink, so please try again.")
}
} else {
msg ("Wrong input, please try again, as your input is not a 'character' Object in the game.")
}
</script>
</command>
.
.
.
.
.
.
.
there's one extra missing check that is needed... as there's going to be an issue with one of the checks
.
.
.
.
.
.
Hint: something (a needed check) is overlooked~missing with the 'name-vs-alias' checking...
.
.
.
.
.
.
Answer:
.
.
.
.
.
if we have multiple Objects with the same 'alias', we need a check to deal with which of those Objects to use~get~reference for the Command ~ which Object did the person want the info about?, hehe
<command name="crafting_command">
<pattern>craft #object1# with #object2# and #object3#</pattern>
<script>
// blah scripting
msg ("You forged a steel sword.")
</script>
</command>
<command name="crafting_command">
<pattern>craft #object1# #object2# #object3#</pattern>
<script>
// blah scripting
msg ("You forged a steel sword.")
</script>
</command>
Also, the Value may NOT be these special strings: 'true' nor 'false', as these are set aside for Boolean Attributes' Values
by NOT encasing the Value in quotes, you're telling the engine that this is an ACTUAL Object
<object name="orc">
<attr name="dead_boolean" type="boolean">false</attr>
<attr name="endurance_integer" type="int">25</attr>
<attr name="attack" type="script">
HK.physical_damage_integer = HK.claymore_sword.physical_damage_integer + HK.claymore_sword.physical_damage_integer * HK.strength_integer / 100 - orc.full_plate_armor.resistance_integer - orc.full_plate_armor.resistance_integer * orc.endurance / 100
<object name="full_plate_armor">
<attr name="resistance_integer" type="int">40</attr>
</object>
</object>
<object name="player">
<attr name="strength_integer" type="int">100</atrr>
<object name="claymore_sword">
<attr name="physical_damage_integer" type="int">50</attr>
</object>
</object>
<object name="orc">
</object>
<object name="orc">
</object>
// ERROR !!!!
<object name="Orc">
</object>
<object name="orc">
</object>
// NO error
<object name="orc_1">
<attr name="strength" type="int">100</attr>
</object>
<object name="orc_2">
<attr name="strength" type="int">100</attr>
</object>
// NO error
<object name="orc">
<attr name="strength" type="int">100</attr>
<attr name="strength" type="int">100</attr>
</object>
// ERROR !!!
<object name="orc">
<attr name="strength" type="int">100</attr>
<attr name="strength" type="string">100</attr>
</object>
// ERROR !!!
<object name="orc">
<attr name="strength_integer" type="int">100</attr>
<attr name="strength_string" type="string">100</attr>
</object>
// NO error
<function name="buy">
</function>
<function name="buy">
</function>
// ERROR !!!
<function name="buy">
</function>
<command name="buy">
</command>
// ERROR !!!
<function name="Buy">
</function>
<function name="buy">
</function>
// NO error
<function name="buy_1">
</function>
<function name="buy_2">
</function>
// NO error
<function name="buy_function">
</function>
<command name="buy_command">
</command>
// NO error
shortened Script Attribute tag line (due to a change in syntaxing between older and newer versions):
<obejct name="orc">
<fight type="script">
// script block
</fight>
</object>
<function name="fight">
</function>
// ERROR !!!
extended Script Attribute tag line (due to a change in syntaxing structure between older and newer versions):
<obejct name="orc">
<attr name="fight" type="script">
// script block
</attr>
</object>
<function name="fight">
</function>
// ERROR !!!
etc etc etc examples
-----------------------------------------------------------------------
shortened String Attribute tag line (by the way):
<object name="orc_1">
<alias>orc</alias>
</object>
extended String Attribute tag line (by the way):
<object name="orc_1">
<attr name="alias" type="string">orc</attr>
</object>
etc etc etc
Marzipan wrote:Are you using a library you didn't include with the download? I get an error when I try to open that.
<!--Saved by Quest 5.6.5510.29036-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="LevelLib.aslx" />
<game name="Eanatas">
<gameid>ced3aa62-ef51-48b8-a371-2a72c3c6b10c</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<subtitle>Gargoyle Tales</subtitle>
<author>Robert Hatfield</author>
<cover>rsz_gargoyle.jpg</cover>
<category>Fantasy</category>
<difficulty>Medium</difficulty>
<cruelty>Tough</cruelty>
<backgroundimage>gargoyle.jpg</backgroundimage>
<defaultbackground>Silver</defaultbackground>
<statusattributes type="stringlist" />
<showhealth />
<feature_asktell />
<appendobjectdescription />
<multiplecommands />
<feature_pictureframe />
<gridmap />
<pov type="object">Eanatas</pov>
</game>
<object name="Cavern">
<inherit name="editor_room" />
<description>The heat is unbearable and the smell of sulfur is so thick it would choke the life from a normal man. An unsteady patter of footsteps breaks through the silence. A yellowing flicker spreads across the cave's surfaces, mixing with shadows cast by the dead. Eanatas shuffled along, stirring up a cloud of dust. The glow from his torch showed his red, fiendish face. White eyes glistened above a huge, freakish grin, almost touching his pointed ears.</description>
<picture type="string"></picture>
<enter type="script">
</enter>
<beforeenter type="script">
SetFramePicture ("cave.jpg")
</beforeenter>
<object name="Eanatas">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="namedmale" />
<inherit name="switchable" />
<usedefaultprefix />
<look>A fiendish face with large white eyes, a snake-like tongue curling and twisting, lashing out around long sharp teeth. Wings of skin and claws of carbon black bone. </look>
<visible type="boolean">false</visible>
<attr name="You are" type="string"></attr>
<statusattributes type="stringdictionary">
<item>
<key>You are</key>
<value></value>
</item>
<item>
<key>Flying_turns_left</key>
<value></value>
</item>
<item>
<key>Gold</key>
<value></value>
</item>
</statusattributes>
<feature_switchable />
<switchonmsg>You spread your wings and begin to rise.</switchonmsg>
<switchoffmsg>You land with a thump.</switchoffmsg>
<attr name="Flying_turns_left" type="int">10</attr>
<Gold type="int">0</Gold>
<drop type="boolean">false</drop>
<onswitchon type="script">
set (Eanatas, "You are", "flying")
</onswitchon>
<onswitchoff type="script">
set (Eanatas, "You are", "Walking")
</onswitchoff>
</object>
<exit alias="west" to="Mountain Path">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="Tunnel">
<inherit name="eastdirection" />
</exit>
<object name="Sword">
<inherit name="editor_object" />
<alias>sword1</alias>
<look>A basic slashing and stabbing weapon. The blade is about 2 feet long</look>
<take />
</object>
</object>
<command name="fly">
<pattern type="string">fly</pattern>
<script>
SwitchOn (Eanatas)
</script>
</command>
<object name="Tunnel">
<inherit name="editor_room" />
<exit alias="west" to="Cavern">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="Ledge">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Ledge">
<inherit name="editor_room" />
<exit alias="west" to="Tunnel">
<inherit name="westdirection" />
</exit>
<exit alias="north" to="Small Opening">
<inherit name="northdirection" />
</exit>
</object>
<object name="Mountain Path">
<inherit name="editor_room" />
<exit alias="east" to="Cavern">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Lair">
<inherit name="editor_room" />
<exit alias="east" to="Small Opening">
<inherit name="eastdirection" />
</exit>
<exit alias="up" to="Stairs">
<inherit name="updirection" />
</exit>
</object>
<object name="Small Opening">
<inherit name="editor_room" />
<exit alias="south" to="Ledge">
<inherit name="southdirection" />
</exit>
<exit alias="west" to="Lair">
<inherit name="westdirection" />
</exit>
</object>
<command name="land">
<pattern type="string">land</pattern>
<script>
SwitchOff (Eanatas)
</script>
</command>
<object name="Stairs">
<inherit name="editor_room" />
<exit alias="down" to="Lair">
<inherit name="downdirection" />
</exit>
<exit alias="out" to="Forest Clearing">
<inherit name="outdirection" />
</exit>
</object>
<object name="Forest Clearing">
<inherit name="editor_room" />
<exit alias="in" to="Stairs">
<inherit name="indirection" />
</exit>
</object>
<turnscript name="flyingturncounter">
<enabled />
<script><![CDATA[
if (IsSwitchedOn(Eanatas)) {
Eanatas.Flying_turns_left = Eanatas.Flying_turns_left - 1
if (Eanatas.Flying_turns_left = 0) {
SwitchOff (Eanatas)
msg ("You exhausted yourself, landing quickly to the ground, as you no longer have the energy to keep flying.")
}
}
]]></script>
</turnscript>
</asl>
<turnscript name="flyingturncounter">
<enabled />
<script><![CDATA[
if (IsSwitchedOn(Eanatas)) {
Eanatas.Flying_turns_left = Eanatas.Flying_turns_left - 1
if (Eanatas.Flying_turns_left = 0) {
SwitchOff (Eanatas)
msg ("You exhausted yourself, landing quickly to the ground, as you no longer have the energy to keep flying.")
}
}
]]></script>
</turnscript>
Forgewright wrote:I have seen a lot of discussion about (clear the previous turn) I like it because it clears away the past clutter, but when the player type in a command, it will clear away the (You can go) and (you can see) texts and only show the results of the command. In the game turnscript I just have (clear previous turn) Can I enable the (Look) command in the turnscript or activate it to show everything in the room without printing it out so the player has to click it?