help with bugs please!!!

onimike
16 Aug 2013, 18:19
hi all, I am still new to this program but have been trying to make a relatively large game. I know I should start off small and I have by making a couple other games as tester for myself to gain knowledge on how this program works. I started this rpg and wasn't having a whole lot of difficulty until it came to quest, tasks, and combat, I know I have asked people in the past and have gotten help. I have a basic idea of what to do but got lost in the sea of scripts now I can't delete certain scripts to rewrite them can some one please help on this please? Once I get the scripting I need for linking quest together (to complete a task) and combat I can focus on my story and inputting all the descriptions, interactive npc's, further quest etc. As you can tell if you download I am putting a lot into it want a large game with many different things to do. Like having joinable guild halls, general store, an inn, pub, blacksmith etc. So if you can help that would be great for the advancement on this game.
P.S. I do not know scripting but I will post the coding and upload file.

Mike
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Mystic Mages">
<gameid>7b455ee2-72c1-42e0-a111-09eb20b79ca1</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<showhealth type="boolean">false</showhealth>
<showscore type="boolean">false</showscore>
<gridmap type="boolean">false</gridmap>
<start type="script">
</start>
<onhealthzero type="script">
finish
</onhealthzero>
<object name="monsters">
<inherit name="editor_object" />
<inherit name="maleplural" />
<object name="zombie">
<inherit name="editor_object" />
</object>
<object name="spider">
<inherit name="editor_object" />
</object>
<object name="necromancer">
<inherit name="editor_object" />
</object>
<object name="maruader">
<inherit name="editor_object" />
</object>
</object>
</game>
<object name="living room">
<alias>Cottage Home</alias>
<object name="upstairs">
<inherit name="editor_room" />
<alias>stairs</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<object name="bedroom1">
<inherit name="openable" />
<alias>your bedroom</alias>
<visible type="boolean">false</visible>
<beforefirstenter type="script">
</beforefirstenter>
<beforeenter type="script">
</beforeenter>
<object name="bed1">
<inherit name="editor_object" />
<alias>bed</alias>
</object>
<object name="dresser1">
<inherit name="editor_object" />
<inherit name="container_open" />
<alias>dresser</alias>
<isopen type="boolean">false</isopen>
<hidechildren type="boolean">false</hidechildren>
<listchildren />
<object name="gold_piece">
<inherit name="editor_object" />
<take />
<attr name="value_worth" type="script">
if (Got(gold_piece)) {
player.gold = player.gold + 5
}
else if (not Got(gold_piece)) {
player.gold = player.gold - 5
}
</attr>
<use type="boolean">false</use>
<ontake type="script">
do (gold_piece, "value_worth")
</ontake>
<ondrop type="script">
player.gold = player.gold - 5
</ondrop>
<usemenuprompt type="string"></usemenuprompt>
<giveto type="scriptdictionary">
<item key="Jane">
</item>
</giveto>
<alt type="stringlist">
<value>gold</value>
<value>money</value>
<value>cash</value>
<value>currency</value>
</alt>
</object>
</object>
<object name="closest">
<inherit name="openable" />
<dark />
</object>
<exit alias="hall" to="upstairs">
<inherit name="southeastdirection" />
</exit>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<statusattributes type="stringdictionary">
<item>
<key>strength</key>
<value></value>
</item>
<item>
<key>dexterity</key>
<value></value>
</item>
<item>
<key>intelligence</key>
<value></value>
</item>
<item>
<key>level</key>
<value></value>
</item>
<item>
<key>class</key>
<value></value>
</item>
<item>
<key>experience</key>
<value></value>
</item>
<item>
<key>turns</key>
<value></value>
</item>
<item>
<key>health</key>
<value></value>
</item>
<item>
<key>gold</key>
<value></value>
</item>
</statusattributes>
<strength type="int">0</strength>
<dexterity type="int">0</dexterity>
<intelligence type="int">0</intelligence>
<level type="int">0</level>
<class>mage; archer; warrior;</class>
<experience type="int">0</experience>
<turns type="int">0</turns>
<health type="int">0</health>
<dead type="boolean">false</dead>
<gold type="int">0</gold>
</object>
</object>
<object name="bedroom2">
<inherit name="openable" />
<alias>brothers room</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<visible type="boolean">false</visible>
<object name="bed">
<inherit name="editor_object" />
</object>
<object name="end table">
<inherit name="editor_object" />
</object>
<exit alias="hall" to="upstairs">
<inherit name="southwestdirection" />
</exit>
</object>
<exit alias="down" to="living room">
<inherit name="downdirection" />
</exit>
<exit alias="your room" to="bedroom1">
<inherit name="northwestdirection" />
<locked type="boolean">false</locked>
</exit>
<exit alias="brothers room" to="bedroom2">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="kitchen">
<object name="den">
<inherit name="editor_room" />
<exit alias="up" to="kitchen">
<inherit name="updirection" />
</exit>
</object>
<exit alias="down" to="den">
<inherit name="downdirection" />
</exit>
<exit alias="east" to="living room">
<inherit name="eastdirection" />
</exit>
</object>
<exit alias="out" to="front lawn">
<inherit name="outdirection" />
</exit>
<exit alias="up" to="upstairs">
<inherit name="updirection" />
</exit>
<exit alias="west" to="kitchen">
<inherit name="westdirection" />
</exit>
<object name="chair">
<inherit name="editor_object" />
<sit type="script">
msg ("No time to sit got to get busy!")
</sit>
</object>
<object name="couch">
<inherit name="editor_object" />
<sit>No time to lounge got to get busy!</sit>
</object>
</object>
<object name="restroom">
<alias>outhouse</alias>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<dark />
<object name="sink">
<inherit name="editor_object" />
</object>
<exit alias="southeast" to="front lawn">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="front lawn">
<inherit name="editor_room" />
<exit alias="in" to="living room">
<inherit name="indirection" />
</exit>
<exit alias="northwest" to="restroom">
<inherit name="northwestdirection" />
</exit>
<exit alias="south" to="road">
<inherit name="southdirection" />
</exit>
<object name="npc">
<inherit name="editor_object" />
<alias>oldman</alias>
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<speak type="script">
firsttime {
questions1 = NewStringList()
list add (questions1, "yes")
list add (questions1, "no")
ShowMenu ("Will you do me a favor?", questions1, false) {
if (result="yes") {
msg ("Oh thank you child, my bones can't carry me that far.")
msg ("Here! Take this orb to Jane at the Village Inn.")
MoveObject (orb, player)
msg ("Return to me and I will give you the potion.")
SetObjectFlagOn (Jane, "orbtask")
}
else if (result="no") {
msg ("Maybe tommorow then.")
}
else if (Contains (Jane,orb)) {
firsttime {
msg ("Here child!")
MoveObject (exp potion, player)
}
otherwise {
msg ("You did good thank you again.")
}
}
}
}
otherwise {
}
</speak>
<giveto type="scriptdictionary">
<item key="exp potion">
if (GetBoolean(Jane, "orbtask")) {
msg ("Once you have completed the task then you may have the potion.")
}
else if (not GetBoolean(Jane, "orbtask")) {
msg ("Here you are.")
MoveObject (exp potion, player)
}
</item>
</giveto>
<object name="orb">
<inherit name="editor_object" />
<take />
<look>Its a shiny black orb..</look>
<givesingle />
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
</inventoryverbs>
<givemenuprompt>Jane</givemenuprompt>
<giveto type="scriptdictionary">
<item key="Jane">
msg ("Here you go, an elderly man gave me this to give to you.")
MoveObject (orb, Jane)
if (Contains (Jane,orb)) {
SetObjectFlagOff (Jane, "orbtask")
}
else {
msg ("Thank you! she says!")
}
</item>
</giveto>
</object>
<object name="exp potion">
<inherit name="editor_object" />
<take />
<drink type="script">
player.experience = player.experience + 15
</drink>
</object>
</object>
</object>
<object name="humble way">
<inherit name="editor_room" />
<object name="village square">
<object name="guild hall">
<object name="achers guild">
<object name="allen the archer">
<inherit name="editor_object" />
<inherit name="namedmale" />
</object>
<exit alias="southeast" to="guild hall">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="mage guild">
<object name="maggie the mage">
<inherit name="editor_object" />
<inherit name="namedfemale" />
</object>
<exit alias="southwest" to="guild hall">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="warrior guild">
<object name="larry the warrior">
<inherit name="editor_object" />
<inherit name="namedmale" />
</object>
<exit alias="northeast" to="guild hall">
<inherit name="northeastdirection" />
</exit>
</object>
<exit alias="down" to="village square">
<inherit name="downdirection" />
</exit>
<exit alias="northwest" to="achers guild">
<inherit name="northwestdirection" />
</exit>
<exit alias="northeast" to="mage guild">
<inherit name="northeastdirection" />
</exit>
<exit alias="southwest" to="warrior guild">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="general store">
<object name="tom">
<inherit name="editor_object" />
<inherit name="namedmale" />
</object>
<object name="tent">
<inherit name="editor_object" />
</object>
<object name="bedroll">
<inherit name="editor_object" />
</object>
<object name="flask">
<inherit name="editor_object" />
</object>
<object name="rations">
<inherit name="editor_object" />
</object>
<exit alias="northwest" to="village square">
<inherit name="northwestdirection" />
</exit>
</object>
<object name="village square inn">
<exit alias="southwest" to="village square">
<inherit name="southwestdirection" />
</exit>
<object name="front desk">
<inherit name="editor_object" />
<inherit name="container_open" />
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<close type="boolean">false</close>
<isopen />
<open type="boolean">false</open>
<onopen type="script">
MakeObjectVisible (Jane)
</onopen>
<object name="Jane">
<inherit name="editor_object" />
<inherit name="namedfemale" />
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<speak type="script">
questions = NewStringList()
list add (questions, "yes")
list add (questions, "no")
ShowMenu ("Would you like a room today only 5G?", questions, false) {
msg ("-" + result)
if (result="yes") {
if (Got(gold_piece)) {
MoveObject (gold_piece, Jane)
if (not Got(gold_piece)) {
player.gold = player.gold - 5
msg ("Enjoy your stay!")
MoveObject (key, player)
room_renting
}
}
}
else if (result="no") {
msg ("Ok thank you have a nice day.")
}
}
</speak>
<give type="scriptdictionary">
<item key="orb">
MoveObject (orb, Jane)
if (GetBoolean(Jane, "orbtask")) {
SetObjectFlagOff (Jane, "orbtask")
msg ("Thank you very much.")
}
</item>
<item key="gold_piece">
MoveObject (key, player)
</item>
</give>
<tell type="scriptdictionary" />
<object name="key">
<inherit name="editor_object" />
<alt type="stringlist">
<value>door</value>
</alt>
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<look>It has a peep hole and the #1 on the front of the door.</look>
<selfuseon type="scriptdictionary">
<item key="room1">
UnlockExit (room_key)
</item>
</selfuseon>
</object>
</object>
</object>
<object name="room1">
<inherit name="container_open" />
<inherit name="container_lockable" />
<key type="object">key</key>
<locked />
<canlockopen type="boolean">false</canlockopen>
<isopen type="boolean">false</isopen>
<onunlock type="script">
</onunlock>
<goto type="script">
if (room1.locked = false) {
MoveObject (player, room1)
}
else if (room1.locked = true) {
msg ("Door is locked you need a room key!")
}
else if (not Contains (player,key)) {
msg ("You can't go in with out a key..")
}
</goto>
<exit alias="southeast" to="village square inn">
<inherit name="southeastdirection" />
</exit>
<object name="bed2">
<inherit name="editor_object" />
<alias>bed</alias>
<attr name="lay_down" type="script">
MoveObject (player, bed2)
EnableTimer (sleep_timer)
</attr>
</object>
<object name="night_stand">
<inherit name="editor_object" />
</object>
</object>
<object name="room2">
<inherit name="container_open" />
<inherit name="container_lockable" />
<isopen type="boolean">false</isopen>
<exit alias="south" to="village square inn">
<inherit name="southdirection" />
</exit>
</object>
<object name="room3">
<inherit name="container_open" />
<inherit name="container_lockable" />
<isopen type="boolean">false</isopen>
<exit alias="southwest" to="village square inn">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="room4">
<inherit name="container_open" />
<inherit name="container_lockable" />
<isopen type="boolean">false</isopen>
<exit alias="west" to="village square inn">
<inherit name="westdirection" />
</exit>
</object>
<exit alias="out" to="village square">
<inherit name="outdirection" />
</exit>
</object>
<exit alias="out" to="humble way">
<inherit name="outdirection" />
</exit>
<exit alias="up" to="guild hall">
<inherit name="updirection" />
</exit>
<exit alias="in" to="village square inn">
<inherit name="indirection" />
</exit>
<exit alias="southeast" to="general store">
<inherit name="southeastdirection" />
</exit>
<exit alias="southwest" to="blacksmith">
<inherit name="southwestdirection" />
</exit>
</object>
<exit alias="north" to="light forest">
<inherit name="northdirection" />
</exit>
<exit alias="in" to="village square">
<inherit name="indirection" />
</exit>
</object>
<object name="forest way">
<inherit name="editor_room" />
<object name="forest trail">
<inherit name="editor_room" />
<object name="light forest">
<object name="thick forest">
<object name="dark forest">
<exit alias="northwest" to="woods2">
<inherit name="northwestdirection" />
</exit>
</object>
<exit alias="east" to="light forest">
<inherit name="eastdirection" />
</exit>
<exit alias="northeast" to="woods2">
<inherit name="northeastdirection" />
</exit>
<exit alias="southwest" to="trail1">
<inherit name="southwestdirection" />
</exit>
</object>
<exit alias="north" to="woods2">
<inherit name="northdirection" />
</exit>
<exit alias="west" to="woods5">
<inherit name="westdirection" />
</exit>
<exit alias="south" to="humble way">
<inherit name="southdirection" />
</exit>
</object>
<exit alias="southeast" to="woods1">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="woods1">
<inherit name="editor_room" />
<exit alias="northeast" to="woods">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="woods2">
<inherit name="editor_room" />
<exit alias="west" to="woods">
<inherit name="westdirection" />
</exit>
<exit alias="southwest" to="thick forest">
<inherit name="southwestdirection" />
</exit>
<exit alias="south" to="light forest">
<inherit name="southdirection" />
</exit>
</object>
<object name="woods">
<inherit name="editor_room" />
<exit alias="southwest" to="woods1">
<inherit name="southwestdirection" />
</exit>
<exit alias="east" to="woods2">
<inherit name="eastdirection" />
</exit>
<exit alias="northwest" to="forest way">
<inherit name="northwestdirection" />
</exit>
</object>
<exit alias="north" to="roadway1">
<inherit name="northdirection" />
</exit>
<exit alias="southeast" to="woods">
<inherit name="southeastdirection" />
<runscript type="boolean">false</runscript>
</exit>
</object>
<object name="road">
<exit alias="north" to="front lawn">
<inherit name="northdirection" />
</exit>
<object name="roadway1">
<exit alias="east" to="road">
<inherit name="eastdirection" />
</exit>
<exit alias="south" to="forest way">
<inherit name="southdirection" />
</exit>
</object>
<object name="roadway2">
<exit alias="west" to="road">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="traders route">
<inherit name="eastdirection" />
</exit>
</object>
<exit alias="west" to="roadway1">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="roadway2">
<inherit name="eastdirection" />
</exit>
<exit alias="south" to="road">
<inherit name="southdirection" />
<lookonly />
<look>A mass of forest sits theres but it looks a little thin in spots.</look>
</exit>
</object>
<object name="trail1">
<inherit name="editor_room" />
<exit alias="northeast" to="thick forest">
<inherit name="northeastdirection" />
</exit>
<exit alias="south" to="trail2">
<inherit name="southdirection" />
</exit>
<exit alias="southeast" to="woods4">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="trail2">
<inherit name="editor_room" />
<exit alias="north" to="trail1">
<inherit name="northdirection" />
</exit>
<exit alias="southeast" to="Mystical Mage">
<inherit name="southeastdirection" />
</exit>
<exit alias="west" to="woods3">
<inherit name="westdirection" />
</exit>
</object>
<object name="woods3">
<inherit name="editor_room" />
<exit alias="east" to="trail2">
<inherit name="eastdirection" />
</exit>
</object>
<object name="woods4">
<inherit name="editor_room" />
<exit alias="northwest" to="trail1">
<inherit name="northwestdirection" />
</exit>
</object>
<object name="woods5">
<inherit name="editor_room" />
<exit alias="east" to="light forest">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Mystical Mage">
<inherit name="editor_room" />
<exit alias="northwest" to="trail2">
<inherit name="northwestdirection" />
</exit>
</object>
<object name="blacksmith">
<inherit name="editor_room" />
<exit alias="northeast" to="village square">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="traders route">
<inherit name="editor_room" />
<exit alias="west" to="roadway2">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="traders route 1">
<inherit name="eastdirection" />
</exit>
</object>
<object name="traders route 1">
<inherit name="editor_room" />
<exit alias="west" to="traders route">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="traders route 2">
<inherit name="eastdirection" />
</exit>
</object>
<object name="traders route 2">
<inherit name="editor_room" />
<exit alias="west" to="traders route 1">
<inherit name="westdirection" />
</exit>
<exit alias="northeast" to="traders square">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="traders square">
<inherit name="editor_room" />
<exit alias="southwest" to="traders route 2">
<inherit name="southwestdirection" />
</exit>
<exit alias="in" to="traders market">
<inherit name="indirection" />
</exit>
</object>
<object name="traders market">
<inherit name="editor_room" />
<exit alias="out" to="traders square">
<inherit name="outdirection" />
</exit>
<exit alias="northwest" to="traders hall">
<inherit name="northwestdirection" />
</exit>
<exit alias="southwest" to="traders pub">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="traders hall">
<inherit name="editor_room" />
<exit alias="southeast" to="traders market">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="gambling hall">
<inherit name="editor_room" />
</object>
<object name="traders pub">
<inherit name="editor_room" />
<exit alias="northeast" to="traders market">
<inherit name="northeastdirection" />
</exit>
</object>
<turnscript name="global_game_turns">
<enabled />
<script>
game_turn_function
leveling function
</script>
</turnscript>
<verb>
<property>givejane</property>
<pattern>givejane</pattern>
<defaultexpression>"You can't givejane " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>goto</property>
<pattern>goto</pattern>
<defaultexpression>"You can't goto " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>lay_down</property>
<pattern>lay_down</pattern>
<defaultexpression>"You can't lay_down " + object.article + "."</defaultexpression>
</verb>
<function name="intro_function">
msg ("A vast land where monsters roam and evil lurks, the people of Villagoplia thrive to survive in these troubled lands. Lives lost and wars raged but we still live they will conquer us and we will not lye down and die.....")
msg ("......................................................................................................................")
msg ("......................................................")
wait {
msg ("Whats your name?")
get input {
msg ("Hello " + result)
genderlist = NewStringList()
list add (genderlist, "male")
list add (genderlist, "female")
ShowMenu ("Whats your gender?", genderlist, false) {
player.gender = result
classlist = NewStringList()
list add (classlist, "mage")
list add (classlist, "warrior")
list add (classlist, "archer")
ShowMenu ("What class would you like to be?", classlist, false) {
player.class = result
msg ("You are a " + result)
if (result="mage") {
mage class
}
else if (result="warrior") {
warrior class
}
else if (result="archer") {
archer class
}
}
}
}
}
</function>
<function name="warrior class">
player.strength = player.strength + 3
player.dexterity = player.dexterity + 2
player.intelligence = player.intelligence + 1
player.health = player.health + 18
</function>
<function name="archer class">
player.intelligence = player.intelligence + 1
player.dexterity = player.dexterity + 3
player.strength = player.strength + 2
player.health = player.health + 14
</function>
<function name="mage class">
player.dexterity = player.dexterity + 2
player.strength = player.strength + 1
player.intelligence = player.intelligence + 3
player.health = player.health + 10
</function>
<function name="leveling function"><![CDATA[
if (player.experience >= player.level * 15 + 15) {
player.experience = player.experience - (player.level * 15 + 15)
player.level = player.level + 1
switch (player.gender) {
case ("male") {
player.strength = player.strength + 1
player.dexterity = player.dexterity + 1
player.health = player.health + 2
}
case ("female") {
player.intelligence = player.intelligence + 1
player.dexterity = player.dexterity + 1
player.health = player.health + 1
}
}
switch (player.class) {
case ("warrior") {
player.strength = player.strength + 2
player.intelligence = player.intelligence + 1
player.dexterity = player.dexterity + 1
player.health = player.health + 6
}
case ("mage") {
player.intelligence = player.intelligence + 2
player.dexterity = player.dexterity + 1
player.strength = player.strength + 1
player.health = player.health + 2
}
case ("archer") {
player.intelligence = player.intelligence + 1
player.deterity = player.dexterity + 2
player.strength = player.strength + 1
player.health = player.health + 4
}
}
leveling function
}
]]></function>
<function name="fight function">
</function>
<function name="game_turn_function">
player.turns = player.turns + 1
</function>
<function name="orb_task">
</function>
<function name="room_renting">
if (Got(key)) {
EnableTimer (room_timer)
}
else if (Contains (Jane,key)) {
DisableTimer (room_timer)
}
</function>
<timer name="room_timer">
<interval>30</interval>
<script>
MoveObject (key, Jane)
if (game.pov.parent = room1) {
MoveObject (player, village square inn)
HelperCloseObject (room1)
}
DisableTimer (room_timer)
</script>
</timer>
<timer name="sleep_timer">
<interval>60</interval>
<script>
msg ("YAWNNN!! That was a good rest!")
MoveObject (player, room1)
DisableTimer (sleep_timer)
</script>
</timer>
</asl>

HegemonKhan
17 Aug 2013, 06:51
Can you give some specific things that aren't working in your game, so we can work on fixing them, one thing at a time, it'd make it easier for me anyways, as it's hard to scour through your game, trying to figure out what you want done, and thus then looking for the problems that you have with doing the stuff you want done.

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

what's publically available so far, is what is publically available so far, lol. Be patient and hope others will provide more coding, or try to slowly learn to code on your own ~ making your own code (and share it with us... or keep it to yourself, but then you'll have to listen to new noobs asking for such coding too... lol) that you need for building~making your game. Libraries are blue prints, it's up to you to use them to build your own stuff, and asking people to code (ie make) your game, is asking quite a lot of them. Asking for more "in-depth" coding beyond a "blue print" library's coding, is basically asking them to code in your game for you... I'll try to do what I can to help, but it's a lot of work to help others, as I am also trying to work on learning more at coding for progressing on my own game making, on top of the busy-ness of my real world life, lol.

here's the link to the libraries: ( viewforum.php?f=18 )

check out these Libraries, in particular:

Hint Coding (Pixie): ( viewtopic.php?f=18&t=3802 )
Journal Coding (Pixie): ( viewtopic.php?f=18&t=2610 )
Shop Coding: ( viewtopic.php?f=18&t=2557 )
Score Coding: ( viewtopic.php?f=18&t=2627 )

and whatever you can find is this discussion forum, in its threads~posts, too.

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

whether working with code or the GUI~Editor, both requires "code~computer logic" thinking~mindset of your brain, which isn't easy to shift your brain's thinking this way. The brain is far beyond non-organic circuitry, we have no clue that we're actually communicating just as a computer does, through the use of "ifs", ie Conditionals, (orc is not dead -> if orc is not dead -> then, fight with orc -> you kill orc ~hopefully~ and now it is "dead", lol -> try to fight with orc again -> if orc is dead -> and since the orc is indeed now dead -> then, you fail to fight with it, as it is dead) and "3-way handshakes" ( 1~"hi, and did you hear me?" -> 2~"yes, I heard you, you said, hi, correct?" -> 3~"yes, indeed, I said hi to you" -> 1~"ah, good, and now I'm saying hi back to you, and did you hear me say hi back to you? -> etc etc etc). But for computers, we've and they've got to literally spell this out to them and themselves as part of the communication, and that's~this' what we call "coding", hehe.

HegemonKhan
17 Aug 2013, 20:48
1. your "intro_function" function is not activating ("Calling") at start of game

Game (Object) -> Script (Tab) -> Start script -> Add new script -> Scripts -> Call function ->

Call function: intro_function
with parameters (add): (leave blank)

2. wrong order of functions in your "global_game_turns" turnscript

Game -> Script (Tab) -> Turn scripts -> double click on the "global_game_turns" in the big add box ->

global_game_turns -> Turn Script (Tab, there's only one tab, lol) -> Script -> click on the "game_turn_function" Call Function box so that it is highlighted light blue -> click on the blue down arrow to move it below (after) the "leveling_function" Call function box. My leveling_function must be run~executed~activated BEFORE an adder~increaser of the "player.turns" script (which this adder script is contained within the called upon function: "game_turn_function"). The "leveling_function" call function box, should now correctly be above (before) the "game_turn_function" call function box below (after).

in code, it'll look like this:

<turnscript name="global_game_turns">
<enabled />
<script>
leveling function
game_turns_function
</script>
</turnscript>


whereas, you had it wrongly like this:

<turnscript name="global_game_turns">
<enabled />
<script>
game_turn_function
leveling function
</script>
</turnscript>


3. in your intro_function, I notice that you don't seem to quite understand an important concept.

once you set ("SAVE") the "result" to an "object.attribute", you can now use that "object.attribute" (which is the point of doing this), instead of "result".

for example:

choose class: archer, warrior, mage

I choose: "warrior"

the "show menu" script internally temporarily (locally) sets "result" = "warrior"

and then when you do this:

player.class = result

you're now PERMANENTLY~GLOBALLY setting it to this: player.class = warrior

you got to think of it "right to left"

result <- warrior
player.class <- result ( <- warrior)
player.class <- warrior

or, if you know math, it's algebraic substitution

A (result) = 10 (warrior)

B (player.class) = A (result)

B (player.class) = 10 (warrior)

and now, instead of using "player.class=result", you can use: "player.class = warrior", so:

if (player.class = warrior), then call "warrior class" function
else if (player.class = mage), then call "mage class" function
else, then call "archer class" function

the reasons for doing this:

1. "result" is not a permanent~global "Setting~Saving", which allows you to use it again and again anywhere, and thus you can't do this, as it's only a temporary~local "Setting~Saving".

2. "result" is used often, and thus you'll have a problem as you use "result" to be your class_choice and your race_choice, as it can't be both of these, lol. for example:

result = human_race
result = warrior_class

if (result = human_race), then do this...

ERROR, there is no "result=human_race".

This is because, "result= warrior_class" RE-SETS "result=human_race" to now being "result=warrior_class".

Also, there's this issue too:

result = human (race)
result = warrior (class)

player.race=result

player.race=warrior

no! I don't want "warrior" as my race, lol

onimike
17 Aug 2013, 23:33
HegemonKhan wrote:Can you give some specific things that aren't working in your game, so we can work on fixing them, one thing at a time, it'd make it easier for me anyways, as it's hard to scour through your game, trying to figure out what you want done, and thus then looking for the problems that you have with doing the stuff you want done.

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

what's publically available so far, is what is publically available so far, lol. Be patient and hope others will provide more coding, or try to slowly learn to code on your own ~ making your own code (and share it with us... or keep it to yourself, but then you'll have to listen to new noobs asking for such coding too... lol) that you need for building~making your game. Libraries are blue prints, it's up to you to use them to build your own stuff, and asking people to code (ie make) your game, is asking quite a lot of them. Asking for more "in-depth" coding beyond a "blue print" library's coding, is basically asking them to code in your game for you... I'll try to do what I can to help, but it's a lot of work to help others, as I am also trying to work on learning more at coding for progressing on my own game making, on top of the busy-ness of my real world life, lol.

here's the link to the libraries: ( viewforum.php?f=18 )

check out these Libraries, in particular:

Hint Coding (Pixie): ( viewtopic.php?f=18&t=3802 )
Journal Coding (Pixie): ( viewtopic.php?f=18&t=2610 )
Shop Coding: ( viewtopic.php?f=18&t=2557 )
Score Coding: ( viewtopic.php?f=18&t=2627 )

and whatever you can find is this discussion forum, in its threads~posts, too.

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

whether working with code or the GUI~Editor, both requires "code~computer logic" thinking~mindset of your brain, which isn't easy to shift your brain's thinking this way. The brain is far beyond non-organic circuitry, we have no clue that we're actually communicating just as a computer does, through the use of "ifs", ie Conditionals, (orc is not dead -> if orc is not dead -> then, fight with orc -> you kill orc ~hopefully~ and now it is "dead", lol -> try to fight with orc again -> if orc is dead -> and since the orc is indeed now dead -> then, you fail to fight with it, as it is dead) and "3-way handshakes" ( 1~"hi, and did you hear me?" -> 2~"yes, I heard you, you said, hi, correct?" -> 3~"yes, indeed, I said hi to you" -> 1~"ah, good, and now I'm saying hi back to you, and did you hear me say hi back to you? -> etc etc etc). But for computers, we've and they've got to literally spell this out to them and themselves as part of the communication, and that's~this' what we call "coding", hehe.


I think it would be great if I knew exactly where to input a code at then I could just fiddle around with some already posted codes :)

onimike
18 Aug 2013, 00:05
Thanks yeah I didn't change a lot but got more figured out and basically all of it runs besides a couple hiccups. As I spend more time changing scripts I learning what kind of coding to put in them. I will upload my latest version so far I got the name, class, stats, health, couple basic items like gold and exp potion, 1 little quest where you take the orb from an oldman and give it to jane at the village inn then go back to him and receive the potion just as a demo also take the gold to jane at the inn to rent a room. like I said couple hiccups but not a finished game just starting actually, but mostly I wanted to incorporate a combat system with multiple weapons and spells. I tried to use the last combat system you set me but couldn't find the "When Ready" script to make it happen. Also want the combat to go off of stats not just attack for instance ( using str vs str in melee combat, dex vs dex in ranged combat such as bows int vs int vs spells/magic like abilities) I do know how to jut use the randomchance50 but want it to actually add in the stat difference so it leans toward the highest stat rather it just being 50% possibility of either or. If Possible! just want to make a big text rpg to play for several days meeting new npc's, collecting metal srcaps taking them to the black smith to forge you a weapon at a discount, Idk if a game like this exist already but I haven't found one yet :( so wanted to put one out. Thanks
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Mystic Mages">
<gameid>7b455ee2-72c1-42e0-a111-09eb20b79ca1</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<showhealth type="boolean">false</showhealth>
<showscore type="boolean">false</showscore>
<gridmap type="boolean">false</gridmap>
<start type="script">
intro_function
</start>
<onhealthzero type="script">
finish
</onhealthzero>
<object name="monsters">
<inherit name="editor_object" />
<inherit name="maleplural" />
<object name="zombie">
<inherit name="editor_object" />
<dead type="boolean">false</dead>
<dexterity type="int">1</dexterity>
<attack type="script"><![CDATA[
if (zombie.dead=false) {
if (RandomChance(50)) {
}
else if ("player.weapon " "><" "zombie.dexterity ") {
player_damage =
}
}
]]></attack>
<strength type="int">8</strength>
<intelligence type="int">-5</intelligence>
<health type="int">10</health>
</object>
<object name="spider">
<inherit name="editor_object" />
<strength type="int">3</strength>
<dexterity type="int">5</dexterity>
<intelligence type="int">4</intelligence>
<health type="int">8</health>
<dead type="boolean">false</dead>
</object>
<object name="necromancer">
<inherit name="editor_object" />
<intelligence type="int">8</intelligence>
<strength type="int">3</strength>
<dexterity type="int">4</dexterity>
<health type="int">13</health>
<dead type="boolean">false</dead>
</object>
<object name="maruader">
<inherit name="editor_object" />
<health type="int">12</health>
<strength type="int">4</strength>
<dexterity type="int">5</dexterity>
<intelligence type="int">5</intelligence>
<dead type="boolean">false</dead>
</object>
</object>
</game>
<object name="living room">
<alias>Cottage Home</alias>
<object name="upstairs">
<inherit name="editor_room" />
<alias>stairs</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<object name="bedroom1">
<inherit name="openable" />
<alias>your bedroom</alias>
<visible type="boolean">false</visible>
<beforefirstenter type="script">
</beforefirstenter>
<beforeenter type="script">
</beforeenter>
<object name="bed1">
<inherit name="editor_object" />
<alias>bed</alias>
</object>
<object name="dresser1">
<inherit name="editor_object" />
<inherit name="container_open" />
<alias>dresser</alias>
<isopen type="boolean">false</isopen>
<hidechildren type="boolean">false</hidechildren>
<listchildren />
<object name="gold_piece">
<inherit name="editor_object" />
<take />
<use type="boolean">false</use>
<usemenuprompt type="string"></usemenuprompt>
<alt type="stringlist">
<value>gold</value>
<value>money</value>
<value>cash</value>
<value>currency</value>
</alt>
<attr name="value_worth" type="script">
if (Got(gold_piece)) {
player.gold = player.gold + 5
}
else if (not Got(gold_piece)) {
player.gold = player.gold - 5
}
</attr>
<ontake type="script">
do (gold_piece, "value_worth")
</ontake>
<ondrop type="script">
player.gold = player.gold - 5
</ondrop>
<giveto type="scriptdictionary">
<item key="Jane">
</item>
</giveto>
</object>
</object>
<object name="closest">
<inherit name="openable" />
<dark />
</object>
<exit alias="hall" to="upstairs">
<inherit name="southeastdirection" />
</exit>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<statusattributes type="stringdictionary">
<item>
<key>strength</key>
<value></value>
</item>
<item>
<key>dexterity</key>
<value></value>
</item>
<item>
<key>intelligence</key>
<value></value>
</item>
<item>
<key>level</key>
<value></value>
</item>
<item>
<key>class</key>
<value></value>
</item>
<item>
<key>experience</key>
<value></value>
</item>
<item>
<key>turns</key>
<value></value>
</item>
<item>
<key>health</key>
<value></value>
</item>
<item>
<key>gold</key>
<value></value>
</item>
</statusattributes>
<strength type="int">0</strength>
<dexterity type="int">0</dexterity>
<intelligence type="int">0</intelligence>
<level type="int">0</level>
<class>mage; archer; warrior;</class>
<experience type="int">0</experience>
<turns type="int">0</turns>
<health type="int">0</health>
<dead type="boolean">false</dead>
<gold type="int">0</gold>
<fireball type="script">
if (player.class + result = "mage") {
player.intelligence = player.intelligence = player.fireball
}
</fireball>
<attr name="ice_blast" type="script">
if (player.class + result = "mage") {
player.intelligence = player.intelligence = player.ice_blast
}
</attr>
<attr name="lighting_bolt" type="script">
if (player.class + result = "mage") {
player.intelligence = player.intelligence = player.lighting_bolt
}
</attr>
<attr name="health_recharge" type="script">
if (player.class + result = "mage") {
player.intelligence = player.intelligence = player.health_regain
}
</attr>
<lighting type="string"></lighting>
<attr name="regain_health" type="string"></attr>
</object>
</object>
<object name="bedroom2">
<inherit name="openable" />
<alias>brothers room</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<visible type="boolean">false</visible>
<object name="bed">
<inherit name="editor_object" />
</object>
<object name="end table">
<inherit name="editor_object" />
</object>
<exit alias="hall" to="upstairs">
<inherit name="southwestdirection" />
</exit>
</object>
<exit alias="down" to="living room">
<inherit name="downdirection" />
</exit>
<exit alias="your room" to="bedroom1">
<inherit name="northwestdirection" />
<locked type="boolean">false</locked>
</exit>
<exit alias="brothers room" to="bedroom2">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="kitchen">
<object name="den">
<inherit name="editor_room" />
<exit alias="up" to="kitchen">
<inherit name="updirection" />
</exit>
</object>
<exit alias="down" to="den">
<inherit name="downdirection" />
</exit>
<exit alias="east" to="living room">
<inherit name="eastdirection" />
</exit>
</object>
<exit alias="out" to="front lawn">
<inherit name="outdirection" />
</exit>
<exit alias="up" to="upstairs">
<inherit name="updirection" />
</exit>
<exit alias="west" to="kitchen">
<inherit name="westdirection" />
</exit>
<object name="chair">
<inherit name="editor_object" />
<sit type="script">
msg ("No time to sit got to get busy!")
</sit>
</object>
<object name="couch">
<inherit name="editor_object" />
<sit>No time to lounge got to get busy!</sit>
</object>
</object>
<object name="restroom">
<alias>outhouse</alias>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<dark />
<object name="sink">
<inherit name="editor_object" />
</object>
<exit alias="southeast" to="front lawn">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="front lawn">
<inherit name="editor_room" />
<exit alias="in" to="living room">
<inherit name="indirection" />
</exit>
<exit alias="northwest" to="restroom">
<inherit name="northwestdirection" />
</exit>
<exit alias="south" to="road">
<inherit name="southdirection" />
</exit>
<object name="npc">
<inherit name="editor_object" />
<alias>oldman</alias>
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<look>Its an oldman with long white beard and old ratty clothes.</look>
<speak type="script">
firsttime {
questions1 = NewStringList()
list add (questions1, "yes")
list add (questions1, "no")
ShowMenu ("Will you do me a favor?", questions1, false) {
if (result="yes") {
msg ("Oh thank you child, my bones can't carry me that far.")
msg ("Here! Take this orb to Jane at the Village Inn.")
MoveObject (orb, player)
msg ("Return to me and I will give you the potion.")
set (Jane, "orbtask", true)
}
else if (result="no") {
msg ("Maybe tommorow then.")
}
}
}
otherwise {
if (Jane.orbtask = true) {
msg ("You will have your reward as soon as Jane gets the orb..")
}
else if (Jane.orbtask = false) {
msg ("Thank you so much. Here you go!")
MoveObject (exp potion, player)
}
msg ("Hello beautiful day!")
}
</speak>
<object name="orb">
<inherit name="editor_object" />
<take />
<look>Its a shiny black orb..</look>
<givesingle />
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
</inventoryverbs>
<givemenuprompt>Jane</givemenuprompt>
</object>
<object name="exp potion">
<inherit name="editor_object" />
<take />
<drink type="script">
player.experience = player.experience + 15
RemoveObject (exp potion)
</drink>
</object>
</object>
</object>
<object name="humble way">
<inherit name="editor_room" />
<object name="village square">
<object name="guild hall">
<object name="achers guild">
<object name="allen the archer">
<inherit name="editor_object" />
<inherit name="namedmale" />
</object>
<exit alias="southeast" to="guild hall">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="mage guild">
<object name="maggie the mage">
<inherit name="editor_object" />
<inherit name="namedfemale" />
</object>
<exit alias="southwest" to="guild hall">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="warrior guild">
<object name="larry the warrior">
<inherit name="editor_object" />
<inherit name="namedmale" />
</object>
<exit alias="northeast" to="guild hall">
<inherit name="northeastdirection" />
</exit>
</object>
<exit alias="down" to="village square">
<inherit name="downdirection" />
</exit>
<exit alias="northwest" to="achers guild">
<inherit name="northwestdirection" />
</exit>
<exit alias="northeast" to="mage guild">
<inherit name="northeastdirection" />
</exit>
<exit alias="southwest" to="warrior guild">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="general store">
<object name="tom">
<inherit name="editor_object" />
<inherit name="namedmale" />
</object>
<object name="tent">
<inherit name="editor_object" />
</object>
<object name="bedroll">
<inherit name="editor_object" />
</object>
<object name="flask">
<inherit name="editor_object" />
</object>
<object name="rations">
<inherit name="editor_object" />
</object>
<exit alias="northwest" to="village square">
<inherit name="northwestdirection" />
</exit>
</object>
<object name="village square inn">
<exit alias="southwest" to="village square">
<inherit name="southwestdirection" />
</exit>
<object name="front desk">
<inherit name="editor_object" />
<inherit name="container_open" />
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<close type="boolean">false</close>
<isopen />
<open type="boolean">false</open>
<onopen type="script">
MakeObjectVisible (Jane)
</onopen>
<object name="Jane">
<inherit name="editor_object" />
<inherit name="namedfemale" />
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<orbtask type="boolean">false</orbtask>
<speak type="script">
questions = NewStringList()
list add (questions, "yes")
list add (questions, "no")
ShowMenu ("Would you like a room today only 5G?", questions, false) {
msg ("-" + result)
if (result="yes") {
if (Got(gold_piece)) {
MoveObject (gold_piece, Jane)
if (not Got(gold_piece)) {
player.gold = player.gold - 5
msg ("Enjoy your stay!")
MoveObject (key, player)
room_renting
}
}
}
else if (result="no") {
msg ("Ok thank you have a nice day.")
}
}
</speak>
<give type="scriptdictionary">
<item key="orb">
MoveObject (orb, Jane)
set (Jane, "orbtask", false)
msg ("Thank you so much!")
</item>
<item key="gold_piece">
MoveObject (key, player)
</item>
</give>
<object name="key">
<inherit name="editor_object" />
<alt type="stringlist">
<value>door</value>
</alt>
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<look>It has a peep hole and the #1 on the front of the door.</look>
<selfuseon type="scriptdictionary">
<item key="room1">
UnlockExit (room_key)
</item>
</selfuseon>
</object>
</object>
</object>
<object name="room1">
<inherit name="container_open" />
<inherit name="container_lockable" />
<locked />
<canlockopen type="boolean">false</canlockopen>
<isopen type="boolean">false</isopen>
<key type="object">key</key>
<onunlock type="script">
</onunlock>
<goto type="script">
if (room1.locked = false) {
MoveObject (player, room1)
}
else if (room1.locked = true) {
msg ("Door is locked you need a room key!")
}
else if (not Contains (player,key)) {
msg ("You can't go in with out a key..")
}
</goto>
<exit alias="southeast" to="village square inn">
<inherit name="southeastdirection" />
</exit>
<object name="bed2">
<inherit name="editor_object" />
<alias>bed</alias>
<attr name="lay_down" type="script">
MoveObject (player, bed2)
EnableTimer (sleep_timer)
</attr>
</object>
<object name="night_stand">
<inherit name="editor_object" />
</object>
</object>
<object name="room2">
<inherit name="container_open" />
<inherit name="container_lockable" />
<isopen type="boolean">false</isopen>
<exit alias="south" to="village square inn">
<inherit name="southdirection" />
</exit>
</object>
<object name="room3">
<inherit name="container_open" />
<inherit name="container_lockable" />
<isopen type="boolean">false</isopen>
<exit alias="southwest" to="village square inn">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="room4">
<inherit name="container_open" />
<inherit name="container_lockable" />
<isopen type="boolean">false</isopen>
<exit alias="west" to="village square inn">
<inherit name="westdirection" />
</exit>
</object>
<exit alias="out" to="village square">
<inherit name="outdirection" />
</exit>
</object>
<exit alias="out" to="humble way">
<inherit name="outdirection" />
</exit>
<exit alias="up" to="guild hall">
<inherit name="updirection" />
</exit>
<exit alias="in" to="village square inn">
<inherit name="indirection" />
</exit>
<exit alias="southeast" to="general store">
<inherit name="southeastdirection" />
</exit>
<exit alias="southwest" to="blacksmith">
<inherit name="southwestdirection" />
</exit>
</object>
<exit alias="north" to="light forest">
<inherit name="northdirection" />
</exit>
<exit alias="in" to="village square">
<inherit name="indirection" />
</exit>
</object>
<object name="forest way">
<inherit name="editor_room" />
<object name="forest trail">
<inherit name="editor_room" />
<object name="light forest">
<object name="thick forest">
<object name="dark forest">
<exit alias="northwest" to="woods2">
<inherit name="northwestdirection" />
</exit>
</object>
<exit alias="east" to="light forest">
<inherit name="eastdirection" />
</exit>
<exit alias="northeast" to="woods2">
<inherit name="northeastdirection" />
</exit>
<exit alias="southwest" to="trail1">
<inherit name="southwestdirection" />
</exit>
</object>
<exit alias="north" to="woods2">
<inherit name="northdirection" />
</exit>
<exit alias="west" to="woods5">
<inherit name="westdirection" />
</exit>
<exit alias="south" to="humble way">
<inherit name="southdirection" />
</exit>
</object>
<exit alias="southeast" to="woods1">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="woods1">
<inherit name="editor_room" />
<exit alias="northeast" to="woods">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="woods2">
<inherit name="editor_room" />
<exit alias="west" to="woods">
<inherit name="westdirection" />
</exit>
<exit alias="southwest" to="thick forest">
<inherit name="southwestdirection" />
</exit>
<exit alias="south" to="light forest">
<inherit name="southdirection" />
</exit>
</object>
<object name="woods">
<inherit name="editor_room" />
<exit alias="southwest" to="woods1">
<inherit name="southwestdirection" />
</exit>
<exit alias="east" to="woods2">
<inherit name="eastdirection" />
</exit>
<exit alias="northwest" to="forest way">
<inherit name="northwestdirection" />
</exit>
</object>
<exit alias="north" to="roadway1">
<inherit name="northdirection" />
</exit>
<exit alias="southeast" to="woods">
<inherit name="southeastdirection" />
<runscript type="boolean">false</runscript>
</exit>
</object>
<object name="road">
<exit alias="north" to="front lawn">
<inherit name="northdirection" />
</exit>
<object name="roadway1">
<exit alias="east" to="road">
<inherit name="eastdirection" />
</exit>
<exit alias="south" to="forest way">
<inherit name="southdirection" />
</exit>
</object>
<object name="roadway2">
<exit alias="west" to="road">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="traders route">
<inherit name="eastdirection" />
</exit>
</object>
<exit alias="west" to="roadway1">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="roadway2">
<inherit name="eastdirection" />
</exit>
<exit alias="south" to="road">
<inherit name="southdirection" />
<lookonly />
<look>A mass of forest sits theres but it looks a little thin in spots.</look>
</exit>
</object>
<object name="trail1">
<inherit name="editor_room" />
<exit alias="northeast" to="thick forest">
<inherit name="northeastdirection" />
</exit>
<exit alias="south" to="trail2">
<inherit name="southdirection" />
</exit>
<exit alias="southeast" to="woods4">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="trail2">
<inherit name="editor_room" />
<exit alias="north" to="trail1">
<inherit name="northdirection" />
</exit>
<exit alias="southeast" to="Mystical Mage">
<inherit name="southeastdirection" />
</exit>
<exit alias="west" to="woods3">
<inherit name="westdirection" />
</exit>
</object>
<object name="woods3">
<inherit name="editor_room" />
<exit alias="east" to="trail2">
<inherit name="eastdirection" />
</exit>
</object>
<object name="woods4">
<inherit name="editor_room" />
<exit alias="northwest" to="trail1">
<inherit name="northwestdirection" />
</exit>
</object>
<object name="woods5">
<inherit name="editor_room" />
<exit alias="east" to="light forest">
<inherit name="eastdirection" />
</exit>
</object>
<object name="Mystical Mage">
<inherit name="editor_room" />
<exit alias="northwest" to="trail2">
<inherit name="northwestdirection" />
</exit>
</object>
<object name="blacksmith">
<inherit name="editor_room" />
<exit alias="northeast" to="village square">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="traders route">
<inherit name="editor_room" />
<exit alias="west" to="roadway2">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="traders route 1">
<inherit name="eastdirection" />
</exit>
</object>
<object name="traders route 1">
<inherit name="editor_room" />
<exit alias="west" to="traders route">
<inherit name="westdirection" />
</exit>
<exit alias="east" to="traders route 2">
<inherit name="eastdirection" />
</exit>
</object>
<object name="traders route 2">
<inherit name="editor_room" />
<exit alias="west" to="traders route 1">
<inherit name="westdirection" />
</exit>
<exit alias="northeast" to="traders square">
<inherit name="northeastdirection" />
</exit>
</object>
<object name="traders square">
<inherit name="editor_room" />
<exit alias="southwest" to="traders route 2">
<inherit name="southwestdirection" />
</exit>
<exit alias="in" to="traders market">
<inherit name="indirection" />
</exit>
</object>
<object name="traders market">
<inherit name="editor_room" />
<exit alias="out" to="traders square">
<inherit name="outdirection" />
</exit>
<exit alias="northwest" to="traders hall">
<inherit name="northwestdirection" />
</exit>
<exit alias="southwest" to="traders pub">
<inherit name="southwestdirection" />
</exit>
</object>
<object name="traders hall">
<inherit name="editor_room" />
<exit alias="southeast" to="traders market">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="gambling hall">
<inherit name="editor_room" />
</object>
<object name="traders pub">
<inherit name="editor_room" />
<exit alias="northeast" to="traders market">
<inherit name="northeastdirection" />
</exit>
</object>
<turnscript name="global_game_turns">
<enabled />
<script>
game_turn_function
leveling function
</script>
</turnscript>
<verb>
<property>givejane</property>
<pattern>givejane</pattern>
<defaultexpression>"You can't givejane " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>goto</property>
<pattern>goto</pattern>
<defaultexpression>"You can't goto " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>lay_down</property>
<pattern>lay_down</pattern>
<defaultexpression>"You can't lay_down " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>attack</property>
<pattern>attack</pattern>
<defaultexpression>"You can't attack " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>use_spell</property>
<pattern>use_spell</pattern>
<defaultexpression>"You can't use_spell " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>lighting</property>
<pattern>lighting</pattern>
<defaultexpression>"You can't lighting " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>regain_health</property>
<pattern>regain_health</pattern>
<defaultexpression>"You can't regain_health " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>fireball</property>
<pattern>fireball</pattern>
<defaultexpression>"You can't fireball " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>ice_blast</property>
<pattern>ice_blast</pattern>
<defaultexpression>"You can't ice_blast " + object.article + "."</defaultexpression>
</verb>
<function name="intro_function">
msg ("A vast land where monsters roam and evil lurks, the people of Villagoplia thrive to survive in these troubled lands. Lives lost and wars raged but we still live they will conquer us and we will not lye down and die.....")
msg ("......................................................................................................................")
msg ("......................................................")
wait {
msg ("Whats your name?")
get input {
msg ("Hello " + result)
genderlist = NewStringList()
list add (genderlist, "male")
list add (genderlist, "female")
ShowMenu ("Whats your gender?", genderlist, false) {
player.gender = result
classlist = NewStringList()
list add (classlist, "mage")
list add (classlist, "warrior")
list add (classlist, "archer")
ShowMenu ("What class would you like to be?", classlist, false) {
player.class = result
msg ("You are a " + result)
if (result="mage") {
mage class
}
else if (result="warrior") {
warrior class
}
else if (result="archer") {
archer class
}
}
}
}
}
</function>
<function name="warrior class">
player.strength = player.strength + 3
player.dexterity = player.dexterity + 2
player.intelligence = player.intelligence + 1
player.health = player.health + 18
</function>
<function name="archer class">
player.intelligence = player.intelligence + 1
player.dexterity = player.dexterity + 3
player.strength = player.strength + 2
player.health = player.health + 14
</function>
<function name="mage class">
player.dexterity = player.dexterity + 2
player.strength = player.strength + 1
player.intelligence = player.intelligence + 3
player.health = player.health + 10
do (player, "spells")
</function>
<function name="leveling function"><![CDATA[
if (player.experience >= player.level * 15 + 15) {
player.experience = player.experience - (player.level * 15 + 15)
player.level = player.level + 1
switch (player.gender) {
case ("male") {
player.strength = player.strength + 1
player.dexterity = player.dexterity + 1
player.health = player.health + 2
}
case ("female") {
player.intelligence = player.intelligence + 1
player.dexterity = player.dexterity + 1
player.health = player.health + 1
}
}
switch (player.class) {
case ("warrior") {
player.strength = player.strength + 2
player.intelligence = player.intelligence + 1
player.dexterity = player.dexterity + 1
player.health = player.health + 6
}
case ("mage") {
player.intelligence = player.intelligence + 2
player.dexterity = player.dexterity + 1
player.strength = player.strength + 1
player.health = player.health + 2
}
case ("archer") {
player.intelligence = player.intelligence + 1
player.deterity = player.dexterity + 2
player.strength = player.strength + 1
player.health = player.health + 4
}
}
leveling function
}
]]></function>
<function name="fight function">
</function>
<function name="game_turn_function">
player.turns = player.turns + 1
</function>
<function name="room_renting">
if (Got(key)) {
EnableTimer (room_timer)
}
else if (Contains (Jane,key)) {
set (room1, "locked", true)
DisableTimer (room_timer)
}
</function>
<timer name="room_timer">
<interval>120</interval>
<script>
MoveObject (key, Jane)
if (game.pov.parent = room1) {
MoveObject (player, village square inn)
HelperCloseObject (room1)
}
DisableTimer (room_timer)
</script>
</timer>
<timer name="sleep_timer">
<interval>30</interval>
<script>
msg ("YAWNNN!! That was a good rest!")
MoveObject (player, room1)
player.health = player.health + 5
DisableTimer (sleep_timer)
</script>
</timer>
</asl>


Mike

HegemonKhan
18 Aug 2013, 02:01
I'll try to work on fixing more things with your game code, as I have the time, it's an extremely slow and time consuming process for me, as I'm not that good with coding nor do I know your game well at the moment. People who're better with code, will be able to help you much faster than I can, if they've too got the time, lol. Also, working on trouble shooting your own game, helps a lot with learning to code (and~or using the GUI~Editor too) more and with understanding quest in general too, but you do got to be decent with code already, to be able to trouble shoot, lol. I've been at ~ a year in trying to learn to code in quest, I've come far from being a total noob as I was, but I've not really come that far yet, lol, as coding isn't easy to learn, at least not for me.

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

so let me instead jump at helping with "simplier" things, ie a small chunk of coding ~ instead of scouring through your entire game code, lol.

GAME MECHANICS Coding:

1. first "testing challenge" for you! Can you understand how this works and explain exactly what it does (this took me a while to craft myself, as game mechanic crafting isn't easy, lol):

<function name="leveling_function"><![CDATA[
if (game.pov.experience_points >= game.pov.level * 100 + 100) {
game.pov.experience_points = game.pov.experience_points - (game.pov.level * 100 + 100)
game.pov.level = game.pov.level + 1
leveling_function
}
]]></function>


here's another Game Mechanic that I crafted: "who goes first"

you_go_first=false
if (GetInt (self,"speed") > GetInt (enemy,"speed") {
you_go_first=true
} else if (GetInt (self,"speed") = GetInt (enemy,"speed") and RandomChance (50)=true) {
you_go_first=true
}
if (you_go_first=true) {
self_battle_turn_function
} else {
enemy_battle_turn_function
}


now, let's look at an "evasion" Game Mechanic:

if (RandomChance (GetInt (enemy,"agility") - GetInt (self,"speed")) = true) {
msg (enemy.alias + "evaded your attack!")
}


a "parrying" Game Mechanic:

if (RandomChance (GetInt (enemy,"dexterity") - GetInt (self,"agility")) = true) {
msg (enemy.alias + "parried your attack!")
}


and here is the rest of the factors put together in full:

show menu ("What is your battle choice?", split ("Attack;Defend;Cast;Item;Run", ";"), false) {
switch (result) {
case ("Attack") {
self_attack_failed = false
if (RandomChance (GetInt (enemy,"agility") - GetInt (self,"speed")) = true) {
msg (enemy.alias + "evaded your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"dexterity") - GetInt (self,"agility")) = true) {
msg (enemy.alias + "parried your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"agility") - GetInt (self,"dexterity")) = true) {
msg (enemy.alias + "blocked your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (self,"dexterity") - GetInt (enemy,"speed")) = false) {
msg ("Your attack missed " + enemy.alias +"!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"armor_class") - GetInt (self,"attack_rating")) = true) {
msg ("Your attack failed to penetrate " + enemy.alias +"!")
self_attack_failed = true
self.defending = false
}


and here is a (somewhat) complex damage equation:

(write it out on paper to understand it)

else if (self_attack_failed = false) {
// you're attacking the enemy for damage
if (self.defending = true and enemy.defending = true) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * 2 * GetInt (self,"physical_damage") / 2 + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
self.defending = false
}
}

<function name="critical_hit_function" parameters="target" type="int">
if (RandomChance (GetInt (target,"luck")) = true) {
value = 2
} else {
value = 1
}
return (value)
</function>


and here's my more recent combat code (it might have errors in it, as I don't think I've tested it yet, as it's just a library file of mine), in full:

<library>

<!-- New Game Code -->

<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="HK's more recent combat code">
<gameid>bbc85c01-6e80-4a71-8abf-c1e870fb5b42</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="defaultplayer" />
</object>
</object>
</asl>

<!-- Game Object -->

<game name="HK's more recent combat code">
<gameid>bbc85c01-6e80-4a71-8abf-c1e870fb5b42</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<turns type="int">0</turns>
</game>

<!-- Player Objects -->

<object name="player">
<inherit name="editor_object" />
<inherit name="defaultplayer" />
<inherit name="character_object_type" />

<alias>HK</alias>

<current_health_points type="int">999</current_health_points>
<maximum_health_points type="int">999</maximum_health_points>
<current_mana_points type="int">99</current_mana_points>
<maximum_mana_points type="int">99</maximum_mana_points>

<strength type="int">100</strength>
<endurance type="int">100</endurance>
<dexterity type="int">100</dexterity>
<agility type="int">100</agility>
<speed type="int">100</speed>
<intelligence type="int">100</intelligence>
<spirituality type="int">100</spirituality>
<mentality type="int">100</mentality>
<piety type="int">100</piety>
<luck type="int">100</luck>
</object>

<!-- Hostile NPC Objects -->

<object name="orc_1">
<inherit name="editor_object" />
<inherit name="character_object_type" />

<alias>orc child</alias>

<current_health_points type="int">999</current_health_points>
<maximum_health_points type="int">999</maximum_health_points>
<current_mana_points type="int">99</current_mana_points>
<maximum_mana_points type="int">99</maximum_mana_points>

<strength type="int">25</strength>
<endurance type="int">25</endurance>
<dexterity type="int">25</dexterity>
<agility type="int">25</agility>
<speed type="int">25</speed>
<intelligence type="int">25</intelligence>
<spirituality type="int">25</spirituality>
<mentality type="int">25</mentality>
<piety type="int">25</piety>
<luck type="int">25</luck>

<experience_points type="int">100</experience_points>
<cash type="int">50</cash>
</object>

<!-- Object Types -->

<type name="character_object_type">

<strength type="int">0</strength>
<endurance type="int">0</endurance>
<dexterity type="int">0</dexterity>
<agility type="int">0</agility>
<speed type="int">0</speed>
<intelligence type="int">0</intelligence>
<spirituality type="int">0</spirituality>
<mentality type="int">0</mentality>
<piety type="int">0</piety>
<luck type="int">0</luck>

<dead type="boolean">false</dead>

<defending type="boolean">false</defending>

<experience_points type="int">0</experience_points>
<cash type="int">0</cash>
<level type="int">0</level>

<health_points type="string">0/0</health_points>
<mana_points type="string">0/0</mana_points>

<current_health_points type="int">0</current_health_points>
<maximum_health_points type="int">0</maximum_health_points>
<current_mana_points type="int">0</current_mana_points>
<maximum_mana_points type="int">0</maximum_mana_points>

</type>

<!-- Turnscripts -->

<turnscript name="global_events_turnscript">
status_attributes_function
leveling_function
global_game_turns_function
</turnscript>

<!-- Commands -->

<command name="fight_command">
<pattern>fight #text#</pattern>
<script>
fight_function (game.pov,text)
</script>
</command>

<!-- Functions -->

<function name="fight_function" parameters="self,text">
enemy=GetObject(text)
if (enemy=null) {
foreach (obj,AllObjects()) {
if (obj.alias=text) {
enemy=obj
} else {
msg ("There seemingly is no " + text + " here.")
}
}
} else if (not check_reachable_function (enemy) = true) {
msg ("There seemingly is no " + enemy.alias + " here.")
} else if (not DoesInherit (enemy,"character_object_type")) {
msg (enemy.alias + "is seemingly not something that you can battle.")
} else if (GetBoolean (enemy,"hostile") = false) {
msg (enemy.alias + " is seemingly not something that you can battle.")
} else if (GetBoolean (enemy,"dead") = true) {
msg (enemy.alias + " is already dead.")
} else {
battle_sequence_function (self,enemy)
}
</function>

<function name="battle_sequence_function" parameters="self,enemy"><![CDATA[
if (enemy.dead=false) {
you_go_first=false
if (GetInt (self,"speed") > GetInt (enemy,"speed") {
you_go_first=true
} else if (GetInt (self,"speed") = GetInt (enemy,"speed") and RandomChance (50)=true) {
you_go_first=true
}
if (you_go_first=true) {
msg ("You get to go first for this round")
self_battle_turn_function (self,enemy)
on ready {
if (not enemy.dead=true){
enemy_battle_turn_function (self,enemy)
}
}
} else {
msg (enemy.alias + " gets to go first for this round.")
enemy_battle_turn_function (self,enemy)
on ready {
if (not enemy.dead=true){
msg ("It is now your turn.")
self_battle_turn_function (self,enemy)
}
}
}
on ready {
msg ("The round has ended.")
battle_sequence_function (self,enemy)
}
} else {
msg ("The battle is over.")
}
]]></function>

<function name="self_battle_turn_function" parameters="self,enemy"><![CDATA[
msg (self.alias + " has " + self.current_health_points + " HP left.")
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
wait {
show menu ("What is your battle choice?", split ("Attack;Defend;Cast;Item;Run", ";"), false) {
switch (result) {
case ("Attack") {
self_attack_failed = false
if (RandomChance (GetInt (enemy,"agility") - GetInt (self,"speed")) = true) {
msg (enemy.alias + "evaded your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"dexterity") - GetInt (self,"agility")) = true) {
msg (enemy.alias + "parried your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"agility") - GetInt (self,"dexterity")) = true) {
msg (enemy.alias + "blocked your attack!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (self,"dexterity") - GetInt (enemy,"speed")) = false) {
msg ("Your attack missed " + enemy.alias +"!")
self_attack_failed = true
self.defending = false
} else if (RandomChance (GetInt (enemy,"armor_class") - GetInt (self,"attack_rating")) = true) {
msg ("Your attack failed to penetrate " + enemy.alias +"!")
self_attack_failed = true
self.defending = false
} else if (self_attack_failed = false) {
if (self.defending = true and enemy.defending = true) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * 2 * GetInt (self,"physical_damage") / 2 + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
self.defending = false
} else if (self.defending = true and enemy.defending = false) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * 2 * GetInt (self,"physical_damage") + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
self.defending = false
} else if (self.defending = false and enemy.defending = true) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * GetInt (self,"physical_damage") / 2 + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
} else if (self.defending = false and enemy.defending = false) {
enemy.current_health_points = enemy.current_health_points - (critical_hit_function (self) * GetInt (self,"physical_damage") + GetInt (self,"physical_damage") * (GetInt (self,"strength") - GetInt (enemy,"endurance")) / 100)
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
}
}
}
case ("Defend") {
msg ("You defend yourself against " + enemy.alias)
self.defending = true
}
case ("Cast") {
self.defending = false
}
case ("Item") {
self.defending = false
}
case ("Run") {
self.defending = false
}
}
if (GetInt (enemy,"current_health_points") > 0) {
if ( RandomChance (GetInt (self,"speed") - GetInt (enemy,"speed"))= true) {
msg ("You get an extra battle turn!")
self_battle_turn (self,enemy)
} else {
msg ("Your battle turn is over.")
}
} else if (GetInt (enemy,"current_health_points") <= 0) {
msg (enemy.alias + " is dead.")
msg ("You have won the battle!")
self.defending = false
enemy.defending = false
enemy.dead = true
}
}
}
]]></function>

<function name="enemy_battle_turn_function" parameters="self,enemy"><![CDATA[
msg (self.alias + " has " + self.current_health_points + " HP left.")
msg (enemy.alias + " has " + enemy.current_health_points + " HP left.")
result = GetRandomInt (1,3)
switch (result) {
case (1) {
enemy_attack_failed = false
if (RandomChance (GetInt (self,"agility") - GetInt (enemy,"speed")) = true) {
msg ("You have evaded the attack!")
enemy_attack_failed = true
enemy.defending = false
} else if (RandomChance (GetInt (self,"dexterity") - GetInt (enemy,"agility")) = true) {
msg ("You have parried the attack!")
enemy_attack_failed = true
enemy.defending = false
} else if (RandomChance (GetInt (self,"agility") - GetInt (enemy,"dexterity")) = true) {
msg ("You have blocked the attack!")
enemy_attack_failed = true
enemy.defending = false
} else if (RandomChance (GetInt (enemy,"dexterity") - GetInt (self,"speed")) = false) {
msg (enemy.alias +"'s attack missed!")
enemy_attack_failed = true
enemy.defending = false
} else if (RandomChance (GetInt (self,"armor_class") - GetInt (enemy,"attack_rating")) = true) {
msg ("You weren't penetrated by the attack!")
enemy_attack_failed = true
enemy.defending = false
} else if (enemy_attack_failed = false) {
if (enemy.defending = true and self.defending = true) {
self.current_health_points = self.current_health_points - (critical_hit_function (enemy) * 2 * GetInt (enemy,"physical_damage") / 2 + GetInt (enemy,"physical_damage") * (GetInt (enemy,"strength") - GetInt (self,"endurance")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
enemy.defending = false
} else if (enemy.defending = true and self.defending = false) {
self.current_health_points = self.current_health_points - (critical_hit_function (enemy) * 2 * GetInt (enemy,"physical_damage") + GetInt (enemy,"physical_damage") * (GetInt (enemy,"strength") - GetInt (self,"endurance")) / 100)
msg (self.alias + " has " + self.current_health_points + " HP left.")
enemy.defending = false
} else if (enemy.defending = false and self.defending = true) {
self.current_health_points = self.current_health_points - (critical_hit_function (enemy) * GetInt (enemy,"physical_damage") / 2 + GetInt (enemy,"physical_damage") * (GetInt (enemy,"strength") - GetInt (self,"endurance")) / 100)
msg (self.alias + " has " + self.current_health_points + " HP left.")
} else if (enemy.defending = false and self.defending = false) {
self.current_health_points = self.current_health_points - (critical_hit_function (enemy) * GetInt (enemy,"physical_damage") + GetInt (enemy,"physical_damage") * (GetInt (enemy,"strength") - GetInt (self,"endurance")) / 100)
msg (self.alias + " has " + self.current_health_points + " HP left.")
}
}
}
case (2) {
msg (enemy.alias + " has choosen to defend itself.")
enemy.defending = true
}
case (3) {
enemy.defending = false
msg ("Cast")
}
}
if (GetInt (self,"current_health_points") > 0) {
if (RandomChance (GetInt (enemy,"speed") - GetInt (self,"speed")) = true) {
msg (enemy.alias + " gets an extra battle turn!")
wait {
enemy_battle_turn (self,enemy)
}
} else {
msg (enemy.alias + " 's battle turn is over.")
}
} else if (GetInt (self,"current_health_points") <= 0) {
msg (self.alias + " has died.")
msg ("GAME OVER")
finish
}
]]></function>

<function name="check_reachable_function" parameters="enemy" type="boolean">
foreach (obj,ScopeReachableNotHeld ()) {
if (obj=enemy) {
value = true
} else {
value = false
}
}
return (value)
</function>

<function name="critical_hit_function" parameters="target" type="int">
if (RandomChance (GetInt (target,"luck")) = true) {
value = 2
} else {
value = 1
}
return (value)
</function>

<function name="leveling_function"><![CDATA[
if (game.pov.experience_points >= game.pov.level * 100 + 100) {
game.pov.experience_points = game.pov.experience_points - (game.pov.level * 100 + 100)
game.pov.level = game.pov.level + 1
level_up_function
}
]]></function>

<function name="status_attributes_function">
game.pov.health_points = game.pov.current_health_points + "/" + game.pov.maximum_health_points
game.pov.mana_points = game.pov.current_mana_points + "/" + game.pov.maximum_mana_points
</function>

</library>

HegemonKhan
18 Aug 2013, 02:36
here's just a part of my damage mechanics:

(I'm still working on understanding equipment coding better, so no equipment mechanics implemented~crafted into my combat mechanics yet)

for example:

"player" ~ game.pov ~ "self" = "HK"
"text" ~ "enemy" = "orc"

(HK.strength - orc.endurance) x (HK.physical_damage) + (HK.physical_damage)
..............100.............

so for example:

HK.strength = 100
orc.endurance = 25
HK.physical_damage = 10

(100 - 25) x (10) + (10)
..100..

(75/100) x (10) + (10)
(3/4) x (10) + (10)
(0.75) x (10) + (10)
(7.5) + (10)
7.5 + 10 = 17.5

HK.strength = 100
orc.endurance = 25
HK.physical_damage = 50

(100 - 25) x (50) + (50)
..100..

(75/100) x (50) + (50)
(3/4) x (50) + (50)
(0.75) x (50) + (50)
(37.5) + (50)
37.5 + 50 = 87.7

HK.strength = 100
orc.endurance = 75
HK.physical_damage = 10

(100 - 75) x (10) + (10)
..100..

(25/100) x (10) + (10)
(1/4) x (10) + (10)
(0.25) x (10) + (10)
(2.5) + (10)
2.5 + 10 = 12.5

HK.strength = 100
orc.endurance = 75
HK.physical_damage = 50

(100 - 75) x (50) + (50)
..100..

(25/100) x (50) + (50)
(1/4) x (50) + (50)
(0.25) x (50) + (50)
(12.5) + (50)
12.5 + 50 = 62.5

This has a problem if the orc's endurance is greater than HK's strength... I need to figure out how to craft code to deal with this still, lol.

HegemonKhan
18 Aug 2013, 03:10
onimike wrote:I think it would be great if I knew exactly where to input a code at then I could just fiddle around with some already posted codes


I think I just now understand what you're exactly refering to with this comment of yours, lol. I am presuming (fingers crossed) that you're refering to the Library Codes, in how to add them to your game?

use the wiki and~or tutorial to read how to add libraries to your game, as I might not explain this fully or nor correctly, lol.

1. get (download and save on your computer where you can find it, lol) the Library Files that you want.
2. move them or copy and paste them, so that the library files are in the same folder as your Game File (which should be in the same folder as the "quest.exe" too. this is so that quest can find and access the library files and your Game File for your game)
3. then you need to add in the "references for those library files" into your game file. I'm not sure how to add libraries through the GUI~Editor, but it's really easy to do in code:

(your game file coding looks like this below when you start a new game):

<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>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="defaultplayer" />
</object>
</object>
</asl>


do you see these two code lines:

<include ref="English.aslx" />
<include ref="Core.aslx" />

these two code lines tell the quest engine to access the default "English.aslx" and "Core.aslx" Library Files, which you can find in the same folder as the "quest.exe", as this is required for the quest engine to find and access these default library files.

so, along with placing your own (or Pixie's or whoever else's, lol) Library File(s) in the same folder as your Game File and the "quest.exe", you just add in these lines (and the placement matters, you want to place them after~below the two default ref=reference=library code lines) to your Game File code, for example:

<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />

<include ref="name_of_the_library_file_that_you_want_to_add_to_this_game_of_yours.aslx" />
// for example... Pixie's Combat Library File: CombatLibrary1.aslx
// <include ref="CombatLibrary1.aslx" />
// lastly, you can add as many libraries as you want, there's no limit on them, though getting them all to work~sync together will be a problem~challenge... lol

<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="defaultplayer" />
</object>
</object>
</asl>


The added library [ via the <include ref="blah.aslx" /> code line ] puts its entire coding into your game for you, you don't have to copy and paste its code lines yourself while trying to figure out where to paste them. Most Libraries provide "TAB" codings, which gives you the ability to set the extra library stuff via the GUI~Editor, literally creating new TABs, boxes, and etc in the GUI~Editor for you to click on and etc, hehe.

start up any game file, with a quick eye you may be able to spot the fast scrolling text of ~"initializing 'core' and 'english' libraries" (or whatever it says), you're seeing the quest engine adding all the coding of these two libraries into your game (such as the "take" and "drop" verbs into your game, without the "Core" library's coding being initialized, there would be no "take" nor "drop" features in your GUI~Editor to setup nor to use either). And if you added you own libraries, you'll see it "initializing" them too in the fast scrolling text as your game is loaded up, lol. You can see~test for yourself, make a new game, and in its coding, delete the <include ref="Core.aslx" /> code line, and then start up the game, and see what happens... try the same with instead deleting the <include ref="English.aslx" /> code line, or try deleting both of them too.

but, you got to fill in the needed code lines or stuff (attributes and etc) that the library requires.

4. start up your game file, and enjoy the extra abilities in the GUI~editor for you to make your game with, from those libraries that you added to your game, hehe.

HegemonKhan
18 Aug 2013, 04:07
onimike wrote:Also want the combat to go off of stats not just attack for instance ( using str vs str in melee combat, dex vs dex in ranged combat such as bows int vs int vs spells/magic like abilities) I do know how to jut use the randomchance50 but want it to actually add in the stat difference so it leans toward the highest stat rather it just being 50% possibility of either or. If Possible!


without realizing it, you pretty much explain how to correctly do what you want, lol.

you just need to create~add the attributes to your objects ("player" and "enemies"), for examples (in quasi code):

hero_onimike.strength = 100
hero_onimike.hit_points = 999
hero_onimike.physical_damage = 500
evil_archmage.endurance = 25
evil_archmage.intelligence = 100
evil_archmage.hit_points = 9999
evil_archmage.mana_points = 999

in your "fight" Verb:

for a physical attack:

[evil_archamge.hit_points] = [evil_archmage.hit_points] - [ ( hero_onimike.strength - evil_archmage.endurance) / 100] + [ hero_onimike.physical_damage ]

and another example for something different:

if (RandomChance (onimike.armor_class - troll_axethrower.attack_rating) = true) {
-> msg ("The troll's iron axe is unable to penetrate your mithril armor. No damage is done to you!")
} else {
-> onimike.hit_points = onimike.hit_points - troll_axethrower.physical_damage
-> msg ("The troll's diamond axe slices right through your iron armor. The troll does " + troll_axethrower.physical_damage + " damage to you. You have" + onimike.hit_points + " HP remaining.")
}

for example:

onimike.armor_class = 100
troll_axethrower.attack_rating = 0

you'll ALWAYS (100% chance) of: true = true, and thus no damage to you ever, hehe.

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

Useful wiki pages for coding:

http://quest5.net/wiki/Category:All_Fun ... t_Commands
http://quest5.net/w/index.php?title=Cat ... h#mw-pages

an EXTERMELY valuable function:

http://quest5.net/wiki/GetRandomInt

GetRandomInt ( minimum_range_amount_number , maximum_range_amount_number )

you can do lots of cool stuff with this, such as A.I. behavior, and etc...

within the "fight" verb with the final boss, his "battle_turn_scripting" chunk of code:

result_x = GetRandomInt (0, 3)
switch (result_x) {
case (0) {
// attack scripts~coding
msg ("the final boss physically attacks you with his tainted cursed black humongous bloody deadly decapitation axe!")
}
case (1) {
// casting damage spells scripts~coding
msg ("the final boss casts his ultimate spell 'oblivion' upon you... gulp!")
}
case (2) {
// casting heal spells scripts~coding
msg ("the final boss casts his ultimate healing spell, he is back to full hit points!")
}
case (3) {
// vulnerability coding
msg ("the final boss is finally temporarily vulnerable, now you can do damage to him! Kick his butt like the fate of the world depends upon it!")
}
}


anotehr usage:

if (RandomChance (GetRandomInt (0,100)) = true) {
-> // blah coding
}

more usage examples:

1. onimike.strength = onimike.strength + GetRandomInt (1,5)

2. such as for a healing item or spell:

onimike.hit_points = onimike.hit_points + GetRandomInt (GetInt (onimike, "spirituality"), GetInt (onimike, "intelligence") + GetInt (onimike, "spirituality") + GetInt (onimike, "mentality"))

the code probably won't work, but meh, it's an example of how it can be used


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

P.S.

here's a way to write in code via through the GUI~Editor:

Add a~new script -> Output -> Print a message -> Print [EXPRESSION] ->

now you can write in your code, such as a game mechanic code. this way, you're doing it through the GUI~Editor, so you're already putting it into where you want it (and it'll do it for you ~ you don't have to find or figure out what scripts to use in the GUI~Editor ~ this was difficult for me, so direct coding is easier for me, lol), instead of trying to figure out where to put it into your game code itself, as all you got to do is to write what you want it to do, such as:

else ->

-> Add a~new script -> Output -> Print a message -> Print [EXPRESSION] ->

Print [EXPRESSION] if (enemy_attack_failed = false)

->-> Add a~new script -> Output -> Print a message -> Print [EXPRESSION] ->

Print [EXPRESSION] if (enemy.defending = true and self.defending = true)

->->-> Add a~new script -> Output -> Print a message -> Print [EXPRESSION] ->

Print [EXPRESSION] self.current_health_points = self.current_health_points - (critical_hit_function (enemy) * 2 * GetInt (enemy,"physical_damage") / 2 + GetInt (enemy,"physical_damage") * (GetInt (enemy,"strength") - GetInt (self,"endurance")) / 100)

the "print [EXPRESSION]" script, or in Code: msg (your_coding), is the ultimate script, it'll do any and all scripts for you, you just type in what you want (though you have to type in coding, aka it has to be correctly written, lol)

onimike
18 Aug 2013, 15:17
Yes thank you I was gonna ask so where do I put stuff like this in ""[evil_archamge.hit_points] = [evil_archmage.hit_points] - [ ( hero_onimike.strength - evil_archmage.endurance) / 100] + [ hero_onimike.physical_damage ]"" but you explained as set a variable or print message expression. I will deff be working on the library thing cause if I understand right you can put any code into it and it automatically puts it in the right spot, correct me if im wrong lol. But thank you again for all your help because I tried to find other post but their all the same at least you try to direct people where they need to go and how to go about doing it Im really gonna try to figure
the rest of this combat thing out today :)

Mike

HegemonKhan
18 Aug 2013, 22:00
well, not exactly, a library file is just extra coding that is added to a game file (if you're a gamer, than think of a library file as a "patch or expansion pack" for your game), I'm not sure of all of the rules of it, such as if you can include Game Object code lines for the main instance, anyways.

-----------

I meant that you can put any code into the GUI-Editor's "Print Message" ( Print [EXPRESSION] ) script, and it'll automatically change that code into the correct GUI~Editor scripts for you. I was NOT refering to a library file about this topic that I was talking about with you.

for example:

Add a~new script -> Output -> Print a message -> Print [EXPRESSION] -> Print [EXPRESSION] HK.strength = HK.strength + 100

even though we used the "message" script, the GUI~Editor will change it automatically for you into the:

Variables -> Set a variable or attribute script

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

I think I'm probably just confusing you with these posts, lol. As I'm explaining things as if you got a good understanding of quest and its coding already, lol.

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

first, labels (I often use the quotation marks to highlight labels in my posts) can be anything you want, you can use whatever system for naming and organizing that you want.

I use the word "label" so not to confuse it with specifically the built-in "NAME" and "ALIAS" attributues.

Also, labels must match up:

if I create a "strength" integer attribute for the "player" Player Object, then if I want to use that "strength" attribute in my "fight" verb of an "orc" Object, then I have to use exactly the same spelling, "strength", for it.

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

"where to put~add stuff~code lines?"

work with the GUI~Editor, until you're ready (or if you should ever want to) work with the code.

if you're trying to do combat, the simpliest way is to do it as a Verb of an Object, such as of an "orc or dragon or snake" Object

you add scripts (such as my somewhat complex damage script) to your "fight or attack or combat or battle" Verb

------

if you were wanting to create~add dialogue scripts usually they would be added as a "talk, speak, chat, or whatever" Verb of that Object, such as a "tavern_owner".

------

etc etc etc, not very complicated...

and if you were to or want to add scripts via in-Code:

you just need to recognize the code, so you can identify were to put in your script.

for example:

we want to add a "turns" (which starts at zero) integer attribute onto our Game Object (we're ignoring the usually desire of also making it show up in the display as you're playing the game of additional code~work~setup that is required to do this)

GUI~Editor:

Game -> Attributes (Tab) -> Attributes -> Add ->

Name: turns
Type: int (integer)
Value: 0

in-Code:

we need to know~find~recognize the Game Object code block, which is:

<game name="blah">
</game>

then we just add in our script (though we have to know how write it in code to add it correctly):

<game name="blah">
-> <turns type="int">0</turns>
</game>

anotehr example:

let's pretend we're adding in a "character_creation_function" to our "start" script of the Game Object

GUI~Editor:

Game -> Scripts (Tab) -> Start script -> Add ->

Add a~new script -> scripts (I think) -> Call Function ->

Name: character_creation_function
Value: (leave blank)

Function -> Add -> (create your "character_creation_function")

in-Code:

<game name="blah">
-> <start type="script">
->-> character_creation_function
-> </start>
</game>

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

I don't know the GUI~Editor that well, it was a bit confusing for me lol, so, but here's just some examples that I know of (hopefully correctly):

(if we could get the conversions of Code and GUI~Editor up on the wiki, that'd be really helpful, but it'd be a lot of work, lol)

IN-CODE ~ IN-GUI-EDITOR

msg ("blah") ~ Add a-new script -> Output -> Print a message -> Print [EXPRESSION] -> Print [EXPRESSION] blah blah blah

object.attribute = blah blah blah ~ Add a-new script -> Variables -> Set an attribute or variable -> set attribute [blah] blah blah

orc.dead=false -> orc.dead=true ~ Add a-new script -> Objects -> SetObjectFlagOn -> blah blah blah (however it's setup as, lol)

if (blah) ~ Add a-new script -> Scripts -> If -> add a-new script -> blah blah blah

HegemonKhan
18 Aug 2013, 22:27
most actions or events (such as combat, conversations, shopping, and etc etc) are done through the use of Objects' Verbs:

Object -> Verb (Tab) -> Add -> add the scripts to make the action or event happen, which is then activated by clicking on the object's "blah" Verb button in the right side displays or by the hyperlinks (the blue text you can click on) during game play.

there's other ways to implement actions or events into your game, but they're more advanced~complicated, such as by using COMMANDS, TURNSCRIPTS, TIMERS, and whatever other means~ways, lol.

Using the GUI-Editor, and the individual Objects' Verb Tab, is the most noob-friendly way to put actions or events into your game, as you know.

HegemonKhan
19 Aug 2013, 00:11
I just made a new thread, a guide on starting building a combat script block:

viewtopic.php?f=10&t=3872

it's very noob-friendly: STEP BY STEP IN THE GUI~EDITOR

it took me some effort and time, so hopefully you'll be appreciative, and hopefully it'll be actually helpful too, lol, hehe :D

onimike
19 Aug 2013, 03:31
HegemonKhan wrote:I just made a new thread, a guide on starting building a combat script block:

viewtopic.php?f=10&t=3872

it's very noob-friendly: STEP BY STEP IN THE GUI~EDITOR

it took me some effort and time, so hopefully you'll be appreciative, and hopefully it'll be actually helpful too, lol, hehe :D

wow very awesome !!! its funny you posted this because before you did I went to the combat library they have here and copied the code and put it in spaced twice under the library section and wouldn't you know it worked which is awesome if your starting from scratch and know how to implement into it. I will eventually learn code as I will begin my course in Itt-Tech to learn coding, programming etc. but for now this will be my beginnings lol and yes I see what you mean the codes are way simpler to see then scripting but still a pain but the scripting gets complicating also as you need basics of coding as well. Wish there was a program with every tab, button, verb, combat, etc. needed to run any basic rpg or rpg type game because doing most of it became very apparent to me but for some reason I had a heck of a time with this lol.
Thanks again

Mike

HegemonKhan
19 Aug 2013, 05:44
onimike wrote:Wish there was a program with every tab, button, verb, combat, etc. needed to run any basic rpg or rpg type game because doing most of it became very apparent to me but for some reason I had a heck of a time with this lol.


that's what I'm slowly trying to build for myself, lol. An ultimate "kit" (library) for building Quest RPGs, hehe. This will take a long long long long... lol.

I've been using quest's coding, learning it's coding and thus also learning to code somewhat in general too. Quest's coding is really noob-friendly, just take some coding such as the "character creation" code, study and learn it, then take some library's coding, study and learn it, and slowly you start to build up more coding knowledge, learning to code, to code better, and etc. The main hurdle is getting your brain~mind to think in terms of "coding logic" (and then organizing your code work too, lol). Looking at codings after codings, slowly develops your "coding logic" thinking, you see how to do things "in the code way" and after a bit your brain~mind adapts, thinking in this way, making it easier and easier to code for you. The structure of coding seems the same, but each coding language has it's own format (and more or less usage of symbols; more symbols = the less typing~pages, but harder to memorize~learn. Quest uses~requires hardly any symbol usage which makes it probably one of the easiest code languages to learn).

I've been able to learn to code a bit in my computer's command prompt feature and making~using batch (.bat) files, but it's very limited in what it can do, lol. And learning its format and syntax is a pain... Quest is really a great code language for learning to code, hehe. I figured that the command prompt is a good place to start in learning other coding languages, start simple and older coding language, lol. At some point maybe I'll look at learning these other coding languages like C#, C++, Java, Java Script, and etc. When I feel that I'm ready to do so, lol. I understand how you don't want to be doing multiple coding languages at once, as you'll get all of the symbols, formats, and syntax for each of them mixed up, which makes for numerous "ERRORS" when writing the code, lol. Right now though, I'm still just trying to learn the different basic coding aspects, such as doing things in Quest, I'm still shaky on equipment coding, still need to learn more of working with lists, dictionaries, and iteration coding, completely haven't yet started to learn to coding of "strings" (or I think this is also known as "parsing" coding... lol), don't really understand magic coding much either, trying to understand and code in "time" SCARES ME = Pixie's Clock Library... and etc etc etc etc etc... lol