Inventory Space Modifiers

dombo813
21 Jun 2013, 04:43
I am in the process of making a text-based adventure game and I've got to the point where I need to make bags to increase inventory space. I am using the variable in player object that defines amount of carried items, and I want an item that when added to the inventory, it deletes itself and permanently increases the amount of carried items. I know how to script it to remove itself, I just need the script for increasing the inventory.

Pertex
21 Jun 2013, 05:57
If your are using code view, type
player.maxobjects=player.maxobjects+34


In the gui choose
Set variable player.maxobjects = expression player.maxobjects+34

dombo813
21 Jun 2013, 06:30
thanks! dont suppose you could point me in the way of someone who could design map graphics?

Pertex
21 Jun 2013, 12:01
Fantasy style? How do you want to create such a graphical map in quest?

dombo813
21 Jun 2013, 21:01
i was more thinking create an object which on use displays the location the map is referencing to and then an image which is the map which would just be the layout of the area eg. start town map would be something like this

Start Town:

H SH H
----------
S I - C
-

- would be road, SH would be the player's starting house. H would be replaced by a house picture, S a store, I an inn C a crypt with the words house,store etc. on them.

HegemonKhan
22 Jun 2013, 20:06
Sora has made such a library already for your very request (in your OP about storage stacking; i.e. "bags ~ bagging"):

viewtopic.php?f=18&t=3515

and if your inventory still gets too full, I've got a very crude (and incomplete) storage system that you can use too (though you'll have to adapt and complete it for yourself~your game), just ask me if you want to see it, and I'll post it here for you.

dombo813
23 Jun 2013, 08:52
Actually the thing i was looking for was the one already answered, i had 10 different items possible to be carried at any time, and I wanted to make something to up that to 20 max or 30 max, but i was also looking for a stacking thing so thanks for the link. How do I use the library though? do i run it as the game and load my game over it.

HegemonKhan
24 Jun 2013, 05:01
here's some links:

http://quest5.net/wiki/Using_libraries
http://quest5.net/wiki/Creating_Libraries

a library is just a collection of code (which can add or change stuff to your game). Maybe a good analogy is to think of libraries as like the expansion packs for games. Though with libraries, you can add and~or change stuff to your game, or even make an entirely new game engine for your game too, instead of using the default core engine coding.

you can have~use as many libraries as you want within your game.

all games, by default, include two libraries (open up a game in the GUI~Editor, and look at the left pane ~ the "tree of stuff"):

core.aslx (this is the game engine; it contains the core code of the game)
english.aslx (this provides that the text~language as being in english)

or, within Code View mode (or just in code):

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

<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


----------

to create your own library is very simple:

simply open up notepad, wordpad, or notepad++ (highly recommended that you get this!), and save the file with a ".aslx" ext, as Quest Files, be they a game file or a library file, both use the ".aslx" ext. But, within the file, you just need to do this too:

<library>
(your mass of code)
</library>


now, it's a bit more complex in actually coding the library properly obviously, but this is the bare basics of creating a library.

-------

whereas, a GAME FILE, looks like this:

<asl version="540">
(your mass of code)
</asl>


-------

to include a library in your game:

in the GUI~Editor, on the left pane (the "tree of stuff"), there should be an option of "Adding a library" or something like this (it may be under the advanced options)

in code, just add in the correct coding (see above, the "include ref...") with the name of the library file.

also, the library file has to be in the same place as your quest.exe or where your core and english library files are located, meh.