strings to numeric, can it be done?

Elexxorine
08 Dec 2005, 11:17
i'm having some trouble when trying to use properties as quest sees them as strings, yet i need to use them as numerics. i have tried setting numeric status variables as them but quest crashes.... how can i, if at all, do it?

paul_one
08 Dec 2005, 13:02
property <#object#; value> - or however you do a property set... then:

set numeric <temporaryvalue; #(object):property# >

Now that should get all the numbers from the property.

Elexxorine
09 Dec 2005, 13:53
i'm doing that but it comes up with 'type mismatch' and 'invalid procedure call or arguement'. you seriously think i didn't think of setting a numeric to the propery value? shame on you tron.

paul_one
11 Dec 2005, 20:18
Here is a snippet of code that WORKS.
As tested, by me.
Type "property" and then ANYTHING - mixture of numbers and/or letters and/or funny symbols. I'd be a little careful around #'s and %'s though.

Does this mean I get a prize like this? (warning, naughty piccy for those at work/etc/under a certain age):
[ link removed by Alex, obviously... ]

' Game created by the Almighty Tr0n²

define game <property test>
asl-version <350>
game author <Tr0n²>
game version <0.35>
game info <Created for Elexxorine>

start <onlyroom>

define variable <whitenumbers>
type numeric
value <0>
display <white: !>
end define

end define

define room <onlyroom>

description <Woop! ... A plain white room - what do you expect?>

command <property #value#> {
property <onlyroom; white=#value#>
msg <Property now = #onlyroom:white# ! >
}
command <set> {
set numeric <whitenumbers; #onlyroom:white#>
msg <%whitenumbers%>
}
command <set2> {
set numeric <whitenumbers; $objectproperty(onlyroom;white)$>
msg <%whitenumbers%>
}

end define

Elexxorine
11 Dec 2005, 20:41
ok. my code's a little bit more complicated than that. plus i need to use #'s and do maths with the properties.... there's my code, YAY you get to go through 21 1/2 K of text...... sorry.... (the bit where it doesn't work is when checking who goes first in the battle, that the first bit using properties in maths... that's as far as i get, quest crashes there, the mon_hit codes are pritty much the same as the one's for you, except switched over....) have fun:

' "Elexxorine's RPG base code"
' Created with QDK 3.53 - UNREGISTERED VERSION

define game <Elexxorine's RPG base code>
asl-version <350>
gametype singleplayer
start <Start>
game author <Elexxorine>
game version <0.0.001>
game copyright <© 2005 Elexxorine.>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
default fontsize <16>
background <black>
foreground <white>
startscript {
give <me>
msg <|s45|jc|bWelcome to Elexxorine's |cl|iRPG Base Code.|cb|xi|xb|s22|n|jc|iFor making advanced single player rpg's.|xi|n|cr|jc(Copyright: 2005 by Elexxorine.)|cb|n|nThis code has been made for use as a base for rpg's. It includes a battle system, time, highly advanced weather system, shops, magic, conditions, and many other cool stuff.|n|n|iI would like to thank Christopher Ames and his 'RPG - Reading Presented Gallivant' for inspiring me to keep going and showing me how useful object properties are.|xi|n|nPlease tell me of all bugs/comments/etc by emailing me at: |cr|ilord.daedran@hotmail.com|cb|xi, even if it's just a spelling mistake - though all care has been put into making this game grammatically correct and spelt right, I am still dyslexic (yet I can spell dyslexia, strange) and will make mistakes.|n|nAnyway: I hope you enjoy.>
wait <Press any key...>
clear
msg<|jc|s16CHANGE!!!!!>
clear
}
afterturn do <after turn checks>
command <stats> msg <You are a level #me:lvl# #me:gender# #me:race# #me:class#, going by the name of #me:name#. You are wearing #me:armour_body# about your body as well as #me:armour_extra# and carrying a #me:weapon#.|nTpye '|cgstats me/weapon/armour/items/spells/area|cb' for more info.>
command <stats me> msg <|bGeneral:|xb|nName: #me:name#.|nRace: #me:race#.|nClass: #me:class#.|nGender: #me:gender#.|nLevel: #me:lvl#.|nExp: #me:exp#.|n|nHit points: #me:cur_hp# / #me:max_hp#.|nMana: #me:cur_mp# / #me:max_mp#.|nStamina: #me:cur_sta# / #me:max_sta#.|nHunger: #me:cur_hun# / #me:max_hun#.|n|nWeapon: #me:weapon#.|nArmour: #me:armour_body#.|nOther: #me:armour_extra#.|n|n|bStats:|xb|nStrength: #me:temp_str# / #me:max_str#.|nAglity: #me:temp_agl# / #me:max_agl#.|nIntelligance: #me:temp_int# / #me:max_int#.|nWisdom: #me:temp_wis# / #me:max_wis#.|nCharisma: #me:temp_cha# / #me:max_cha#.|nDexerity: #me:temp_dex# / #me:max_dex#.|nSpeed: #me:temp_spd# / #me:max_spd#.|nStamina: #me:temp_sta# / #me:max_sta#.|n|n|bConditions:|xb|n>
error <badcommand; You cannot do that.>
error <badthing; You cannot see that here.>
error <badplace; You cannot go there.>
error <itemunwanted; #quest.error.gender# politely refuses your offer.>
error <defaultuse; You can't use that now.>
error <cantdrop; You cannot drop this.>
error <noitem; You don't have that.>
error <badexamine; You cannot do that.>
error <badgo; You cannot do that.>
error <baduse; You cannot do that.>
error <badgive; Give to whom?>
error <badtake; You cannot take that.>
error <baditem; You cannot see that.>
error <baddrop; You don't have that.>
error <badpronoun; Please define 'it'.>
error <defaultout; You cannot go out from here.>
error <defaultdrop; You drop #quest.error.article# onto the ground.>
error <defaultexamine; $objectproperty(#thing#; look)$>
error <defaultlook; Surprisingly uninteresting.>
error <defaultspeak; You cannot speak to #quest.error.gender#.>
error <defaulttake; You take #quest.error.article# and put #quest.error.article# in your bag.>
define variable <diffrate>
type numeric
value <0>
end define
` badcommand: the player types an invalid command
` baddrop: the player tries to drop an object they are not carrying
` badexamine: the player uses "examine" in an unrecognized way
` baditem: the player tries to take an object which does not exist
` badgo: the player uses "go" in an unrecognized way
` badgive: the player uses "give" and does not specify an object to give to
` badlook: (obsolete from Quest 3.1 onwards)
` badplace: the player tries to go to a non-existent room using "go to ...".
` badpronou:n the player uses a pronoun ("IT" etc.) when that pronoun doesn
` (the pronoun used is returned in #quest.error.pronoun#)
` badtake: the player tries to take an object which can
` badthing: the player tries to do something to an object that does not exist
` baduse: the player uses "use" in an unrecognized way
` cantdrop: the player tries to drop an object that can
` defaultdrop: the player successfully drops an object
` (the article (e.g. "it", "them") is returned in #quest.error.article#)
` defaultexamine: the player examines something for which there is no examine tag defined
` defaultlook: the player looks at something for which there is no "look" tag defined
` defaultout: the player tries to use "out" to exit from a room which has no "out" tag
` defaultspeak: the player speaks to an object for whom there is no "speak" tag defined
` defaulttake: the player picks up an object successfully. e.g. "You pick it up."
` defaultuse: the player tries to use something on an object where no relevant "use" tag can be found
` itemunwanted: an object does not want an object being given to it (i.e., no relevant "give" tag can be ` found)
` noitem: the player tries to use an object they don
end define

define synonyms
end define

define room <Start>
alias <Unknown>
look <Swirling mist surrounds you, covering your body and all that is around you. You cannot see anything but the mist. Slowly it changes colour from its dull grey to a pale blue and then to purple, you can fell your invisable body changing shape, forming outside your vision. A tiny thought is telling you that you can control this shaping somehow...>
indescription <|jl|s16You do not know where you are.>
script {
wait <Press any key...>
choose <race_pick>
}

define object <me>
alias <you>
alt <me; myself>
look exec <stats>
examine exec <stats me>
displaytype <PC>
article <you>
properties <you; character; max_hp=0; cur_hp=0; max_mp=0; cur_mp=0; cur_hun=0; max_hun=0; name=(no name); race=(no race); class=(no class); gender=(no gender); lvl=0; exp=0; armour_body=nothing; armour_extra=nothing; weapon=nothing; max_str=0; max_agl=0; max_int=0; max_wis=0; max_cha=0; max_dex=0; max_sta=0; max_spd=0; cur_str=0; cur_agl=0; cur_int=0; cur_wis=0; cur_cha=0; cur_dex=0; cur_sta=0; cur_spd=0; temp_str=0; temp_agl=0; temp_int=0; temp_wis=0; temp_cha=0; temp_dex=0; temp_sta=0; temp_spd=0; not dead; not poison; not deadly_poison; not mind_poison; not mind_sap; not paralye; not burn; not freeze; not confusion; not blind; not mute; not deaf; not sleep; not stun; not unkillable; not nightsee; not fly; not invisable>
end define

end define

define room <Start2>
alias <Unknown>
look <The mist still surrounds you and your nearly formed body. Its colour keeps switching between a powder blue and a warm pink...>
indescription <You do not know where you are.>
script {
wait <Press any key...>
choose <gender_pick>
}
end define

define room <Start3>
alias <Unknown>
look <Suddenly you start to fall and land on the ground beneath you with a loud thud and lie there dazed. Off in the distance you can hear the sound of footsteps approaching...>
indescription <You do not know where you are.>
script {
wait <Press any key...>
goto <town>
}
end define

define room <mon_store>
look <How did you get here, I wonder?>
indescription <You are in the :>
script msg <haha>

define object <wisp>
alias <will o' wisp>
alt <wisp>
look <You look closely at the ball od smoke - It's a will o' wisp. These are very rare and their smoke is highly vavlued.>
displaytype <Monster>
article <it>
properties <monster; race=wisp; element=air; gender=it; cur_hp=3; cur_sta=999; hp=3; lvl=2; exp=120; minda=1; maxda=6; dodge=8; magic=0; sta=999; spd=4; dex=8; def=6; not effectable; not dead; not poison; not deadly_poison; not mind_poison; not mind_sap; not paralye; not burn; not freeze; not confusion; not blind; not mute; not deaf; not sleep; not stun; not unkillable; not nightsee; not fly; not invisable>
end define

define object <fimp>
alias <Fire imp>
alt <imp; fire imp>
look <A ball of fire surrounds the magical imp, the flame lick at the air and the smell of burning is in the air.>
displaytype <Monster>
article <it>
properties <monster; race=imp_fire; element=fire; gender=it; cur_hp=7; cur_sta=10; hp=7; lvl=1; exp=50; minda=0; maxda=3; dodge=1; magic=0; sta=5; spd=3; dex=3; def=2; not dead; not poison; not deadly_poison; not mind_poison; not mind_sap; not paralye; not burn; not freeze; not confusion; not blind; not mute; not deaf; not sleep; not stun; not unkillable; not nightsee; not fly; not invisable>
end define

end define

define room <battle room>
look <OH NO!!! A BATTLE!>
indescription <You are in the :>
end define

define room <town>
look <A small save-haeven from the widerness outside.>
indescription <You are in a :>
west <wilderness1>
properties <town>
end define

define room <wilderness1>
alias <wilderness>
look <Thick trees surround you, monsters could be lurking anywhere.>
indescription <You are in the :>
east <town>
properties <wilderness; wood>

define object <tempnum>
properties <1=0; 2=0; 3=0; 4=0; 5=0>
end define
end define

define procedure <mon_dataget>
set numeric <mnum; $rand(1; 2)$>
if ( %mnum% = 1 ) then {
set string <mon_name; wisp>
msg <You are fighting a wisp, level=$objectproperty(#mon_name#; lvl)$.>
move <wisp; battle room>
}
if ( %mnum% = 2 ) then {
set string <mon_name; fimp>
msg <You are fighting a fire imp, level=$objectproperty(#mon_name#; lvl)$.>
move <fimp; battle room>
}
set <diffrate; $objectproperty(#mon_name#; lvl)$ - #me:lvl#>
if ( %diffrate% > 5 ) then msg <What would you like on your tomb stone?>
if ( %diffrate% < 6 ) and ( %diffrate% > 2 ) then msg <Look like it'll be a tricky fight.>
if ( %diffrate% < 3 ) and ( %diffrate% > -3 ) then msg <Looks like a fair fight.>
if ( %diffrate% < -2 ) and ( %diffrate% > -6 ) then msg <Looks like you have the upper hand.>
if ( %diffrate% < -5 ) then msg <This'll be easy!>
goto <battle room>
choose <battle_menu>
end define

define procedure <att_order>
msg <your spd=#me:temp_spd#, mon's spd=$objectproperty(#mon_name#; spd)$.>
'property <tempnum:1; $objectproperty(#mon_name#; spd)$>
'property <tempnum:2; $objectproperty(me; temp_spd)$>
' ##
property <tempnum:1; 4>
property <tempnum:2; 3>
' ##
'set numeric <temp; $objectproperty(#mon_name#; spd)$>
'set numeric <temp2; $objectproperty(me; temp_spd)$>
if ( $objectproperty(tempnum; 2)$ > $objectproperty(tempnum; 1)$ ) then {
msg <You will attack first...>
do <you_hit> }
if ( $objectproperty(tempnum; 2)$ < $objectproperty(tempnum; 1)$ ) then {
msg <#mon_name# will attack first...>
do <mon_hit> }
if ( $objectproperty(tempnum; 2)$ = $objectproperty(tempnum; 1)$ ) then {
set numeric <temp; $rand(0; 1)$>
if ( %temp% = 0 ) then do <you_hit> else do <mon_hit> }

end define

define procedure <you_hit>
if property <me; paralyse> then {
set nemeric <temp; $rand(0; 1)$>
if ( %temp% = 0 ) then {
msg <You are paralysed and cannot attack.>
do <mon_hit>
}
else do <you_hit2>
}
else {
if property <me; sleep> then {
set numeric <temp; $rand(0; 3)$>
if ( %temp% = 3 ) then {
msg <You wake up and attack.>
do <you_hit2>
}
else {
msg <You are asleep and do not wake up.>
do <mon_hit>
}
}
else {
if property <me; blind> then {
set numeric <temp; %rand(1;5)$>
if ( %temp% > 4 ) then do <you_hit2> else {
msg <You blindly try to attack and fail...>
do <mon_hit>
}
}
else do <you_hit2>
}
}

end define

define procedure <you_hit2>
if ( #me:temp_dex# > $objectproperty(#mon_name#; dodge)$ ) then {
set numeric <temp; #me:temp_str# + #me:temp_int# + $rand(#weap:minda#; #weap:maxda#)$>
if property <me; confusion> then {
set numeric <temp2; $rand(0; 1)$>
if ( %temp2% = 0 ) then {
set numeric <temp; %temp% - #armour:value#>
msg <You are confused and hurt yourself trying to attack.>
set <me:cur_hp; #me:cur_hp# - %temp%>
do <mon_hit>
}
else {
set numeric <temp; %temp% - $objectproperty(#mon_name#; def)$>
if ( %temp% < 0 ) then set <temp; 0>
set <#mon_name#:cur_hp; $objectproperty(#mon_name#; cur_hp)$ - %temp%>
msg <You hit #mon_name# for %temp% damage.>
do <mon_check>
}
}
else {
set numeric <temp; %temp% - $objectproperty(#mon_name#; def)$>
if ( %temp% < 0 ) then set <temp; 0>
set <#mon_name#:cur_hp; $objectproperty(#mon_name#; cur_hp)$ - %temp%>
msg <You hit #mon_name# for %temp% damage.>
do <mon_hit>
}
}
if ( #me:temp_dex# = $objectproperty(#mon_name#; dodge)$ ) then {
set numeric <temp; $rand(0; 1)$>
if ( %temp% = 0 ) then {
set numeric <temp; #me:temp_str# + #me:temp_int# + $rand(#weap:minda#; #weap:maxda#)$>
if property <me; confusion> then {
set numeric <temp2; $rand(0; 1)$>
if ( %temp2% = 0 ) then {
set <temp; %temp% - #armour:value#>
msg <You are confused and hurt yourself trying to attack.>
set <me:cur_hp; #me:cur_hp# - %temp%>
do <mon_hit>
}
else {
set numeric <temp; %temp% - $objectproperty(#mon_name#; def)$>
if ( %temp% < 0 ) then set <temp; 0>
set <#mon_name#:cur_hp; $objectproperty(#mon_name#; cur_hp)$ - %temp%>
msg <You hit #mon_name# for %temp% damage.>
do <mon_check>
}
}
else {
set numeric <temp; %temp% - $objectproperty(#mon_name#; def)$>
if ( %temp% < 0 ) then set <temp; 0>
set <#mon_name#:cur_hp; $objectproperty(#mon_name#; cur_hp)$ - %temp%>
msg <You hit #mon_name# for %temp% damage.>
do <mon_hit>
}
}
else {
msg <You fail to hit #mon_name#.>
do <mon_hit>
}
}
if ( #me:temp_dex# < $objectproperty(#mon_name#; dodge)$ ) then {
set numeric <temp; #me:temp_str# + #me:temp_int# + $rand(#weap:minda#; #weap:maxda#)$>
if property <me; confusion> then {
set numeric <temp2; $rand(0; 1)$>
if ( %temp2% = 0 ) then {
set numeric <temp; %temp% - #armour:value#>
msg <You are confused and hurt yourself trying to attack.>
set <me:cur_hp; #me:cur_hp# - %temp%>
do <mon_hit>
}
else {
msg <you fail to hit #mon_name#.>
do <mon_hit>
}
}
else {
msg <you fail to hit #mon_name#.>
do <mon_hit>
}
}

end define

define procedure <mon_check>
if ( $objectproperty(#mon_name#; cur_hp)$ < 1 ) then do <exp_gain> else do <mon_hit>

end define

define procedure <death_check>
if ( #me:cur_hp# < 1 ) then do <you_lose> else choose <battle_menu>

end define

define procedure <mon_hit>
if property <#mon_name#; paralyse> then {
set numeric <temp; $rand(0; 1)$>
if ( %temp% = 0 ) then {
msg <#mon_name# is paralysed and cannot attack.>
do <you_hit>
}
else do <mon_hit2>
}
else {
if property <#mon_name#; sleep> then {
set numeric <temp; $rand(0; 3)$>
if ( %temp% = 3 ) then {
msg <#mon_name# wakes up and attacks.>
do <mon_hit2>
}
else {
msg <#mon_name# is asleep and does not wake up.>
do <you_hit>
}
}
else {
if property <#mon_name#; blind> then {
set numeric <temp; %rand(1;5)$>
if ( %temp% > 4 ) then do <mon_hit2> else {
msg <#mon_name# blindly tries to attack and fails...>
do <you_hit>
}
}
else do <mon_hit2>
}
}

end define

define procedure <mon_hit2>
if ( #me:temp_dex# < $objectproperty(#mon_name#; dodge)$ ) then {
set numeric <temp2; $objectproperty(#mon_name; minda)$>
set numeric <temp3; $objectproperty(#mon_name#; maxda)$>
set numeric <temp; $rand(%temp2%; %temp3%)$>
if property <#mon_name#; confusion> then {
set numeric <temp2; $rand(0; 1)$>
if ( %temp2% = 0 ) then {
set numeric <temp; %temp% - $objectproperty(#mon_name#; def)$>
msg <#mon_name# is confused and hurts itself trying to attack.>
set <#mon_name#:cur_hp; $objectproperty(#mon_name#; cur_hp)$ - %temp%>
do <you_hit>
}
else {
set numeric <temp; %temp% - #armour:value#>
if ( %temp% < 0 ) then set <temp; 0>
set <me:cur_hp; #me:cur_hp# - %temp%>
msg <You are hit by #mon_name# for %temp% damage.>
do <death_check>
}
}
else {
set numeric <temp; %temp% - #armour:value#>
if ( %temp% < 0 ) then set <temp; 0>
set <me:cur_hp; #me:cur_hp# - %temp%>
msg <You are hit by #mon_name# for %temp% damage.>
do <death_check>
}
}
if ( #me:temp_dex# = %#mon_name#:dodge% ) then {
set numeric <temp; $rand(0; 1)$>
if ( %temp% = 0 ) then {
set numeric <temp2; $objectproperty(#mon_name; minda)$>
set numeric <temp3; $objectproperty(#mon_name#; maxda)$>
set numeric <temp; $rand(%temp2%; %temp3%)$>
if property <#mon_name#; confusion> then {
set numeric <temp2; $rand(0; 1)$>
if ( %temp2% = 0 ) then {
set numeric <temp; %temp% - $objectproperty(#mon_name#; def)$>
msg <#mon_name# is confused and hurts itself trying to attack.>
set <#mon_name#:cur_hp; $objectproperty(#mon_name#; cur_hp)$ - %temp%>
do <you_hit>
}
else {
set numeric <temp; %temp% - #armour:value#>
if ( %temp% < 0 ) then set <temp; 0>
set <me:cur_hp; #me:cur_hp# - %temp%>
msg <You are hit by #mon_name# for %temp% damage.>
do <death_check>
}
}
else {
set numeric <temp; %temp% - #armour:value#>
if ( %temp% < 0 ) then set <temp; 0>
set <me:cur_hp; #me:cur_hp# - %temp%>
msg <You are hit by #mon_name# for %temp% damage.>
do <death_check>
}
}
else {
msg <#mon_name# fails to hit you.>
do <mon_hit>
}
}
if ( #me:temp_dex# > $objectproperty(#mon_name#; dodge)$ ) then {
set numeric <temp2; $objectproperty(#mon_name; minda)$>
set numeric <temp3; $objectproperty(#mon_name#; maxda)$>
set numeric <temp; $rand(%temp2%; %temp3%)$>
if property <#mon_name#; confusion> then {
set numeric <temp2; $rand(0; 1)$>
if ( %temp2% = 0 ) then {
set numeric <temp; %temp% - $objectproperty(#mon_name#; def)$>
msg <#mon_name# is confused and hurts itself trying to attack.>
set <#mon_name#:cur_hp; $objectproperty(#mon_name#; cur_hp)$ - %temp%>
do <you_hit>
}
else {
msg <#mon_name# fails to hit you.>
do <you_hit>
}
}
else {
msg <#mon_name# fails to hit you.>
do <you_hit>
}
}

end define

define procedure <after turn checks>
if property <#quest.currentroom#; wilderness> then {
set <last_room; #quest.currentroom#>
set numeric <battle; $rand(1; 6)$>
msg <batte? = %battle%>
if ( %battle% = 5 ) then {
msg <You are being attacked!!>
wait <Press any key to start the battle...>
do <mon_dataget>
}
}

end define

define text <intro>

end define

define text <win>

end define

define text <lose>

end define

define selection <battle_menu>
info <You are in a fight!>
choice <Attack> do <att_order>
choice <Magic> {
msg <Magic is not done yet...>
wait
choose <battle_menu>
}
choice <Item> {
msg <Items are not done yet...>
wait
choose <battle_menu>
}
choice <Flee> {
msg <Fleeing is not done yet...>
wait
choose <battle_menu>
}
end define
define selection <race_pick>
info <Which race shall you be?>
choice <Human> {
msg <Human is an all round even race. They are good at haggling and item automatically cost less.>
wait <Press any key...>
if ask <Shall you be a human?> then {
property <me; race=human>
msg <You are now a human.>
goto <Start2>
}
else choose <race_pick>
}
choice <Elf> {
msg <Eleves are a highly magical race, weak in combat. They are good spell casters and their magic abilities over-compensate for their physical weaknesses.>
wait <Press any key...>
if ask <Shall you be an elf?> then {
property <me; race=elf>
msg <You are now a elf.>
goto <Start2>
}
else choose <race_pick>
}
choice <Niko> {
msg <Niko are race of cat-people, with ears, tail, and sometimes fur and claws. They are very quick and agile, able to see in the dark and exellent hunters.>
wait <Press any key...>
if ask <Shall you be a niko?> then {
property <me; race=niko>
msg <You are now a niko.>
goto <Start2>
}
else choose <race_pick>
}
choice <Werewolf> {
msg <Werewolves have the appearance of humans by day, but at night they metamorphasis into giant wolf-like beasts. They hunger for blood and are highly dangerous, able to inflict damage even without a weapon.>
wait <Press any key...>
if ask <Shall you be a werewolf?> then {
property <me; race=werewolf>
msg <You are now a werewolf.>
goto <Start2>
}
else choose <race_pick>
}
end define
define selection <gender_pick>
info <Which class shall you be?>
choice <Male> {
msg <Males of the races are usually stronger and more well built, making them better at fighting but more bulky. They are worse at magic skills.>
wait <Press any key...>
if ask <Shall you be male?> then {
property <me; gender=male>
msg <You are now male.>
goto <Start3>
}
else choose <gender_pick>
}
choice <Female> {
msg <Females are usually better at magic as well as lighter on their feet, but less well built and therefore weaker in fights.>
wait <Press any key...>
if ask <Shall you be female?> then {
property <me; gender=female>
msg <You are now female.>
goto <Start3>
}
else choose <gender_pick>
}
end define


paul_one
11 Dec 2005, 23:39
I've got it to a point where it no longer crashes when you press "attack".
It was simply some missing # 's and stuff.

I'll have to coach you through the finer points of setting object properties.

For instance, DON'T use "set <#mon#:prop; value>"
Use: "property <#mon#; prop=value>"

And these values ARE NOT EVALUATED!
So, using "property <#mon#; prop=3+1>" will set prop to "3+1"
You need to have set numeric <temp; 3+1>" before it, and then:
property <#mon#; prop=%temp%>

.. there are loads of other things in there too. I'll try to work through it after work tomorrow.

Elexxorine
12 Dec 2005, 11:23
oh thank you so much tron. why do you need to talk it through with me? if you don't understand what i'm trying to do i'll send you the battle plan which saying what the code is meant to do.....

Elexxorine
12 Dec 2005, 11:24
oh thank you so much tron. why do you need to talk it through with me? if you don't understand what i'm trying to do i'll send you the battle plan which saying what the code is meant to do.....

paul_one
12 Dec 2005, 15:47
No. It's so that you understand the difference between the different ways you can get to use object properties.

There's some bits that look like they've been ripped directly from my RPG library.
But other bits that look like they could be largely 'simplified'. (Ie, get slightly more complicated - but then become easier to read and more 'compressed').

I'll try and do all that for you.