How exactly do I set the player's sex with the typelib?
Anonymous
11 Mar 2004, 03:23I'm sure its simple, but I can't figure it out. I'm using the QDK for development until I get more familiar with the abilities of the language.
Thanks for any help!
-Radar
Anonymous
12 Mar 2004, 15:39set numeric <TLNplayerSex; 2>
Anonymous
13 Mar 2004, 03:50Mman wrote:The variable in question is “TLNplayerSexâ€. It is a numeric variable, 1 for male (default) and 2 for female. So all you need to do is this:
set numeric <TLNplayerSex; 2>
Thanks for the help!
-Radar
Anonymous
13 Mar 2004, 03:58Mman wrote:The variable in question is “TLNplayerSexâ€. It is a numeric variable, 1 for male (default) and 2 for female. So all you need to do is this:
set numeric <TLNplayerSex; 2>
I found this entry in the library itself. I am assuming that this could be a dynamic value though...is this true? It looks like it would be easy to change the library to startup and set it to 2, but I would prefer it to be dynamic. Am I wrong in this assumption? If not, how can I set this value dynamically and change it throughout the game?
Thanks for the help!
-Radar
Anonymous
13 Mar 2004, 05:13You can set the “TLNplayerSex†at the beginning of the game in the “startscript†of your own asl file or you can change it “dynamically†at any point throughout the game (just like any other numeric variable). You just have to decide on a trigger. For example:
' "test"
' Created with QDK Pro 3.52
!include <Typelib.qlb>
define game <test>
asl-version <350>
gametype singleplayer
start <bedroom>
game info <Created with QDK Pro 3.52>
startscript choose <sex>
end define
define synonyms
end define
define room <bedroom>
prefix <a>
north <closet>
east <lab>
define object <Dresser>
look {
msg <A small dresser with only two drawers.>
show <top drawer>
show <bottom drawer>
}
type <TLTcontainer>
type <TLTcontainer>
properties <not takeable>
end define
define object <top drawer>
hidden
type <TLTcontainer>
type <TLTcontainer>
end define
define object <bottom drawer>
hidden
type <TLTcontainer>
type <TLTcontainer>
end define
define object <bra>
take
type <TLTobject>
type <TLTcontainable>
type <TLTvest>
properties <isIn=top drawer; sex=2>
end define
define object <panties>
take
type <TLTobject>
type <TLTcontainable>
type <TLTundies>
properties <isIn=top drawer; sex=2>
end define
define object <undershirt>
take
type <TLTobject>
type <TLTcontainable>
type <TLTvest>
properties <isIn=bottom drawer; sex=1>
end define
define object <boxer shorts>
take
type <TLTobject>
type <TLTcontainable>
type <TLTundies>
properties <isIn=bottom drawer; sex=1>
end define
end define
define room <closet>
prefix <a>
south <bedroom>
define object <shirt>
take
type <TLTobject>
type <TLTshirt>
properties <sex=1>
end define
define object <blouse>
take
type <TLTobject>
type <TLTshirt>
properties <sex=2>
end define
define object <skirt>
take
type <TLTobject>
type <TLTskirt>
properties <sex=2>
end define
define object <pants>
take
type <TLTobject>
type <TLTtrousers>
properties <sex=1>
end define
end define
define room <lab>
prefix <a>
west <bedroom>
define object <pink potion>
look <a small beaker with a pink coloured liquid.>
take
use {
if ask <Do you want to drink this potion?> then msg <A strange feeling runs through your entire body.>
set numeric <TLNplayerSex; 2>
}
type <TLTobject>
end define
define object <blue potion>
look <a small beaker with a blue coloured liquid.>
take
use {
if ask <Do you want to drink this potion?> then msg <A strange feeling runs through your entire body.>
set numeric <TLNplayerSex; 1>
}
type <TLTobject>
end define
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end define
define selection <sex>
info <Are you male or female?>
choice <male> {
msg <o.k.>
set numeric <TLNplayerSex; 1>
}
choice <female> {
msg <o.k.>
set numeric <TLNplayerSex; 2>
}
end define
Anonymous
13 Mar 2004, 16:48Once the coding part stops being an issue I'll look forward to putting some games together!
-Radar
Anonymous
14 Mar 2004, 08:44No you don’t need to change the library itself, and you really shouldn’t. If you start making changes to the library and something goes wrong, nobody will be able to help you, not even MaDbRiT himself. The manual for his library contains warnings against doing this.
Quite right too! Of course another, maybe less obvious, reason not to change the typelib is that if the final game is distributed without compilation and thus listed as requiring 'typelib.qlb - version 1.09 as amended by A.N. Other', you'd have to pack a copy of the altered typelib with the game - if someone else makes changes to typelib and does the same we would then have three different typelib's required for three games, one original and two altered...
I think you can clearly see how this would become a nightmare very quickly if several people were to start altering and distributing differing versions of what, to the Tyro, seems to be the same typelib code.
For the above reason as much as any other, I thus strongly advise ever altering typelib.qlb itself. Because of the way Quest works, it is quite possible to make all the changes in functionality you could ever want to typelib externally in your own asl file.
I should point out that if you are compiling your final game (something I strongly advise, and which I expected to be normal practice when I wrote typelib) the arguments above don't apply, because you never need to distribute the altered library, it becomes an integral part of your CAS file.
Quest Pro users can therefore afford to take a more cavalier attitude to hacking my code around for their own purposes
Al (MaDbRiT)
Anonymous
14 Mar 2004, 19:26The sample game code has helped quite a bit to show me how to do some simple things.
-Radar