Dodging with Random Numbers

Omega
21 Jan 2014, 23:58
So Im trying to set an interger into a random number.

I have two characters.
the player
and a goblin

they both inherited health and attack power (damage) and dodge
but I want dodge to be a random number so that when in battle the function of attack reads
if players dodge>monster dodge
player dodges

and viceversa for taking damage.

When i set dodge to string (GetRandomInt(1,10)) it gives me an error saying
Error running script: Error compiling expression 'self.dodge>monster.dodge': CompareElement: Operation 'GreaterThan' is not defined for types 'String' and 'Int32'

I tried many ways but it's not working. Here's my game code so far. it's short. I also left the dodge set to Interger so that the game works properly. but im looking for something where player has random values between 1 and 10 and the monster is between 1 and 5. (That way the monster has a 50% chance of giving damage.)


<!--Saved by Quest 5.4.4873.16527-->
<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>
<gridmap />
<mapscale type="int">5</mapscale>
<mapsize type="int">250</mapsize>
<start type="script">
</start>
</game>
<command name="fight_command">
<pattern>attack #object#</pattern>
<script>
fight_function (game.pov, object)
</script>
</command>
<object name="West Gates">
<inherit name="editor_room" />
<attr name="grid_width" type="int">3</attr>
<attr name="grid_fill">SlateGray</attr>
<enter type="script">
play sound ("The Legend Of Zelda Link's Awakening Music_ Mt. Tamaranch.mp3", false, true)
</enter>
<object name="player">
<inherit name="defaultplayer" />
<inherit name="character" />
<damage type="int">2</damage>
<statusattributes type="stringdictionary">
<item>
<key>current_hearts</key>
<value>Hearts: !</value>
</item>
<item>
<key>damage</key>
<value>Attack: !</value>
</item>
</statusattributes>
<attr name="current_hearts" type="int">4</attr>
<money type="int">5</money>
<dodge type="int">5</dodge>
</object>
<exit alias="west" to="west pass1">
<inherit name="westdirection" />
</exit>
</object>
<object name="West Overworld">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix>Location:(</prefix>
<suffix>)</suffix>
<attr name="grid_width" type="int">1</attr>
<attr name="grid_length" type="int">1</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<object name="west pass1">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="West Gates">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass2">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass2">
<inherit name="editor_room" />
<attr name="grid_width" type="int">10</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass1">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass3">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass3">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass2">
<inherit name="eastdirection" />
</exit>
<object name="Goblin">
<inherit name="editor_object" />
<inherit name="character" />
<alias>Goblin</alias>
<damage type="double">0.5</damage>
<attr name="current_hearts" type="int">2</attr>
<alt type="stringlist">
<value>monster</value>
</alt>
<open type="boolean">false</open>
<close type="boolean">false</close>
<isopen type="boolean">false</isopen>
<listchildren type="boolean">false</listchildren>
<hidechildren />
<dodge type="int">1</dodge>
</object>
<object name="Rupee">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<take />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<visible />
<scenery />
<use type="boolean">false</use>
<listchildren type="boolean">false</listchildren>
<money type="int">1</money>
</object>
</object>
</object>
<type name="character">
<dead type="boolean">false</dead>
<damage type="double">0</damage>
<money type="int">0</money>
<attr name="current_hearts" type="int">0</attr>
<dodge type="int">0</dodge>
</type>
<type name="deathdrop">
<killed type="script">
if (monster.dead = false) {
MakeObjectInvisible (Rupee)
}
else if (monster.dead = true) {
MakeObjectVisible (Rupee)
}
</killed>
</type>
<function name="fight_function" parameters="self, monster"><![CDATA[
if (monster = null) {
foreach (obj, AllObjects()) {
if (obj.alias=monster) {
monster = obj
}
else {
msg ("There's no " + monster + "in the vicinity.")
}
}
}
else if (not Doesinherit (monster,"character")) {
msg ("You can not battle that!")
}
else if (monster.dead = true) {
msg (monster.alias + " is already dead.")
}
else {
show menu ("You enter combat with the nasty " + monster.alias +", what do you do?", split("Swing_Up;Swing_Down;Swing_Left;Swing_Right;Block",";"), false) {
switch (result) {
case ("Swing_Up") {
result = 1
}
case ("Swing_Down") {
result = 2
}
case ("Swing_Left") {
result = 3
}
case ("Swing_Right") {
result = 4
}
case ("Block") {
result = 5
}
}
value = GetRandomInt (1,5)
if (value = result) {
if (result=1) {
msg ("You Swing_Up and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=2) {
msg ("You Swing_Down and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=3) {
msg ("You Swing_Left and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=4) {
msg ("You Swing_Right and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=5) {
msg ("You Block the " + monster.alias +"'s attack!")
fight_function (self, monster)
}
}
else if (result=5) {
msg ("You fail to block the " + monster.alias +"'s attack!")
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
else {
msg ("You miss with your attack!")
if (self.dodge>monster.dodge) {
msg ("You dodged the " +monster.alias+ "'s attack.")
self.current_hearts = self.current_hearts
}
else if (self.dodge<monster.dodge) {
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
}
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
}
}
]]></function>
</asl>

george
22 Jan 2014, 01:12
hi Omega, as you realized you can't set an attribute to the result of GetRandomInt. You have a few options but maybe the easiest is something like this:


<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="random stats">
<gameid>768199f2-28b1-421c-ad44-10f51040cd5b</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<start type="script">
player.dodge = GetRandomInt(1,10)
goblin.dodge = GetRandomInt(1,10)
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="goblin">
<inherit name="editor_object" />
<inherit name="male" />
</object>
</object>
</asl>


Basically something like GetRandomInt needs to be in a start script or a function you call in a start script.

There are other ways to do dynamic stats/monsters though, which will work better once you start having a lot of them. But for now this should work OK.

Omega
22 Jan 2014, 01:22
Unfortunately it didn't work. There was no error so that's good.

BUT. When i tested by making the goblins dodge intergers between 11 and 15 while players is 1 to 10 I was still able to kill the goblin.

Technically, that shouldn't happen. It should instead say my attack missed the goblin.
Wait... i think i forgot to input the monsters outcome if it's dodge is greater than players. hahaha.

thanks though.

But what you posted. does that really work? putting it at the start of game? because if that's true then if i make like 100 monsters then that's like 100 random intergers. damn..

Omega
22 Jan 2014, 01:41
Wait. nevermind. I can't add that to my function. It has to be set to the object(goblin). So Technically, your code actually isn't doing anything in my game.

Sorry...

My code above has its function set to a fight interface. So it's following a list where I have the player choose an attack type. I just want it to be somewhat fair and not totally like i always get the miss or the goblin always misses. Is there any other way?????

george
22 Jan 2014, 02:01
How did you paste my code into your game? I didn't test it with your code, so I don't know how it'll interact with it.

However it does work to set attributes to random ints.

If you're making 100 monsters, there are better ways to do it. The way I showed is the easiest, but not for a lot of monsters.

Can you describe more what your game is like? When you say 100 monsters, do you mean 100 unique ones, or like 20 goblins, 10 zombies, etcetera?

HegemonKhan
22 Jan 2014, 02:18
whenever you see an error of: "type_A" and "type_B", that's your problem.

a "string" is not (thus not equal to) an "integer"

you have to have "int" and "int", as that's how ">" (greater than) works. "red" (string) > "5" (int) = HUH?!

though a numerical character, such as "5", is both a "string" and an "int", so if your "5" value isn't already set as being an "int" Type, then you need to do so: ToInt (your_value_,_in_this_example_:_5)

or... if, you can work with strings ~ depending on what you're doing in your code lines, you can change the "int" type to a "string" type, so that: "string" = "string", via: ToString (your_integer_value_,_in_this_example_:_5)

but you're doing a "greater than" code line, and thus you're required to change the "string" > "int" to be an integer: "int" > "int"

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

omega wrote:When i set dodge to string (GetRandomInt(1,10)) it gives me an error


fix: set "dodge" to be an "int" (Integer) Type of Attribute

Object: ???
Attribute Name: dodge
Attribute Type: int
Attribute (initial) Value: 0

the Attribute's Value is then changed by:

Object.dodge = GetRandomInt (1,10)

conceptual look: Object.dodge (Type: int) = (Type: int) GetRandomInt (1,10)

conceptual look: if (Object.dodge (Type: int) > (Type: int) GetRandomInt (1,10)) { then do... scripting }

conceptual look: if (Object.dodge (Type: string) > (Type: int) GetRandomInt (1,10)) { Quest game engine: how the bleep do I do "red" > "6", human? please tell me, as I have no idea how to even comprehend this... do you, human? human HK: um... I don't either have any idea to even comprehend this as well, along with every other human on the planet, too, lol }

what makes a "5" an integer, is it's set ATTRIBUTE TYPE (as an "int", duh, lol), as just the character itself ("5"), can be either a "string" or an "int", at least to a computer anyways, as that "attribute type" is it's "content" to determine what that "5" is, whereas a human can tell the content from our sentence, knowing whether we're talking about the "5" as an actual physical amount or as a... "word~concept~symbol" (I don't know how to say this, lol).

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

omega wrote:That way the monster has a 50% chance of giving damage


if you just want 50%, then you can use this built-in Function instead:

http://quest5.net/wiki/RandomChance

RandomChance (50)

if (RandomChance (50) = true) {
-> // damage scripting
} else {
-> // miss scripting
}

what "RandomChance (value_of_0_to_100)" does is this:

a percent chance (of that value input of yours) of being "true", so:

if (75% = true) {

we're looking to the LEFT of the equal sign, so ignore the "true" to the right of the equal sign at the moment:

3/4 (75%) times the result is "TRUE"

(1/4). TRUE
(2/4). TRUE
(3/4). TRUE
(4/4). FALSE

so now let's place it within the code line (CONCEPTUAL example of explaining "RandomChance (Value)"):

(1/4). if (TRUE=true) { then ... do script }
(2/4). if (TRUE=true) { then ... do script }
(3/4). if (TRUE=true) { then ... do script }
(4/4). if (FALSE=true) { then ...(CAN'T) do script }

3/4 times it'll be: if (TRUE=true) { then ... do script }
1/4 times it'll be: if (FALSE=true) { then ... (CAN'T) do script }

let's look at the easiest examples: 100 and 0

if (RandomChance (100) = true) {
-> msg ("hi")
}
// this will ALWAYS output: hi

if (RandomChance (100) = false) {
-> msg ("hi")
}
// this will NEVER output: hi

if (RandomChance (0) = true) {
-> msg ("hi")
}
// this will NEVER output: hi

if (RandomChance (0) = false) {
-> msg ("hi")
}
// this will ALWAYS output: hi

now, let's go back to: 50

if (RandomChance (50) = true) {
-> msg ("hi")
}
// this will half of the time output: hi

if (RandomChance (50) = false) {
-> msg ("hi")
}
// this will half of the time output: hi

last, let's look at: 75 and 25

if (RandomChance (75) = true) {
-> msg ("hi")
}
// this will 3/4 of the time output: hi

if (RandomChance (75) = false) {
-> msg ("hi")
}
// this will 1/4 of the time output: hi

if (RandomChance (25) = true) {
-> msg ("hi")
}
// this will 1/4 of the time output: hi

if (RandomChance (25) = false) {
-> msg ("hi")
}
// this will 3/4 of the time output: hi

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

you may be interested in my own game mechanics, and I've got code that you'll be interested in looking at as well, hehe:

what I did was a difference between two stats (Attributes) to get a value for the also used "RandomChance" function:

if (self.speed > enemy.speed) {
-> if ( RandomChance ( self.speed - enemy.speed ) = true ) {
->-> msg ("You get an extra battle turn!")
-> }
}

self.speed = 100
enemy.speed = 100
RandomChance (100-100)
RandomChance (0), so: "0% of being true" = "true"
you go first = never ("then" Script isn't executed)

self.speed = 0
enemy.speed = 0
RandomChance (0-0)
RandomChance (0), so: "0% of being true" = "true"
you go first = never ("then" Script isn't executed)

self.speed = 100
enemy.speed = 75
RandomChance (100-75)
RandomChance (25), so: "25% of being true" = "true"
you go first = 1/4 of the "then" Script being executed

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

you could also do this too:

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

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

anyways, here's some of my own coding:

(I forgot or didn't realize to put in the coding to check if the proper object, self or enemy, does indeed have a higher value than the other object, self or enemy, when I wrote this, so ignore this issue, lol)

(also, this is a bit difficult to read~understand due to the "negative" and "double negative" language that I usage... try to read carefully, lol)

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
}

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) {
// you indeed successfully striked~hit the monster, so now, execute the "your damage upon the monster" scripting
}


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

P.S.

here's my own functional combat testing game file (it's version "540" though):

    <asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Test">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<pov type="object">player</pov>
<start type="script">
cc
</start>
<turns type="int">0</turns>
<statusattributes type="simplestringdictionary">turns = </statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="pc" />
<cur_hp type="int">999</cur_hp>
<max_hp type="int">999</max_hp>
<str type="int">100</str>
<end type="int">100</end>
<dex type="int">100</dex>
<agi type="int">100</agi>
<spd type="int">100</spd>
<hc type="int">100</hc>
<pd type="int">100</pd>
<pr type="int">100</pr>
</object>
<object name="orc1">
<inherit name="editor_object" />
<inherit name="npc" />
<hostile type="boolean">true</hostile>
<dead type="boolean">false</dead>
<alias>orc</alias>
<cur_hp type="int">999</cur_hp>
<max_hp type="int">999</max_hp>
<str type="int">25</str>
<end type="int">25</end>
<dex type="int">25</dex>
<agi type="int">25</agi>
<spd type="int">25</spd>
<hc type="int">25</hc>
<pd type="int">25</pd>
<pr type="int">25</pr>
</object>
</object>
<turnscript name="game_turns">
<enabled />
<script>
sa
game.turns = game.turns + 1
</script>
</turnscript>
<command name="fight">
<pattern>fight #text#</pattern>
<script>
battle_system (game.pov,text)
</script>
</command>
<type name="char">
<cur_hp type="int">0</cur_hp>
<drop type="boolean">false</drop>
<defending type="boolean">false</defending>
<max_hp type="int">0</max_hp>
<str type="int">0</str>
<end type="int">0</end>
<dex type="int">0</dex>
<agi type="int">0</agi>
<spd type="int">0</spd>
<hp type="int">0</hp>
<hc type="int">0</hc>
<pd type="int">0</pd>
<pr type="int">0</pr>
</type>
<type name="pc">
<inherit name="char" />
<statusattributes type="simplestringdictionary">hp = ;str = ;end = ;dex = ;agi = ;spd = ;hc = ;pd = ;pr = </statusattributes>
</type>
<type name="npc">
<inherit name="char" />
<dead type="boolean">false</dead>
<hostile type="boolean">false</hostile>
<displayverbs type="simplestringlist">Look at; Talk; Fight</displayverbs>
</type>
<function name="cc">
msg ("What is your name?")
get input {
game.pov.alias = result
msg (" - " + game.pov.alias)
show menu ("What is your gender?", split ("male;female" , ";"), false) {
game.pov.gender = result
show menu ("What is your race?", split ("human;dwarf;elf" , ";"), false) {
game.pov.race = result
show menu ("What is your class?", split ("warrior;cleric;mage;thief" , ";"), false) {
game.pov.class = result
msg (game.pov.alias + " is a " + game.pov.gender + " " + game.pov.race + " " + game.pov.class + ".")
wait {
ClearScreen

}
}
}
}
}
</function>
<function name="sa">
game.pov.hp = game.pov.cur_hp + " / " + game.pov.max_hp
</function>
<function name="battle_system" parameters="self,text">
enemy = GetObject (text)
if (enemy = null) {
foreach (obj,AllObjects()) {
if (obj.alias=text) {
enemy = obj
}
}
}
if (enemy = null) {
msg ("There is no " + text + " here.")
}
else if (not Doesinherit (enemy,"npc")) {
msg ("You can not battle that!")
}
else if (not npc_reachable (enemy)) {
msg ("There is no " + enemy.alias + " in your vicinity.")
}
else if (GetBoolean (enemy,"dead") = true) {
msg (enemy.alias + " is already dead.")
}
else if (GetBoolean (enemy,"hostile") = false) {
msg (enemy.alias + " is not hostile.")
}
else {
battle_sequence (self,enemy)
}

</function>
<function name="battle_sequence" parameters="self,enemy"><![CDATA[
if (enemy.dead = false) {
playerfirst=false
if (GetInt (self,"spd") > GetInt (enemy,"spd")) {
playerfirst=true
} else if (GetInt (self,"spd") = GetInt (enemy,"spd") and RandomChance (50)) {
playerfirst=true
}

if (playerfirst) {
msg ("You get to go first for this round")
self_battle_turn (self,enemy)
on ready {
if (not enemy.dead){
enemy_battle_turn (self,enemy)
}
}
} else {
msg (enemy.alias + " gets to go first for this round.")
enemy_battle_turn (self,enemy)
msg ("It is now your turn.")
self_battle_turn (self,enemy)
}
on ready {
msg ("The round has ended.")
msg("")
battle_sequence (self,enemy)
}
} else {
msg ("The battle is over.")
}
]]></function>
<function name="self_battle_turn" parameters="self,enemy"><![CDATA[
msg (self.alias + " has " + self.cur_hp + " HP left.")
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
wait {
show menu ("What is your battle choice?", split ("Attack;Defend;Cast;Item;Run", ";"), false) {
switch (result) {
case ("Attack") {
fourth_value = false
if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"spd")) = true) {
msg (enemy.alias + "evaded your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"dex") - GetInt (self,"agi")) = true) {
msg (enemy.alias + "parried your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"dex")) = true) {
msg (enemy.alias + "blocked your attack!")
fourth_value = true
}
else if (RandomChance (GetInt (self,"dex") - GetInt (enemy,"spd")) = false) {
msg ("Your attack missed " + enemy.alias +"!")
fourth_value = true
}
else if (RandomChance (GetInt (enemy,"pr") - GetInt (self,"hc")) = true) {
msg ("Your attack got resisted by " + enemy.alias +"!")
fourth_value = true
}
else if (fourth_value = false) {
if (self.defending = true and enemy.defending = true) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * 2 * GetInt (self,"pd") / 2 + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
self.defending = false
}
else if (self.defending = true and enemy.defending = false) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * 2 * GetInt (self,"pd") + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
self.defending = false
}
else if (self.defending = false and enemy.defending = true) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * GetInt (self,"pd") / 2 + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
}
else if (self.defending = false and enemy.defending = false) {
enemy.cur_hp = enemy.cur_hp - (crit_hit (self) * GetInt (self,"pd") + GetInt (self,"pd") * (GetInt (self,"str") - GetInt (enemy,"end")) / 100)
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
}
}
}
case ("Defend") {
if (self.defending = false) {
self.defending = true
}
}
case ("Cast") {
self.defending = false
}
case ("Item") {
self.defending = false
}
case ("Run") {
self.defending = false
}
}
if (GetInt (enemy,"cur_hp") > 0) {
if ( RandomChance (GetInt (self,"spd") - GetInt (enemy,"spd"))= true) {
msg ("You get an extra battle turn!")
self_battle_turn (self,enemy)
}
else {
msg ("Your battle turn is over.")
}
}
else if (GetInt (enemy,"cur_hp") <= 0) {
msg (enemy.alias + " is dead.")
msg ("You have won the battle!")
enemy.defending = false
enemy.dead = true
}
}
}
]]></function>
<function name="enemy_battle_turn" parameters="self,enemy"><![CDATA[
msg (self.alias + " has " + self.cur_hp + " HP left.")
msg (enemy.alias + " has " + enemy.cur_hp + " HP left.")
result = GetRandomInt (1,3)
switch (result) {
case (1) {
sixth_value = false
if (RandomChance (GetInt (self,"agi") - GetInt (enemy,"spd")) = true) {
msg ("You have evaded the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"dex") - GetInt (enemy,"agi")) = true) {
msg ("You have parried the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"agi") - GetInt (enemy,"dex")) = true) {
msg ("You have blocked the attack!")
sixth_value = true
}
else if (RandomChance (GetInt (enemy,"dex") - GetInt (self,"spd")) = false) {
msg (enemy.alias +"'s attack missed!")
sixth_value = true
}
else if (RandomChance (GetInt (self,"pr") - GetInt (enemy,"hc")) = true) {
msg ("You resisted the attack!")
sixth_value = true
}
else if (sixth_value = false) {
if (enemy.defending = true and self.defending = true) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * 2 * GetInt (enemy,"pd") / 2 + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
enemy.defending = false
}
else if (enemy.defending = true and self.defending = false) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * 2 * GetInt (enemy,"pd") + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
enemy.defending = false
}
else if (enemy.defending = false and self.defending = true) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * GetInt (enemy,"pd") / 2 + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
}
else if (enemy.defending = false and self.defending = false) {
self.cur_hp = self.cur_hp - (crit_hit (enemy) * GetInt (enemy,"pd") + GetInt (enemy,"pd") * (GetInt (enemy,"str") - GetInt (self,"end")) / 100)
msg (self.alias + " has " + self.cur_hp + " HP left.")
}
}
}
case (2) {
if (enemy.defending = false) {
msg (enemy.alias + " has choosen to defend itself.")
enemy.defending = true
}
}
case (3) {
enemy.defending = false
msg ("Cast")
}
}
if (GetInt (self,"cur_hp") > 0) {
if (RandomChance (GetInt (enemy,"spd") - GetInt (self,"spd")) = 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,"cur_hp") <= 0) {
msg (self.alias + " has died.")
msg ("GAME OVER")
finish
}
]]></function>
<function name="npc_reachable" parameters="object" type="boolean">
value = false
foreach (x,ScopeReachableNotHeld ()) {
if (x=object) {
value = true
}
}
return (value)
</function>
<function name="crit_hit" parameters="object" type="int">
if (RandomChance (GetInt (object,"luck")) = true) {
value = 2
}
else {
value = 1
}
return (value)
</function>
</asl>


and here's the key~legend for all my abreviations (sorry, this was an early work ~ not realizing how bad those abrev would be ~ as even I myself forgot what they stood for, lol):

01. cc = character creation function
02. sa = status attributes (mainly for implementing/displaying of ' cur / max ' stats) function
03. char = character object type ("pcs", "npcs", "monsters", etc., so, not a room, item, equipment, spell, etc)
04. pc = playable character object type ("player" characters / game.povs)
05. npc = non-playable character ("people", "monsters", and etc, so not a "player" character / not a game.pov, I'm going to have a hostility system, so any npc can be friendly or hostile, instead of having an actual "monster/enemy" type set aside)
06. hp = hit points (life) stat attribute
07. mp = mana points (magic) stat attribute
08. str = strength (physical damage, carry weight / equipment requirement, etc) stat attribute
09. end = endurance (physical defense, and etc) stat attribute
10. dex = dexterity (weapon~attack skill, think of this as "if your attack connects or not, do you 'whiff' or not", so not to gete confused with hc, and etc) stat attribute
11. agi = agility (dodging/evading, and etc) stat attribute
12. spd = speed (who goes first in battle, extra battle turns, escaping from battle, and etc) stat attribute
13. hc = hit chance (think of this more as piercing their armor or not, so not to get confused with dex, and etc) stat attribute
14. pd = physical damage stat attribute
15. fp = fire damage stat attribute
16. wp = water damage stat attribute
17. ap = air damage stat attribute
18. ed = earth damage stat attribute
19. ld = light damage stat attribute
20. dd = dark damage stat attribute
21. pr = physical resistance stat attribute
22. fr = fire resistance stat attribute
23. wr = water resistance stat attribute
24. ar = air resistance stat attribute
25. er = earth resistance stat attribute
26. lr = light resistance stat attribute
27. dr = dark resistance stat attribute
28. defending = boolean (reduces damage done for that character and increases the damage done by that character, if they chosoe to attack on the next turn)
29. escaped = boolean, run from battle (not completed/implemented yet)
30. hostile = boolean, any npc can be friendly or a(n) "monster/enemy", based upon a hostility scale (0-100), but not completed
31. dead = boolean
32. crit_hit = critical hit (bonus damage based upon luck)
33. luck = luck stat attribute
34. lvl = level stat attribute
35. exp = experience stat attribute
36. cash = cash stat attribute (currency)
37. lvlup = level up function

Omega
22 Jan 2014, 02:33
LOL Thanks HK.

Since the basic fighting code was yours, I was about to send you a message. You beat me. haha.

Any what you said makes perfect sense now. I totally was going at it wrong. I wasn't thinking of dodge as an object. thanks.
If it works. i'll let you know..
if not...well ill let you know how it turned out.

HegemonKhan
22 Jan 2014, 02:35
"dodge" would be an ATTRIBUTE (TYPE: int, NOT: string) OF AN OBJECT: Object.Attribute=Value_or_Expression
~or~
"dodge" is a variable: Variable=Value_or_Expression

Omega
22 Jan 2014, 02:46
I actually have your old combat code for other game ideas so thanks.

But I am following what you posted above about changing the object.dodge to an interger.

I'm stuck on that part as I can't find a way to change it. dodge is set to 0 by object type which is inherited by player.

Now im stuck on changing it to an interger like you said.

Omega
22 Jan 2014, 02:56
hm......Im still lost. sorry dude. This time though it said the same error
but with 'string' and 'string'.

HegemonKhan
22 Jan 2014, 03:15
you are using the desktop~offline version, right? as I don't know what you can do or how you can do (or can't) in the online version.

you can't change inherited attributes (such as if you used Object Types added to your Objects), but you can add~create that same attribute to your object directly, which will OVERRIDE the inherited attribute, at least it's Value... if you have them as different Attribute Types, then that'll likely cause an error... you'll have to correct the attribute upon your Object Type then, to the correct Attribute Type.

go to the Object Type on your tree of stuff on the left side of the screen (it's under the "Advanced"), and then find your "dodge" attribute within it, and you may have to delete it (not sure if you can change the attribute type directly), and then re-add the "dodge" attribute (with the correct attribute type, int, this time).

lol....

Incorrect: string and string
~VS~
Correct: int and int

see if you can figure it out...

you got to change the actual Attribute Type on the Attribute itself, as that is it's setting for what Attribute Type it is, regardless of whatever it value is.

let me see if this helps:

incorrect:

Object: HK
Attribute Name: strength
Attribute Type: string
Attribute Value: 0

(let's say the "GetRandomInt" selects "5")

HK.strength = GetRandomInt (1,10)
ERROR: string (HK.strength) = int (5)

HK.strength = ToInt (GetRandomInt (1,10))
ERROR: string (HK.strength) = int (5)

ToInt (HK.strength) = GetRandomInt (1,10)
int (HK.strength) = int (5)
ERROR: you must be setting an Attribute (Object.Attribute=Value_or_Expression) or a Variable (Variable=Value_or_Expression), but you're not as the ToInt with the HK.strength, makes that an Expression, which is not setting an Attribute or a Variable.

now this would work, as we're doing a conditional Expression script, and not setting an Attribute or Variable:

if (ToInt (HK.strength) = GetRandomInt (1,10)) {
-> // script
}

but otherwise, you must change the Attribute's Attribute Type via it's "creation" (Add) options:

Object -> Attributes Tab-> Attributes Add ->

Object: HK
Attribute Name: dodge
Attribute Type: int (from incorrect:string to correct:int)
Attribute Value: 0

HK.strength = GetRandomInt (1,10)
~OR~
strength = GetRandomInt (1,10)
~OR~
if (HK.strength > GetRandomInt (1,10)) { then do.. script }
~OR~
if (strength > GetRandomInt (1,10)) { then do.. script }

WORKS, NO error !!!

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

P.S.

I've editted these recent 1-3 posts of mine, so you may want to read back over them, as you may have missed what new stuff I had editted in later.

Omega
22 Jan 2014, 04:17
sorry dude...im still not following.

I've tried making dodge into an interger. I understand you need to change the attribute name dodge into an interger.

I tried clicking on add change script which gives me a changedodge
and messed around with that but it's still no avail.

HegemonKhan
22 Jan 2014, 04:19
hey sorry, your problem was a bit more confusing~complicated than I realized (and it had nothing to do with what I was specifically saying in my previous posts ~ my apologizes ~ you had it set up correctly), after upon going over your code (and I'm not even sure what I did exactly to fix it ~ I'd have to compare your code with my editting of your code, lol, but I got it at least initially fixed, you'll need to test your "attack" function to make sure it's working fully and correctly as you want it to, and also if my changes are okay, or if I messed some stuff up that I wasn't suppose to do so):

(I did change all your "amount" Attributes into Type "double", as their might have been a conflict as you had the same Attribute (in different places) as an "int" and also as a "double", which I'm sure (or at least I think so) would cause a conflict)

(I added the code needed for an "attack" button and hyperlink for the goblin:

goblin (Object):

new syntax:

<attr name="displayverbs" type="listextend">Attack</attr>

~OR~

old syntax (still works though it gets converted to new syntax upon loading up the game in gui~editor):

<displayverbs type="listextend">Attack</displayverbs>

)

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

<!--Saved by Quest 5.4.4873.16527-->
<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>
<gridmap />
<mapscale type="int">5</mapscale>
<mapsize type="int">250</mapsize>
<start type="script">
</start>
</game>
<command name="fight_command">
<pattern>attack #object#</pattern>
<script>
fight_function (game.pov, object)
</script>
</command>
<object name="West Gates">
<inherit name="editor_room" />
<attr name="grid_width" type="int">3</attr>
<attr name="grid_fill">SlateGray</attr>
<enter type="script">
play sound ("The Legend Of Zelda Link's Awakening Music_ Mt. Tamaranch.mp3", false, true)
</enter>
<object name="player">
<inherit name="defaultplayer" />
<inherit name="character" />
<damage type="double">2.0</damage>
<statusattributes type="stringdictionary">
<item>
<key>current_hearts</key>
<value>Hearts: !</value>
</item>
<item>
<key>damage</key>
<value>Attack: !</value>
</item>
</statusattributes>
<attr name="current_hearts" type="double">4.0</attr>
<money type="double">5.0</money>
<dodge type="double">5.0</dodge>
</object>
<exit alias="west" to="west pass1">
<inherit name="westdirection" />
</exit>
</object>
<object name="West Overworld">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix>Location:(</prefix>
<suffix>)</suffix>
<attr name="grid_width" type="int">1</attr>
<attr name="grid_length" type="int">1</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<object name="west pass1">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="West Gates">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass2">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass2">
<inherit name="editor_room" />
<attr name="grid_width" type="int">10</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass1">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass3">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass3">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass2">
<inherit name="eastdirection" />
</exit>
<object name="Goblin">
<inherit name="editor_object" />
<inherit name="character" />
<alias>Goblin</alias>
<damage type="double">0.5</damage>
<attr name="current_hearts" type="double">2.0</attr>
<alt type="stringlist">
<value>monster</value>
</alt>
<open type="boolean">false</open>
<close type="boolean">false</close>
<isopen type="boolean">false</isopen>
<listchildren type="boolean">false</listchildren>
<hidechildren />
<dodge type="double">1.0</dodge>
<attr name="displayverbs" type="listextend">Attack</attr>
</object>
<object name="Rupee">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<take />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<visible />
<scenery />
<use type="boolean">false</use>
<listchildren type="boolean">false</listchildren>
<money type="double">1.0</money>
</object>
</object>
</object>
<type name="character">
<dead type="boolean">false</dead>
<damage type="double">0.0</damage>
<money type="double">0.0</money>
<attr name="current_hearts" type="double">0.0</attr>
<dodge type="double">0.0</dodge>
</type>
<type name="deathdrop">
<killed type="script">
if (monster.dead = false) {
MakeObjectInvisible (Rupee)
}
else if (monster.dead = true) {
MakeObjectVisible (Rupee)
}
</killed>
</type>
<function name="fight_function" parameters="self, monster"><![CDATA[
if (monster = null) {
foreach (obj, AllObjects()) {
if (obj.alias=monster) {
monster = obj
}
else {
msg ("There's no " + monster + "in the vicinity.")
}
}
}
if (monster = null) {
msg ("There's no " + monster + "in the vicinity.")
}
else if (not Doesinherit (monster,"character")) {
msg ("You can not battle that!")
}
else if (monster.dead = true) {
msg (monster.alias + " is already dead.")
}
else {
show menu ("You enter combat with the nasty " + monster.alias +", what do you do?", split("Swing_Up;Swing_Down;Swing_Left;Swing_Right;Block",";"), false) {
switch (result) {
case ("Swing_Up") {
result = 1
}
case ("Swing_Down") {
result = 2
}
case ("Swing_Left") {
result = 3
}
case ("Swing_Right") {
result = 4
}
case ("Block") {
result = 5
}
}
value = GetRandomInt (1,5)
if (value = result) {
if (result=1) {
msg ("You Swing_Up and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=2) {
msg ("You Swing_Down and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=3) {
msg ("You Swing_Left and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=4) {
msg ("You Swing_Right and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=5) {
msg ("You Block the " + monster.alias + "'s attack!")
fight_function (self, monster)
}
}
else if (not value = result) {
if (result=5) {
msg ("You fail to block the " + monster.alias +"'s attack!")
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
else {
msg ("You miss with your attack!")
if (self.dodge > monster.dodge) {
msg ("You dodged the " + monster.alias + "'s attack.")
}
else if (self.dodge < monster.dodge) {
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
}
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
}
}
}
]]></function>
</asl>

Omega
22 Jan 2014, 04:27
Lol xD it's ok dude. no worries.

This stuff is hard. but let me check if there's any change.

HegemonKhan
22 Jan 2014, 04:32
I did change a bit of the nesting of your fight function... maybe it was needed to get it to work, or I messed up your fight function a bit and it's not working as you want it to.

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

to work with code easier (troubleshooting, writing, reading, and~or comparing multiple codes), this is a very good free program~software to use:

notepad++

http://notepad-plus-plus.org/

(once you are loaded up in notepad++, just change the "language", option of~at the top menu bar, to "XML")

(site is down at the moment, hopefully only temproarily for maintainance or maybe updating their software version)

Omega
22 Jan 2014, 04:41
It didn't really change anything.

Maybe im not being clear either.

You see the idea is player comes into room there's an orc.

the fight function should go something like this:

In the players attributes I want the 'dodge' to be a random interval between 1 n 10
in goblins attribute i want 'dodge' to be random between 1 n 5

so when you type attack and choose the something from the menu
it should check what the random dodge number is for both characters.
so if i type attack and the goblin......wait.

fml. Yea i typed it wrong. haha. ok i see what the problem is.

What it should say is:

if [expr] self.attack>monster.dodge
then
monster dies.

if [expr] self.attack<monster.dodge
then
monster dodges attack

==================================

player should be the same dodge for monster

if [expr] monster.attack>self.dodge
then
monster attacks dealing 'blah' damage.

if [expr] monster.attack<self.dodge
then
monsters attack misses you.



The real question is how and where do i put that in my code?
time to go back.

Thanks for itchn my brain with me though HK.
Again, if there's anything i can help you with just send me a message.
Sometimes it takes 2 brains to solve things. lolz

Omega
22 Jan 2014, 04:46
DANG IT!!

It still doesn't solve the area of the game to check the number

I still don't want the characters to have a set interger for their dodge under their attribute.

I want them to be random intergers.

HegemonKhan
22 Jan 2014, 04:57
do you need help with this stuff, or did you figure out how to do it?

if you still need help with something, let me know...

----------

Initial setting of the attribute's value: 0

<object name="Object_1_name">
-> <inherit name="editor_object" />
-> <attr name="Attribute_1_name" type="int">0</attr>
</object>

<object name="Object_2_name">
-> <inherit name="editor_object" />
-> <attr name="Attribute_2_name" type="int">0</attr>
</object>

if you want the random values, in the scripting (if using the GUI~Editor: Set a variable or attribute: [EXPRESSION]):

new setting of the attributes' values: GetRandomInt (min,max)

Object_1_name.Attribute_1_name = GetRandomInt (min,max)
Object_2_name.Attribute_2_name = GetRandomInt (min,max)

if you then want to do a conditional (if script) with it elsewhere later in the scripting block:

if (Object_1_name.Attribute_1_name > Object_1_name.Attribute_1_name) {
-> // script
}

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

ah, I think I understand now... don't worry it's easy to do:

set the new values of the Attributes right at the beginning of the function :D

<function name="fight_function" parameters="self, monster"><![CDATA[
Object_1_name.Attribute_1_name = GetRandomInt (min,max)
Object_2_name.Attribute_2_name = GetRandomInt (min,max)
if (monster = null) {
// rest of your code

Omega
22 Jan 2014, 05:53
cool. I wanted to post up the new changes to your fight_function.

this time it definitely makes sense.
It's still the same question about making the attribute of the characters 'dodge' a random interger.

Here's the changes. ill look at what you posted and see if that will change anything.


<!--Saved by Quest 5.4.4873.16527-->
<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>
<gridmap />
<mapscale type="int">5</mapscale>
<mapsize type="int">250</mapsize>
<start type="script">
</start>
</game>
<command name="fight_command">
<pattern>attack #object#</pattern>
<script>
fight_function (game.pov, object)
</script>
</command>
<object name="West Gates">
<inherit name="editor_room" />
<attr name="grid_width" type="int">3</attr>
<attr name="grid_fill">SlateGray</attr>
<enter type="script">
play sound ("The Legend Of Zelda Link's Awakening Music_ Mt. Tamaranch.mp3", false, true)
</enter>
<object name="player">
<inherit name="defaultplayer" />
<inherit name="character" />
<damage type="int">2</damage>
<statusattributes type="stringdictionary">
<item>
<key>current_hearts</key>
<value>Hearts: !</value>
</item>
<item>
<key>damage</key>
<value>Attack: !</value>
</item>
</statusattributes>
<attr name="current_hearts" type="int">4</attr>
<money type="int">5</money>
<dodge type="int">4</dodge>
</object>
<exit alias="west" to="west pass1">
<inherit name="westdirection" />
</exit>
</object>
<object name="West Overworld">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix>Location:(</prefix>
<suffix>)</suffix>
<attr name="grid_width" type="int">1</attr>
<attr name="grid_length" type="int">1</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<object name="west pass1">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="West Gates">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass2">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass2">
<inherit name="editor_room" />
<attr name="grid_width" type="int">10</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass1">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass3">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass3">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass2">
<inherit name="eastdirection" />
</exit>
<object name="Goblin">
<inherit name="editor_object" />
<inherit name="character" />
<alias>Goblin</alias>
<damage type="double">0.5</damage>
<attr name="current_hearts" type="int">2</attr>
<alt type="stringlist">
<value>monster</value>
</alt>
<open type="boolean">false</open>
<close type="boolean">false</close>
<isopen type="boolean">false</isopen>
<listchildren type="boolean">false</listchildren>
<hidechildren />
<dodge type="int">1</dodge>
<object name="Rupee">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<take />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<visible type="boolean">false</visible>
<scenery />
<use type="boolean">false</use>
<listchildren type="boolean">false</listchildren>
<money type="int">1</money>
</object>
</object>
</object>
</object>
<type name="character">
<dead type="boolean">false</dead>
<damage type="double">0</damage>
<money type="int">0</money>
<attr name="current_hearts" type="int">0</attr>
<dodge type="int">0</dodge>
</type>
<function name="fight_function" parameters="self, monster"><![CDATA[
if (monster = null) {
foreach (obj, AllObjects()) {
if (obj.alias=monster) {
monster = obj
}
else {
msg ("There's no " + monster + "in the vicinity.")
}
}
}
else if (not Doesinherit (monster,"character")) {
msg ("You can not battle that!")
}
else if (monster.dead = true) {
msg (monster.alias + " is already dead.")
}
else {
show menu ("You enter combat with the nasty " + monster.alias +", what do you do?", split("Swing_Up;Swing_Down;Swing_Left;Swing_Right;Block",";"), false) {
switch (result) {
case ("Swing_Up") {
result = 1
}
case ("Swing_Down") {
result = 2
}
case ("Swing_Left") {
result = 3
}
case ("Swing_Right") {
result = 4
}
case ("Block") {
result = 5
}
}
value = GetRandomInt (1,5)
if (value = result) {
if (result=1) {
msg ("You Swing_Up and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=2) {
msg ("You Swing_Down and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=3) {
msg ("You Swing_Left and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=4) {
msg ("You Swing_Right and kill the " + monster.alias +"!")
monster.dead = true
}
else if (result=5) {
msg ("You Block the " + monster.alias +"'s attack!")
fight_function (self, monster)
}
else if (monster.damage>self.dodge) {
msg ("You hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
else if (monster.damage<self.dodge) {
msg ("The monster missed.")
}
}
else if (result=5) {
msg ("You fail to block the " + monster.alias +"'s attack!")
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
else {
msg ("You miss with your attack!")
if (self.dodge>monster.damage) {
msg ("You dodged the " +monster.alias+ "'s attack.")
self.current_hearts = self.current_hearts
}
else if (self.dodge<monster.damage) {
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
}
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
}
}
]]></function>
</asl>

HegemonKhan
22 Jan 2014, 06:00
I forgot to say this:

the "parameters" transfers the:

game.pov and typed_object from the Command to the Function,

so you can use:

<function name="fight_function" parameters="self, monster"><![CDATA[
self.Attribute_1_name = GetRandomInt (min,max)
monster.Attribute_2_name = GetRandomInt (min,max)
if (monster = null) {
// rest of your code


-----------

and my apologies, I had originally thought that your code was wrong, I didn't realize that you had fixed it yourself (and that you were telling me so in your post), with ONLY needing help with getting the random value for your attributes, so that's why I was looking at your code and changing it, as I thought it wasn't working for you. I didn't realize you only needed help with getting the random attributes coded in properly.

Omega
22 Jan 2014, 06:18
It's ok man. I even went through it again.

turns out i have to do checks at every result.
so when i swing a certain way the game checks to see the players attack>monster dodge.
now i have to play it the other way with the monster (if it needs to. im reading through the code over and over and...etc).

lol.

Yea so i changed it a bit. What you just posted actually might work out. unfortunately it's time for bed. haha ill post online tomorrow if i get anywhere with it or get stuck.

again thanks man. I appreciate the help.

here's the changes in case you wanted to test what i was trying to get.


<!--Saved by Quest 5.4.4873.16527-->
<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>
<gridmap />
<mapscale type="int">5</mapscale>
<mapsize type="int">250</mapsize>
<start type="script">
</start>
</game>
<command name="fight_command">
<pattern>attack #object#</pattern>
<script>
fight_function (game.pov, object)
</script>
</command>
<object name="West Gates">
<inherit name="editor_room" />
<attr name="grid_width" type="int">3</attr>
<attr name="grid_fill">SlateGray</attr>
<enter type="script">
play sound ("The Legend Of Zelda Link's Awakening Music_ Mt. Tamaranch.mp3", false, true)
</enter>
<object name="player">
<inherit name="defaultplayer" />
<inherit name="character" />
<damage type="int">3</damage>
<statusattributes type="stringdictionary">
<item>
<key>current_hearts</key>
<value>Hearts: !</value>
</item>
<item>
<key>damage</key>
<value>Attack: !</value>
</item>
</statusattributes>
<attr name="current_hearts" type="int">4</attr>
<money type="int">5</money>
<dodge type="int">2</dodge>
</object>
<exit alias="west" to="west pass1">
<inherit name="westdirection" />
</exit>
</object>
<object name="West Overworld">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix>Location:(</prefix>
<suffix>)</suffix>
<attr name="grid_width" type="int">1</attr>
<attr name="grid_length" type="int">1</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<object name="west pass1">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="West Gates">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass2">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass2">
<inherit name="editor_room" />
<attr name="grid_width" type="int">10</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass1">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass3">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass3">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass2">
<inherit name="eastdirection" />
</exit>
<object name="Goblin">
<inherit name="editor_object" />
<inherit name="character" />
<alias>Goblin</alias>
<damage type="double">1</damage>
<attr name="current_hearts" type="int">10</attr>
<alt type="stringlist">
<value>monster</value>
</alt>
<open type="boolean">false</open>
<close type="boolean">false</close>
<isopen type="boolean">false</isopen>
<listchildren type="boolean">false</listchildren>
<hidechildren />
<dodge type="int">12</dodge>
<object name="Rupee">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<take />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<visible type="boolean">false</visible>
<scenery />
<use type="boolean">false</use>
<listchildren type="boolean">false</listchildren>
<money type="int">1</money>
</object>
</object>
</object>
</object>
<type name="character">
<dead type="boolean">false</dead>
<damage type="double">0</damage>
<money type="int">0</money>
<attr name="current_hearts" type="int">0</attr>
<dodge type="int">0</dodge>
</type>
<function name="fight_function" parameters="self, monster"><![CDATA[
if (monster = null) {
foreach (obj, AllObjects()) {
if (obj.alias=monster) {
monster = obj
}
else {
msg ("There's no " + monster + "in the vicinity.")
}
}
}
else if (not Doesinherit (monster,"character")) {
msg ("You can not battle that!")
}
else if (monster.dead = true) {
msg (monster.alias + " is already dead.")
}
else {
show menu ("You enter combat with the nasty " + monster.alias +", what do you do?", split("Swing_Up;Swing_Down;Swing_Left;Swing_Right;Block",";"), false) {
switch (result) {
case ("Swing_Up") {
result = 1
}
case ("Swing_Down") {
result = 2
}
case ("Swing_Left") {
result = 3
}
case ("Swing_Right") {
result = 4
}
case ("Block") {
result = 5
}
}
value = GetRandomInt (1,5)
if (value = result) {
if (result=1) {
if (monster.damage>self.dodge) {
msg ("You Swing_Up and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=2) {
if (monster.damage>self.dodge) {
msg ("You Swing_Down and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=3) {
if (monster.damage>self.dodge) {
msg ("You Swing_Left and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=4) {
if (monster.damage>self.dodge) {
msg ("You Swing_Right and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=5) {
msg ("You Block the " + monster.alias +"'s attack!")
fight_function (self, monster)
}
else if (monster.damage<self.dodge) {
msg ("The monster missed.")
}
}
else if (result=5) {
msg ("You fail to block the " + monster.alias +"'s attack!")
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
else {
msg ("You miss with your attack!")
if (self.dodge>monster.damage) {
msg ("You dodged the " +monster.alias+ "'s attack.")
self.current_hearts = self.current_hearts
}
else if (self.dodge<monster.damage) {
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
}
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
}
}
]]></function>
</asl>

Omega
22 Jan 2014, 19:50
Ok so i tried doing what you had posted last.
There was no error but when i played the game it was just dodge dodge dodge from both of us.
no one could hit.


So i decided to just focus on the player.
The goblin is set to a dodge of 2. making it easy to hit the monster.
So now i need to make sure that the player has a random interval (1,10)
to get 3 or > to hit.

here's what i have thusfar. i'll keep working at it though.


<!--Saved by Quest 5.4.4873.16527-->
<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>
<gridmap />
<mapscale type="int">5</mapscale>
<mapsize type="int">250</mapsize>
<start type="script">
</start>
</game>
<command name="fight_command">
<pattern>attack #object#</pattern>
<script>
fight_function (game.pov, object)
</script>
</command>
<object name="West Gates">
<inherit name="editor_room" />
<attr name="grid_width" type="int">3</attr>
<attr name="grid_fill">SlateGray</attr>
<enter type="script">
play sound ("The Legend Of Zelda Link's Awakening Music_ Mt. Tamaranch.mp3", false, true)
</enter>
<object name="player">
<inherit name="defaultplayer" />
<inherit name="character" />
<damage type="int">3</damage>
<statusattributes type="stringdictionary">
<item>
<key>current_hearts</key>
<value>Hearts: !</value>
</item>
<item>
<key>damage</key>
<value>Attack: !</value>
</item>
</statusattributes>
<attr name="current_hearts" type="int">4</attr>
<money type="int">5</money>
</object>
<exit alias="west" to="west pass1">
<inherit name="westdirection" />
</exit>
</object>
<object name="West Overworld">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix>Location:(</prefix>
<suffix>)</suffix>
<attr name="grid_width" type="int">1</attr>
<attr name="grid_length" type="int">1</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<object name="west pass1">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="West Gates">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass2">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass2">
<inherit name="editor_room" />
<attr name="grid_width" type="int">10</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass1">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass3">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass3">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass2">
<inherit name="eastdirection" />
</exit>
<object name="Goblin">
<inherit name="editor_object" />
<inherit name="character" />
<alias>Goblin</alias>
<damage type="double">0.5</damage>
<attr name="current_hearts" type="int">10</attr>
<alt type="stringlist">
<value>monster</value>
</alt>
<open type="boolean">false</open>
<close type="boolean">false</close>
<isopen type="boolean">false</isopen>
<listchildren type="boolean">false</listchildren>
<hidechildren />
<dodge type="int">1</dodge>
<object name="Rupee">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<take />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<visible type="boolean">false</visible>
<scenery />
<use type="boolean">false</use>
<listchildren type="boolean">false</listchildren>
<money type="int">1</money>
</object>
</object>
</object>
</object>
<type name="character">
<dead type="boolean">false</dead>
<damage type="double">0</damage>
<money type="int">0</money>
<attr name="current_hearts" type="int">0</attr>
<dodge type="int">0</dodge>
</type>
<function name="fight_function" parameters="self, monster"><![CDATA[
if (monster = null) {
foreach (obj, AllObjects()) {
if (obj.alias=monster) {
monster = obj
}
else {
msg ("There's no " + monster + "in the vicinity.")
}
}
}
else if (not Doesinherit (monster,"character")) {
msg ("You can not battle that!")
}
else if (monster.dead = true) {
msg (monster.alias + " is already dead.")
}
else {
show menu ("You enter combat with the nasty " + monster.alias +", what do you do?", split("Swing_Up;Swing_Down;Swing_Left;Swing_Right;Block",";"), false) {
switch (result) {
case ("Swing_Up") {
result = 1
}
case ("Swing_Down") {
result = 2
}
case ("Swing_Left") {
result = 3
}
case ("Swing_Right") {
result = 4
}
case ("Block") {
result = 5
}
}
value = GetRandomInt (1,5)
if (value = result) {
if (result=1) {
if (monster.damage>self.dodge) {
msg ("You Swing_Up and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=2) {
if (monster.damage>self.dodge) {
msg ("You Swing_Down and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=3) {
if (monster.damage>self.dodge) {
msg ("You Swing_Left and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=4) {
if (monster.damage>self.dodge) {
msg ("You Swing_Right and hit the monster.")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
monster.dead = true
msg ("The monster turns into a puff of smoke. ")
}
}
}
else if (result=5) {
msg ("You Block the " + monster.alias +"'s attack!")
fight_function (self, monster)
}
else if (monster.damage<self.dodge) {
msg ("The monster missed.")
}
}
else if (result=5) {
msg ("You fail to block the " + monster.alias +"'s attack!")
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
else {
msg ("You miss with your attack!")
if (self.dodge>monster.damage) {
msg ("You dodged the " +monster.alias+ "'s attack.")
self.current_hearts = self.current_hearts
}
else if (self.dodge<monster.damage) {
self.current_hearts = self.current_hearts - monster.damage
msg ("The " + monster.alias + " hit you for " + monster.damage + " damage!")
}
if (self.current_hearts <= 0) {
msg (monster.alias + " has killed you.")
finish
}
else {
fight_function (self, monster)
}
}
}
}
]]></function>
</asl>


Anyway I may be going about this all wrong. I'll just start over. If you want you can test what you have on your mind. thanks again.

That also goes for anyone else that's reading.

george
22 Jan 2014, 20:03
To get a random dodge stat, add this to your game:


<start type="script">
player.dodge = GetRandomInt(1,10)
Goblin.dodge = GetRandomInt(1,10)
</start>


When you play, open the Debug window. Click on the player or the goblin to see what their attributes are.

Omega
22 Jan 2014, 23:15
cool but i think someone already posted that and when i tried it I don't think it did anything different.

george
22 Jan 2014, 23:18
I know, I posted it before :).

If you want to have random dodge stats, that will work.

I haven't tested this possibility but the first time I posted that code I wrote 'goblin' with a lowercase g. Perhaps Quest thinks a 'goblin' and a 'Goblin' are different monsters? In that case the first code example wouldn't have worked with your code.

HegemonKhan
22 Jan 2014, 23:51
about your one comment, omega:

you're using the GetRandomInt, and it has a pretty good algorithm (you can download my "rock, paper, scissor" game and try and see if you can figure out it's pattern to get wins ... not too easy to crack its algorithm), and this may be causing the low odds, compounded even more, you set it to being like 1/5 (or lower odds) if it then matches up (between your "result" and "value"), and then maybe your chosen attribute values are still making the odds even lower too. You'll have to play around with it (I've learned that Game Mechanics is just as difficult as trying to figure out how to code something as is trying to also design a game, lol. The Big 3: Design, Programming, and Game Mechanics. Writing... I'll probably learn how hard that is... lol)

Personally, for odds, it may be best to use the "RandomChance (Object.Attribute - Object.Attribute)" that I used in my combat coding.

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

I almost totally forgot... there's also "D&D dice roll" coding too that you can use:

http://quest5.net/wiki/DiceRoll

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

omega wrote:So now i need to make sure that the player has a random interval (1,10)
to get 3 or > to hit.


Object.Attribute=GetRandomInt (1,10)
if (Object.Attribute >= 3) {
-> // script
} else if (Object.Attribute < 3) {
-> // script
}

or... more simply (but doesn't make any sense), lol:

Object.Attribute=GetRandomInt (3,10)

Omega
23 Jan 2014, 01:18
Thanks guys.

I think im going to try out what george had.

If that doesn't work ill go into what you got.

I actually deleted the entire fight_function and started it from scratch. Yes you're right a 1 out of 5 chance was toooooooooo great of a chance to get a hit. Therefore, I decided to have one pathway to swing sword. I left block in there too.

It works perfectly to my liking. The only thing is to test the randomizing code that george gave me on my player. I'll just leave monsters dodge to an actual interger value. (since monsters are boring. lol)

I'll put the game code down below so you can check out my changes. Then see what i was trying to get at all along. if you want. lol. This has been a crazy loop around discussion. So sorry guys if it seemed somewhat repetitive.

HK i also left the stat attributes the same for damage and health. So if you wanted to change to what I had earlier (hearts, damage). go for it. i have to change all that too. (but first to get that DAMN random # thing going).


<!--Saved by Quest 5.4.4873.16527-->
<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>
<start type="script">
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="character_type" />
<attr name="current_health" type="int">20</attr>
<statusattributes type="stringdictionary">
<item>
<key>current_health</key>
<value>HP: !</value>
</item>
</statusattributes>
<dodge type="int">5</dodge>
<attr name="physical_damage" type="int">5</attr>
<block type="int">5</block>
</object>
<object name="monster_1">
<inherit name="editor_object" />
<inherit name="character_type" />
<alias>orc</alias>
<attr name="physical_damage" type="int">1</attr>
<dodge type="int">1</dodge>
<block type="int">1</block>
<attr name="current_health" type="int">20</attr>
</object>
</object>
<command name="fight_command">
<pattern>attack #object#</pattern>
<script>
fight_function (game.pov, object)
</script>
</command>
<type name="character_type">
<dead type="boolean">false</dead>
<attr name="current_health" type="int">0</attr>
<attr name="physical_damage" type="int">0</attr>
<dodge type="int">0</dodge>
<block type="int">0</block>
</type>
<function name="fight_function" parameters="self, monster"><![CDATA[
if (monster = null) {
foreach (obj, AllObjects()) {
if (obj.alias=monster) {
monster = obj
}
else {
msg ("There's no " + monster + "in the vicinity.")
}
}
}
else if (not Doesinherit (monster,"character_type")) {
msg ("You can not battle that!")
}
else if (monster.dead = true) {
msg (monster.alias + " is already dead.")
}
else {
show menu ("The monster attacks, what do you do?", split("Swing Sword;Block",";"), false) {
if (result= "Swing Sword") {
if (monster.dodge<self.physical_damage) {
msg ("You swing your sword and hit the " + monster.alias +"!")
monster.current_health = monster.current_health - self.physical_damage
if (monster.current_health <=0) {
msg ("The monster dies in a puff of smoke.")
monster.dead = true
}
else {
fight_function (self, monster)
}
}
else if (monster.dodge>self.physical_damage) {
msg ("You swing but miss the target.")
msg ("The monster attacks you.")
if (monster.physical_damage>self.dodge) {
self.current_health = self.current_health - monster.physical_damage
msg ("You get hit.")
if (self.current_health <=0) {
msg ("You died.....")
finish
}
else {
fight_function (self, monster)
}
}
else if (monster.physical_damage<self.dodge) {
msg ("The monster missed your attack. ")
}
else {
fight_function (self, monster)
}
}
}
else if (result= "Block") {
if (monster.physical_damage<self.block) {
msg ("You Block the " + monster.alias +"'s attack!")
fight_function (self, monster)
}
else if (monster.physical_damage>self.block) {
msg ("You failed to block the monsters attack. ")
self.current_health = self.current_health - monster.physical_damage
msg ("You take " +monster.physical_damage+ " of damage.")
if (self.current_health <=0) {
msg ("You died...")
finish
}
else {
fight_function (self, monster)
}
}
}
}
}
]]></function>
</asl>

Omega
23 Jan 2014, 01:28
Alright George

I tested what you mentioned. Unfortunately, It didn't work. Nothing changed.
I left dodge blank for both characters and the game said that i missed the goblin and the goblin missed me
after like 20 turns....

So that code doesn't have any effect to the player or the goblin.


Nice try though.

Omega
23 Jan 2014, 01:42
HAZZA! I think i got it HK.

I did what you mentioned at the top of the fight function.

player.dodge = GetRandomInt(1,10)


I tested it first with the monsters phys damage set to 2
With test i kept hitting
but......

when i switched it to 12 (to see if no matter what number i get from random)
I would always get hit.

So i decided to switch it to 5 (that should get give me a 50% chance of getting hit.)
it was definitely random.

HAZZA!

well for now. Let's see what happens when i get more monsters in and random numbers get's harder to get a hit in there.
thanks again man.

george
23 Jan 2014, 01:55
Sorry, I haven't looked at your fight code.

The code HK put at the top of the fight function, and the code in the start script, is the same thing.

However in the fight code it'll probably change it every time the fight code runs. Do you want the dodge stat to be the same every attack, or different?

Omega
23 Jan 2014, 02:06
It's suppose to be different so the monster has a chance to hit.

But yes both of your codes were the same. but when i read your code it contained <start>
Reading that, i believed you were wanting me to put that in the game script to start the game. Not the start of the fight_function


Must of misread it?

Anyway it's cool george I actually have it set and good to go. Thanks.

BUT I do have another road path that is blocked but should be easy to find out:

when i kill the monster I want it to drop an object. like a key or ball or money.
But i want the item to be noticeable when it is dropped and when i pick it up it goes into my pocket with other keys, balls, money (ha balls).

but that's the next obstacle.

Omega
23 Jan 2014, 04:20
HAZZA!
I actually did it.

The next is the shop where i sell and buy. (mostly buy only)

But that's for another time. I finally can move on to my level 1 dungeon.

Omega
23 Jan 2014, 05:20
Dang. Ok stuck on something.

Not sure if someone figured this one out yet. But....

I'm wondering if there is a possibility for spawning a monster?

During the fight function I set it to show monster is dead and made invisible so you can't see it in the room anymore.

I want it to make the monster come back into the room after an amount of time. (same monster)
but when i try to do it I get an error saying unknown obj or val 'monster'.

Even though the code of the fight function called it a monster and had no errors it wont make the monster visible again.

So i tried setting a timer instead after the monster is made invisible.

Anyone know of a timer that makes the same exact monster to spawn again?
That would be cool. thanks.

HegemonKhan
23 Jan 2014, 06:10
Object.Attribute=true ~~ Attribute Type of the built-in "visable" Attribute: boolean (boolean = flag)
monster.visible=true
~and~
monster.dead=false

in GUI~Editor: "SetObjectFlagOn" Script

if (monster.visible=false and monster.dead=true) {
-> monster.visible=true
-> monster.dead=false
}

so, just use this stuff in your Timer's Scripting

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

if you don't want to use a timer, these are great ways to randomly "spawn" or choose "events" or "treasure chests ~ item drops":

GetRandomInt (Min,Max)
RandomChance (Value: 0-100)

x = GetRandomInt (1,3)
switch (x) {
-> case (1) {
->-> orc.visible=true // method 1
-> }
-> case (2) {
->-> ogre.parent = room_x // method 2
-> }
-> case (3) {
->-> // create Object (troll) // method 3
-> }

~OR~

if (RandomChance (Value) = true) {
-> // orc.visible=true // method 1
-> // or: ogre.parent = room_x // method 2
-> // or: create Object (troll) // method 3
}

~OR~

x = GetRandomInt (1,3)
if (RandomChance (Value) = true) {
-> switch (x) {
->-> case (1) {
->->-> // orc fight event
->-> }
->-> case (2) {
->->-> // find an item event
->-> }
->-> case (3) {
->->-> // find a dungeon event
->-> }
-> }

sgreig
23 Jan 2014, 11:31
I've only skimmed this topic as I'm really tired and should be going to bed, but if you need to convert a string to an integer or vice versa there are functions for that. I believe they are ToInt() and ToStr() or something along those lines. You should be able to find them in the Quest Wiki. Not sure if that helps at this point, but there you go.

http://www.quest5.net/wiki/ToInt

Omega
23 Jan 2014, 19:06
noice thanks HK.

I'll try them out right now.
and let you know how that works.

also thanks sgrieg I actually did get it to work with HK/george's coding. So no worries. Although I never seen those change codes before. maybe if i get stuck somewhere i'll use them.

Omega
23 Jan 2014, 19:19
So....

it didn't work out.

I got this to show up.
Error running script: Error compiling expression 'monster.visible=false and monster.dead=true': Unknown object or variable 'monster'

here's the code to the new changes. You'll see that at the bottom of the entire fight function there's where I put the codes to make monster invis and the timer to start.


<!--Saved by Quest 5.4.4873.16527-->
<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>
<gridmap />
<mapscale type="int">5</mapscale>
<mapsize type="int">250</mapsize>
<difficulty>Medium</difficulty>
<cruelty>Polite</cruelty>
<start type="script">
</start>
</game>
<command name="fight_command">
<pattern>attack #object#</pattern>
<script>
fight_function (game.pov, object)
</script>
</command>
<object name="West Gates">
<inherit name="editor_room" />
<attr name="grid_width" type="int">3</attr>
<attr name="grid_fill">SlateGray</attr>
<enter type="script">
play sound ("The Legend Of Zelda Link's Awakening Music_ Mt. Tamaranch.mp3", false, true)
</enter>
<object name="player">
<inherit name="defaultplayer" />
<inherit name="character" />
<inherit name="money" />
<damage type="int">3</damage>
<statusattributes type="stringdictionary">
<item>
<key>current_hearts</key>
<value>Hearts: !</value>
</item>
<item>
<key>damage</key>
<value>Attack: !</value>
</item>
<item>
<key>rupee</key>
<value>Rupees: !</value>
</item>
</statusattributes>
<attr name="current_hearts" type="int">4</attr>
<rupee type="int">15</rupee>
</object>
<exit alias="west" to="west pass1">
<inherit name="westdirection" />
</exit>
</object>
<object name="West Overworld">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix>Location:(</prefix>
<suffix>)</suffix>
<attr name="grid_width" type="int">1</attr>
<attr name="grid_length" type="int">1</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<object name="west pass1">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="West Gates">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass2">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass2">
<inherit name="editor_room" />
<attr name="grid_width" type="int">10</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass1">
<inherit name="eastdirection" />
</exit>
<exit alias="west" to="west pass3">
<inherit name="westdirection" />
</exit>
</object>
<object name="west pass3">
<inherit name="editor_room" />
<attr name="grid_width" type="int">5</attr>
<attr name="grid_length" type="int">5</attr>
<attr name="grid_fill">MediumSpringGreen</attr>
<exit alias="east" to="west pass2">
<inherit name="eastdirection" />
</exit>
<object name="Goblin">
<inherit name="editor_object" />
<inherit name="character" />
<inherit name="money" />
<alias>Goblin</alias>
<damage type="double">0.5</damage>
<attr name="current_hearts" type="int">2</attr>
<alt type="stringlist">
<value>monster</value>
</alt>
<open type="boolean">false</open>
<close type="boolean">false</close>
<isopen type="boolean">false</isopen>
<listchildren type="boolean">false</listchildren>
<hidechildren />
<dodge type="int">1</dodge>
<rupee type="int">4</rupee>
<spawn type="int">1</spawn>
<object name="Rupee">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<take />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<scenery type="boolean">false</scenery>
<ontake type="script">
player.rupee = player.rupee+Goblin.rupee
MakeObjectInvisible (Rupee)
</ontake>
</object>
</object>
</object>
</object>
<type name="character">
<dead type="boolean">false</dead>
<damage type="double">0</damage>
<attr name="current_hearts" type="int">0</attr>
<dodge type="int">0</dodge>
<block type="int">0</block>
<spawn type="int">0</spawn>
</type>
<type name="money">
<rupee type="int">0</rupee>
</type>
<function name="DoDrop" parameters="object, ismultiple"><![CDATA[
prefix = ""
if (ismultiple) {
prefix = GetDisplayAlias(object) + ": "
}
if (not ListContains(ScopeInventory(), object)) {
msg (prefix + DynamicTemplate("NotCarrying", object))
}
else if (not ListContains(ScopeReachable(), object)) {
msg (prefix + DynamicTemplate("ObjectNotOpen", GetBlockingObject(object)))
}
else {
found = true
dropmsg = object.dropmsg
switch (TypeOf(object, "drop")) {
case ("script") {
if (ismultiple) {
msg (prefix)
}
do (object, "drop")
dropmsg = ""
}
case ("boolean") {
if (object.drop = true) {
object.parent = game.pov.parent
if (dropmsg = null) {
dropmsg = DynamicTemplate("DropSuccessful", object)
}
}
else {
found = false
}
}
case ("string") {
object.parent = game.pov.parent
dropmsg = object.drop
}
default {
found = false
}
}
if (not found and dropmsg = null) {
dropmsg = DynamicTemplate("DropUnsuccessful", object)
}
if (LengthOf(dropmsg) > 0) {
msg (prefix + dropmsg)
}
if (HasScript(object, "ondrop")) {
do (object, "ondrop")
}
}
]]></function>
<function name="fight_function" parameters="self, monster"><![CDATA[
player.dodge = GetRandomInt(1,10)
if (monster = null) {
foreach (obj, AllObjects()) {
if (obj.alias=monster) {
monster = obj
}
else {
msg ("There's no " + monster + "in the vicinity.")
}
}
}
else if (not Doesinherit (monster,"character")) {
msg ("You can not battle that!")
}
else if (monster.dead = true) {
msg (monster.alias + " is already dead.")
}
else {
show menu ("The monster attacks, what do you do?", split("Swing Sword;Block",";"), false) {
if (result= "Swing Sword") {
if (monster.dodge<self.damage) {
msg ("You swing your sword and hit the " + monster.alias +"!")
monster.current_hearts = monster.current_hearts - self.damage
if (monster.current_hearts <=0) {
msg ("The monster dies in a puff of smoke.")
monster.dead = true
Rupee.drop = true
if (Rupee.drop = true) {
msg ("Monster dropped a rupee.")
MoveObject (Rupee, west pass3)
}
}
else {
fight_function (self, monster)
}
}
else if (monster.dodge>self.damage) {
msg ("You swing but miss the target.")
msg ("The monster attacks you.")
if (monster.damage>self.dodge) {
self.current_hearts = self.current_hearts - monster.damage
msg ("You get hit.")
if (self.current_hearts <=0) {
msg ("You died.....")
finish
}
else {
fight_function (self, monster)
}
}
else if (monster.damage<self.dodge) {
msg ("The monster missed your attack. ")
fight_function (self, monster)
}
else {
fight_function (self, monster)
}
}
}
else if (result= "Block") {
if (monster.damage<self.block) {
msg ("You Block the " + monster.alias +"'s attack!")
fight_function (self, monster)
}
else if (monster.damage>self.block) {
msg ("You failed to block the monsters attack. ")
self.current_hearts = self.current_hearts - monster.damage
msg ("You take " +monster.damage+ " of damage.")
if (self.current_hearts <=0) {
msg ("You died...")
finish
}
else {
fight_function (self, monster)
}
}
}
}
MakeObjectInvisible (monster)
EnableTimer (monster spawn)
}
]]></function>
<timer name="monster spawn">
<interval>10</interval>
<enabled />
<script>
if (monster.visible=false and monster.dead=true) {
monster.visible = true
monster.dead = false
}
</script>
</timer>
</asl>


In the mean time im going to be working on getting the character past the 3rd room and onto where level one is.
thanks again guys.

HegemonKhan
23 Jan 2014, 19:42
oops... my bad... I used "monster" when your Object's Name (ID) Attribute is "Goblin", lol. Just replace "monster" with your "Goblin".

if (Goblin.visible=false and Goblin.dead=true) {
-> Goblin.visible=true
-> Goblin.dead=false
}


Also, Capitols vs Lower Cases matter, ie "Goblin" is one thing and "goblin" is another thing. The big "G" and little "g" are two completely different characters, it's as if you got "a" and "z", or "1" and "5". You must be exact in what you're telling the computer to do or to use, as specifically the "Name" Attribute is the "ID" Attribute for the quest game engine to use.

Sorry, I wasn't paying attention (your "alt" String List Attribute ~ alternative aliases ~ uses "monster" so that's where I got it from ~ not paying attention), to your actual Object's name ("Goblin"), laughs.

and here's the full built-in codes from where sgreig referenced:

1. http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
2. http://quest5.net/w/index.php?title=Cat ... h#mw-pages (page 2, range: S-Z)
3. http://quest5.net/wiki/Object_element
4. http://quest5.net/wiki/Attribute_Types

Omega
23 Jan 2014, 23:47
Nice. yea that's totally true.

Yet, i came across a problem where this might not be needed. Basically i copied and pasted the same monster (obviously getting a 1 added to the name like: Goblin1)

and now when i run the game i came, killed the first goblin made. moved down to a different room and found another goblin.
typed in attack, killed it. BUT

this time it came with an error because it's a different monster type. (which is stupid).

anyway When i kill it the monster won't follow the code for dropping the rupee because rupee is also Rupee1 and not the same Rupee from the first monster i killed. I can't put a huge list of rupees# to drop after they die otherwise there's a huge list for it.

I just saw that you mentioned alias is the ID of the object. so if i did:

monster.dead=true
Rupee.ID.drop = true
if Rupee.ID.drop= true
msg(rupee is dropped)
move object (rupee,west pass3) <--- obviously, I will change this since the other monsters are in diff rooms.

I don't think that would work. right?

here's the original for the only goblin in the room.


msg ("The monster dies in a puff of smoke.")
monster.dead = true
Rupee.drop = true
if (Rupee.drop = true) {
msg ("Monster dropped a rupee.")
MoveObject (Rupee, west pass3)
}

HegemonKhan
24 Jan 2014, 00:50
no, that's incorrect, sorry for the confusion.

think of the computer~quest as the gov. The gov requires "IDs" (SS#, Drivers ID card, fingerprint, DNA, retina~eye scan) to identify you as you. No one can have the same ID (SS#, Drivers ID, fingerprint, retina~eye scan, DNA), as if that were~could happen, then the gov. would have no idea of who is who, or what is what:

over the police radio: arrest warrent for Driver's ID: 12345
Cop has two people (Mr. Smith and Mrs. Smith) with the same Driver's ID: 12345
Cop: who do I arrest? Mr. Smith or Mrs. Smith ???

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

whereas, if you have people with unique IDs (in quest, this is the: Name Attribute), then it doesn't matter if they have the same name (in quest, this is the: Alias Attribute):

Object_1's ID (Name Attribute): 12345
Name (Alias Attribute): john

Object_2's ID (Name Attribute): 67890
Name (Alias Attribute): john

over the police radio: arrest warrent for Driver's ID: 12345
Cop has two people (john and john) that he caught.
Cop: you're under arrest (1st) john, as you've got the matching ID (Name Attribute) of: 12345
Cop to the other (2nd) john: you may go free, sorry for the trouble.

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

so...

Object_1's Name Attribute: potion_1
Object_1's Alias Attribute: red potion

Object_2's Name Attribute: potion_1
Object_2's Alias Attribute: blue potion

ERROR !!!!

Object_1's Name Attribute: potion_1
Object_1's Alias Attribute: red potion

Object_2's Name Attribute: potion_2
Object_2's Alias Attribute: red potion

NO error

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

now, for example, when you clone an Object:

Original_Object's Name Attribute: potion
Original_Object's Alias Attribute: red potion
Etc Attributes: original_blah

it automatically creates a new (different) Name Attribute for the cloned object, so no error occurs, while everything else is the same~cloned of the Original Object:

Cloned_Object's Name Attribute: potion2
Cloned_Object's Alias Attribute: red potion
Etc Attributes: original_blah

so... now you can't use the Name Attribute in your scripting, as your new~other object, doesn't have that original Value for it's Name Attribute.

thus, you have to use something else (some other Attribute), such as:

Alias (a built-in String Attribute), "potion_type=red potion" (custom String Attribute), "is_this_a_potion=true" (custom Boolean Attribute), or etc...

for example, maybe you were wondering about this in my combat code:

enemy = GetObject (text)
if (enemy = null) {
foreach (obj,AllObjects()) {
if (obj.alias=text) {
enemy = obj
}
}
}
if (enemy = null) {
msg ("There is no " + text + " here.")
}


since it uses a Command (gets the typed-in input during game play), and that the game player only sees or knows of the Object's Alias Attribute (orc), and not the Object's Name Attribute (orc_1), the player is going to type in: orc

the problem is that quest is going to look for an Object, with the Name Attribute of "orc", which there is none (as "orc_1" is not "orc"), and so quest will return an error, as it couldn't find such an Object ("orc"). So, the code above is for this issue, and here's how it works:

conceptually:

if no Object (Name Attribute) "orc" exists, then look (in my code above I use: through ALL Objects in the entire game, but you can just get All the Objects in just the room that the player is in too) for an Object with an Alias Attribute of "orc", and if such an Object is found, then use~get this Object for the (rest of the) script.

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

just to re-hash:

to us humans : to computer or quest

the thing itself, its unique or one-of-a-kind "DNA~fingerprint~SS#~Drivers ID Card" (ID=unique Indentifier) : (use) Name Attribute

name : (use) Alias Attribute

nick name: (use) Alt Attribute

so, it's a bit confusing...

HegemonKhan
24 Jan 2014, 01:14
In terms of coding design:

the simpliest way is to do each Object's individual Verb script:

omega wrote:Yet, i came across a problem where this might not be needed. Basically i copied and pasted the same monster (obviously getting a 1 added to the name like: Goblin1)

and now when i run the game i came, killed the first goblin made. moved down to a different room and found another goblin.
typed in attack, killed it. BUT

this time it came with an error because it's a different monster type. (which is stupid).


you just have to change all of the other code stuff to match up with your new "Goblin_2", and your "rupee_2" (which you didn't know to change also, I presume as you don't mention doing this)

"this" is useful within an Object's Verb's scripting, as it gets the object for you, so you don't need to be making sure that you're using the correct Object name "Goblin_1, Goblin_2, etc", as all you got to do is: "this.Attribute", instead of "Goblin_1.Attribute" or is it... "Goblin_2.Attribute" or is it... "Goblin_3.Attribute... so as you can see, much easier: "this.Attribute" or (unfortunately, you will have to type out the correct sub object such as... ) "this.rupee_1.parent=player" or "this.rupee_2.parent=player" or etc, lol, but it's better than: "Goblin_1.rupee_1.parent=player" or "Goblin_2.rupee_2.parent=player" or etc...

<object name="goblin_1">
<inherit name="editor_object" />
<alias>goblin</alias>
<attr name="dead" type="boolean">false</attr>
<attr name="displayverbs" type="listextend">fight;loot</attr>
<attr name="loot" type="script">
if (this.dead=true) {
firsttime {
this.rupee_1.parent = player
} otherwise {
msg ("You already looted this corpse, silly.")
} else if (this.dead=false) {
msg ("it's still alive, idiot!")
msg ("As you try to loot, err steal, his rupee, the goblin cuts off your head.")
msg ("GAME OVER")
finish
}
</attr>
<attr name="fight" type="script">
if (this.dead=true) {
msg ("It's already dead, why do you want to fight its corpse?")
} else if (this.dead=false) {
this.dead=true
msg ("You attack the goblin, killing it")
}
</attr>
<object name="rupee_1">
<inherit name="editor_object" />
<alias>green rupee</alias>
</object>
</object>

<object name="goblin_2">
<inherit name="editor_object" />
<alias>goblin</alias>
<attr name="dead" type="boolean">false</attr>
<attr name="displayverbs" type="listextend">fight;loot</attr>
<attr name="loot" type="script">
if (this.dead=true) {
firsttime {
this.rupee_2.parent = player
} otherwise {
msg ("You already looted this corpse, silly.")
} else if (this.dead=false) {
msg ("it's still alive, idiot!")
msg ("As you try to loot, err steal, his rupee, the goblin cuts off your head.")
msg ("GAME OVER")
finish
}
</attr>
<attr name="fight" type="script">
if (this.dead=true) {
msg ("It's already dead, why do you want to fight its corpse?")
} else if (this.dead=false) {
this.dead=true
msg ("You attack the goblin, killing it")
}
</attr>
<object name="rupee_2">
<inherit name="editor_object" />
<alias>green rupee</alias>
</object>
</object>


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

but, you obviously don't want to do this over and over and over... for every single 'monster' (Goblin, Goblin_2, Ogre, etc) Object... lol

thus you want to make a "universal call script" (such as using a Command, Turnscripts, Timers, "Changed" Scripts, Functions, Call Functions, Scripts, and~or Invoking Scripts), which requires a bit more advanced coding, so ask us for help on this, as there's a lot of coding designs that will take you some time to learn (it's taken me over a year to learn what know now, lol).

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

here's an example of such a "universal call script":

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

<function name="battle_system" parameters="self,text">
enemy = GetObject (text)
if (enemy = null) {
foreach (obj,AllObjects()) {
if (obj.alias=text) {
enemy = obj
}
}
}
if (enemy = null) {
msg ("There is no " + text + " here.")
}
else if (not Doesinherit (enemy,"npc")) {
msg ("You can not battle that!")
}
else if (not npc_reachable (enemy)) {
msg ("There is no " + enemy.alias + " in your vicinity.")
}
else if (GetBoolean (enemy,"dead") = true) {
msg (enemy.alias + " is already dead.")
}
else if (GetBoolean (enemy,"hostile") = false) {
msg (enemy.alias + " is not hostile.")
}
else {
battle_sequence (self,enemy)
}

</function>


let's go through it step by step:

during game play, you type in: fight orc (or: fight table, or: fight the_sky, lol, or: fight 'whatever')

quest then gets "player" (or "game.pov") Player Object to use it in the function, and it gets the "text" (what the game player typed-in during game play) to use it in the function

it then tries to get the Object of the "text" (ie "orc"), but there's no such object...

if it can't find an object, then it searches through all of the objects in the game, checking if their Alias Attribute matches up with the "text" ("orc"), and indeed, one such object does: orc_1

since it found such an object, it will use this object in the function, but should it not find such an object, then the function is over already. The person playing the game will have to try a different typed-in input...

since the function is using any object of what the person typed in... we need to put some "Stops" and~or "checks" up, for example:

we can't (or don't want to) be able to fight a building~room, an object (a table), an item, a peaceful npc, and etc... lol

so for my "fightable" objects I've "branded" them with the Object Type "npc"

so if the object doesn't have this "npc" Object Type added to it, then you can't fight it.

I also wanted to add in the aspect of if the fightable object is "reachable" or not, such as if: the orc is on the other side of a river, and neither of you can swim nor have any projectile attacks, and thus you can't fight each other yet. Or, (just go with me on this, lol) if the orc is locked inside of a chest, you obviously can't fight it yet until you open up the chest. So, I have a check for this too

my next check is that we don't want to be fighting a corpse (an already dead monster).

and my last check: we don't want to be fighting an npc that is friendly (you have to lower it's "hostility" int Attribute, so that it becomes "hostile" towards you, and thus fightable, to fight it, lol).

-----

the key point is that this scripting will work for ANYTHING that the person types in during game play, ie I only had to write this code once, and not every time for every Object's Verb's Scripting... via using the Command and the checks and "branding" booleans" (putting 1-3 "branding" booleans on each object, is better than having to do an entire verb scripting for every object ~ and I can not even have to do this, via using Object Types, reducing further the amount of stuff i have to do onto objects).

Omega
24 Jan 2014, 20:02
wow that is a lot to do. maybe im better off working on the entire map procedure then work on monster battle.

thanks though HK i actually understand what you mean. I was attempting to get it to work on the alias, but didn't realize how complicated it was until now. I'll work on it when i get the chance.

Thanks again.

HegemonKhan
24 Jan 2014, 20:36
it's not too hard to do (for us anyways) in terms of coding, but it's probably a bit (or a lot) beyond your ability right now (as it'll take time to learn), so if you want, we (I or any of the others ~ who know coding much better than I, especially) could code it in for you. Just let us (or me) know, and we (or I) will do it for you (when I got the time).

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

also, try asking someone else for help on this, as if they're good with programming~coding (such as any of the mods or some members ~ look who made the libraries, lol), they can help you much better than I: more clear~better explanations and better simplier easier code designs, and etc... lol. I'm trying... but I'm not very good at coding, nor thus at explaining things as well.

Omega
02 Jul 2014, 18:04
late reply but thanks dude. After some time away from Quest I captured the intensity of this game design and decided not to over complicate things for myself, and rather look to future updates that makes the coding a whole lot easier. I came into this not knowing jack about coding but over the course of practice and typing on Quest I actually learned lots. So still a beginner but just barely? lol. Thanks for putting up with ridiculous questions.