Library - help required

MaDbRiT
12 Jul 2005, 21:46
Hi all

As those of you who have tried it will know, my 'typelib.qlb' (especially the currently in test version) provides a set of quite complex and highly interdependent types that, although they are user configurable, mean the library itself is certainly not the sort of thing you want to 'mess with' especially if you are not a confident coder. :shock:

I realise too, that for a lot of people, the complicated objects and related commands in 'Typelib.qlb' are 'overkill' and the amount of Quest's default functions that 'typelib.qlb' overrides (almost all of them!) can make using it seem quite daunting.

Several times in the past I've mentioned the ALAN 'stub verb' library, which provides some basic skeleton verb/object functionality for that system. The idea of this library is that you gain (say) a basic 'eat' default functionality and you can flesh this out into something more elaborate as you need. It is if you like, a simple foundation to build on, with as little 'overlap' between functions and it overrides as little of the base system functionality as possible to make altering things easy.

I've produced a library, currently rejoicing in the working title of 'Stubslib.qlb', which attempts to do a similar job for Quest to that the 'stub verb' library does for ALAN. It makes minimal changes to Quest base functionality (only the INVENTORY and EXAMINE) commands are overridden at all and even then only for one particular type).

All the usual QDK tabs for take etc work unaltered - this lib should appear as an almost seamless extension to Quest :D

Given all the current Quest commands work as before, 'stubslib.qlb' adds:
read obj
write text on obj
eat obj
drink obj
open obj
close obj
lock obj
lock obj with obj
unlock obj
unlock obj with obj
turn on/switch on obj
turn off/switch off obj
wear/put on obj
take off obj
touch/feel obj
kiss obj
put obj into obj
take obj out of/from obj
ask obj about obj
tell obj about obj

All of these have (useful?) default functionality as is.

Obviously this is done by way of object types. NOTE that the wearable type in stubslib is MUCH SIMPLER than the one in typelib, no layering effects are catered for. Likewise the container and containable types are simpler, there are no hard coded interrelated links between openables, lockables and containers as there are in typelib.

This should make 'stubslib' easier to understand and configure, it is down to the user to combine the functionality of the various types as needed.

The 'locked' construct here supports an object being nominated as a 'key' and I've included a (very stripped down) version of my typelib 'ask/tell' code which should be capable of decent results.

Now then, I've written this library but as yet I have no test piece or basic documentation. Neither of these should take too long to do. What I need are a couple of people willing to 'test drive' my code so that I can debug it and know what people find needs explanation before I write detailed documentation and let it loose!

Any volunteers to help me test and refine this lib? I expect it to be used mostly from QDK by the way, that is the intended audience.

Al (MaDbRiT)

francisstokes
12 Jul 2005, 22:08
I'll test it.I'm a bit of a novice at hand coding but i understand practicaly all ASL code.

paul_one
13 Jul 2005, 09:17
I may have a quick gamble.
My only grumble with your typelib was the fact that it changed so many default actions etc, so I wasn't sure what was going to happen in the game (not having a list of commands that were added).

If this is a much simpler, and less intrusive library than I'd be glad to have a go and see how it works in my game.

As with documentation, I think "what you do to customize an object" is the first. Properties/actions that need alteration.

Personally I'd love to customize EVERYTHING... Messages etc - so if you store those in variables so I can change that on startup that'd be brill!
But I'm not here to tell you how to run your library :P .
Email it to me and I may have a gander Friday, working late sometimes pays off!

MaDbRiT
13 Jul 2005, 21:14
Tron wrote:

My only grumble with your typelib was the fact that it changed so many default actions etc, so I wasn't sure what was going to happen in the game (not having a list of commands that were added).



Well it HAD to change almost all of them to get all the"stuff" in there to work, there is some serious hacking and mis-use of the system going on in there. :D

As it happens the typelib manual included a list of the commands that were added.


If this is a much simpler, and less intrusive library than I'd be glad to have a go and see how it works in my game.



It's definitely much simpler. It only actually affects two inbuilt commands at all, one of which is 'i' for inventory and the other is 'x' for examine. As it happens it only overides those for a couple of object types too. I was deliberately trying to make this lib 'interfere' with default Quest as little as possible.


As with documentation, I think "what you do to customize an object" is the first. Properties/actions that need alteration.



I'm working on the first draft of the manual - which is very much a step by step 'how to actually use it' guide for beginners. The whole thing is designed for QDK use.


Personally I'd love to customize EVERYTHING... Messages etc - so if you store those in variables so I can change that on startup that'd be brill!



MOST messages given by this lib are indeed user replaceable already. At this stage in the lib's development this is PRECISELY the sort of feedback I want to hear. You probably realise that 99% of typelib's 'messages are user replaceable, I will try to hit the 100% replaceable 'ideal' with this lib as it develops. For the moment I want to concentrate on getting good 'default' responses built in.

Al (MaDbRiT)

paul_one
14 Jul 2005, 14:53
Sure, I appreciate the fact your reply was so easy going too.
I do remember reading through the typelib manual once or twice. Unfortunately I didn't have any use for the features ('stuff' :D ) available.

Are you going to email the files or provide a link?

Elexxorine
14 Jul 2005, 15:20
i would like it if some-one made an rpg lib, i know tron made one for fighting but i mean generally with build in stats, inv, banking, shops, the works...... i might even make it if some-one tells me how to make a lib (hint, hint madbrit). lol.

francisstokes
14 Jul 2005, 17:08
I'm working on a turn based combat library but knowing me i will never get done.


PostPosted: Thu Jul 14, 2005 3:20 pm Post subject:
i would like it if some-one made an rpg lib, i know tron made one for fighting but i mean generally with build in stats, inv, banking, shops, the works



Your best to put all this stuff in yourself because everyone has a different taste in regard to the way stats, leveling and shops.

The bank is easy enough to do, just create a dummy room for the bankspace and one for the bank, have commands like put blah in bank and set a flag on or whatever and commands to take it out.You'll think of it :wink: .

paul_one
14 Jul 2005, 18:02
I'm making an RPG library with all that stuff... I think it has about 6 or 7 stats, and 2 or 3 'equipment' slots. (think it's 3).

The battle interface will be optional, turn-based or speed-based (enemies AND you have speed, turns are decided apon that ratio).

The stat's I've got right now work, so does the turn-based fighting (IIRC). Only thing is, while I was doing a battle procedure to work out how much damage etc, I was using a certain algorithm to get a result. To do this I was multiplying all these figures and then deviding it etc. BUT Quest couldn't handle any number above 32,000 (roughly) so it kept crashing.

The next version of Quest should sort this problem out by using doubles (quite accurate till 4 million or so I think - then it uses 'e' numbers = nx10^x) which will also give us decimal numbers (numbers between 1 and 2 for example).... I hope he has some way to sort it out, an $integer()$ perhaps for comparisons etc, as floating point numbers can get pretty ugly to compare (or so I'm told. Maybe ASL could be like other languages and have integer's and doubles as seperate types!).

.... AAANYWAY, I've stopped until the next version of Quest comes out. That'll be my big RPG-game that I want in ASL.

Elexxorine
15 Jul 2005, 12:43
what are the stats, and what are you using them to do? also i'm developing TBC, i'm coding it as a multiplayer games, even when its set as a single player games. i've development cool codes for logging in, and stuff. i'm having some troubles with arrays, they don't seem to work. there's the code:
' "grid demo" 
' Created with QDK 3.53 - UNREGISTERED VERSION

define game <Grid Demo>
asl-version <350>
gametype singleplayer
game version <test>
game author <elexxorine>
game copyright <>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
default fontname <MS Sans Serif>
default fontsize <14>
background <black>
foreground <green
start <start room>
startscript { do <start up>
}
define variable <position>
type numeric
value <0>
display nozero <position: !>
end define
end define

define room <grid room>
look <the room feels familiar, like you've been here before.>
script {
if <grid[%position%]; 1> then{
create exit north <grid room;>
create exit west <end room;>}
if <grid[%position%]; 2> then{
create exit south <grid room;>}
if <grid[%position%]; 3> then{
create exit north <grid room;>
create exit south <grid room;>}
if <grid[%position%]; 4> then{
create exit east <grid room;>}
if <grid[%position%]; 5> then{
create exit north <grid room;>
create exit east <grid room;>}
if <grid[%position%]; 6> then{
create exit east <grid room;>
create exit south <grid room;>}
if <grid[%position%]; 7> then{
create exit north <grid room;>
create exit east <grid room;>
create exit south <grid room;>}
if <grid[%position%]; 8> then{
create exit west <grid room;>}
if <grid[%position%]; 9> then{
create exit north <grid room;>
create exit west <grid room;>}
if <grid[%position%]; 10> then{
create exit west <grid room;>
create exit south <grid room;>}
if <grid[%position%]; 11> then{
create exit north <grid room;>
create exit south <grid room;>
create exit west <grid room;>}
if <grid[%position%]; 12> then{
create exit west <grid room;>
create exit east <grid room;>}
if <grid[%position%]; 13> then{
create exit north <grid room;>
create exit west <grid room;>
create exit east <grid room;>}
if <grid[%position%]; 14> then{
create exit west <grid room;>
create exit south <grid room;>
create exit east <grid room;>}
if <grid[%position%]; 15> then{
create exit north <grid room;>
create exit east <grid room;>
create exit south <grid room;>
create exit west <grid room;>}
}
end define

define room <end room>
look <you have reached the end of the maze, and won the game.>
end define

define procedure <start up>
set <grid[1]; 12>
set <grid[2]; 12>
set <grid[3]; 12>
set <grid[4]; 12>
set <grid[5]; 10>
set <grid[6]; 6>
set <grid[7]; 14>
set <grid[8]; 14>
set <grid[9]; 12>
set <grid[10]; 9>
set <grid[11]; 3>
set <grid[12]; 1>
set <grid[13]; 7>
set <grid[14]; 12>
set <grid[15]; 10>
set <grid[16]; 7>
set <grid[17]; 12>
set <grid[18]; 13>
set <grid[19]; 10>
set <grid[20]; 3>
set <grid[21]; 5>
set <grid[22]; 8>
set <grid[23]; 6>
set <grid[24]; 9>
set <grid[25]; 1>
end define


thanx....

paul_one
15 Jul 2005, 19:49
I don't remember exactly, but it's the basic stat's for what's "IMPORTANT"...

Your code 'doesn't work' because you aren't changing %position%, it's always 0, and there's no "grid[0]".

francisstokes
15 Jul 2005, 20:03
Do you not have to declair an array as a variable?

MaDbRiT
15 Jul 2005, 20:15
Francis wrote

Do you not have to declair an array as a variable?



Yes, you ought to declare it.

I think the real problem is elexxorine has tried to put together her own version of the 'grid within a room' demo code I posted elsewhere for Steve, but without really getting to grips with how it works first, especially in regard to the way I used an array to control it.

Al (MaDbRiT)

Elexxorine
18 Jul 2005, 12:39
can you change my code to work and repost it please?

Elexxorine
22 Jul 2005, 07:19
oh and it wass for me.... remember the llllooonnnggg etempt to teach me them......