How to inventory

ATRock
So this is my first time creating a game. I have been a regular gamer doing RPG's, MMO's, Free-Roam, etc... To cut to the chase, I need help on how to put something in your inventory when the game first starts like a weapon, HP restoration, or whatever. Help.

HegemonKhan
the default 'player' Player Object's "inventory" is actually just the default 'player' Player Object itself. When you're putting an Object into the player's inventory, you're merely putting the Object into the default 'player' Player Object:

'player' Player Object
-> 'claymore_sword' Object
-> 'skeleton_key' Object
-> 'healing_potion' Object

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

HK
-> pants
->-> wallet
->->-> $1
->->-> $5
-> shirt

you can take a look at this recent post of mine, though it's a bit more advanced (and code heavy), but if you scroll down a bit, I try to explain how the above works in greater/fuller detail:

viewtopic.php?f=10&t=6292&start=15#p42648

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

There's also the 'ScopeInventory()' Function, which specifically returns an Object List Attribute of the names of the Objects in your 'player' Player Object, for usage/manipulation too. But, this is a bit more advanced stuff then to get into for right now.

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

'game' Game Object -> 'Scripts' (I think) Tab -> 'start' Script -> run as script -> add new script -> 'objects' (I think) script category -> 'MoveObject()' Script (or whatever it is called/described as, in the GUI~Editor, meh)

(if you're planning to randomly select something, that's much more complicated/complex)

the built-in 'start' Script Attribute of the special 'game' Game Object, runs those added scripts at the beginning of the game.

an example in code:

<game name="xxx">
<attr name="start" type="script">
MoveObject (dagger, player)
</attr>
</game>

<object name="dagger">
</object>

<object name="room">
<object name="player">
</object>
</object>


see also this link, as I think it'll be of help for you:

http://docs.textadventures.co.uk/quest/ ... ation.html

and also here's a bunch of (more) guides too:

http://docs.textadventures.co.uk/quest/guides/

and if you haven't, I'd strongly recommend trying to go through the entire tutorial first:

http://docs.textadventures.co.uk/quest/tutorial/

and also there's a "second/next" tutorial to do by XanMag ... I forgot what he called it and not sure where to find it (too lazy)... just ask/pm him about it.

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

after all of the above...

then its onto really/fully understanding/learning about Attribute usage and the 'if' Script, one such resource is my guide on them (might not be easy to understand, though):

viewtopic.php?f=18&t=5559

once you learn these things, you can do 90% of everything that you want to do in a game, as well as being able to use and understand the documentation, (hopefully/better at the coding level than the GUI~Editor level), resources:

http://docs.textadventures.co.uk/quest/

and then it's learning the more advanced stuff, like List and Dictionary Attributes, and etc stuff.

ATRock
Thanks That helped a lot.

HegemonKhan
let me know if you got any questions, are confused by anything, need help with anything, and/or need an explanation of anything.

HegemonKhan
alright... sorry about scaring you with the last post, I just throw it out there all at once, but will gladly help you do what you want, step by step (as I got the time... it's nearly school finals, so I'll be a bit busy for 1-2 weeks, but I'm sure others will help you in the meantime if I'm unable to do so).

I'm aware that my inital posts are of little help to people new to quest and/or coding, so just let me know that you need specific step by step help, as I love helping (though am not that good at it, lol), so don't be embarassed, we've all started not knowing anything and needing step by step guidance. It does take a lot more time though to have to go through something step by step especially using the GUI~Editor, which is why I throw out my scary posts, as I'm lazy, laughs.

Also, if you haven't already, I'd STRONGLY suggest you first go through as much of the tutorial as you can, as it helps you with the basic usage of quest's GUI~Editor and how to do basic things and a basic understanding of things first:

http://docs.textadventures.co.uk/quest/tutorial/

And then from there, if you understood the tutorial pretty well, I'd recommend playing XanMag's tutorial game, as it does a good job of being that missing bridge between the original tutorial and jumping into actually trying to make a game on your own. Otherwise, if you had problems with the original tutorial, we can help you with it:

viewtopic.php?f=5&t=5940
(I believe this is the link for his tutorial game, correct me if wrong, XanMag)

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

how do you want the Object to be in the player's inventory at game start? (as there's some different ways/methods/designs of doing this stuff, I need to understand what exactly you want to do more specifically)

if you could try to describe in more detail what you want, it'd be of great help, as there's so many different ways of doing things... lol


1. the player starts with specific Objects in their inventory already in his/her inventory before the game starts, for example:

the player will always start with a dagger, healing potion, and 50 cash

briefly (for now):

this is done by using the GUI~Editor, adding/creating Objects in the 'player' Player Object, for example:

'player' Player Object -> 'Objects' Tab -> Add -> (see below, repeat as needed)

Object Name: dagger

(then set up your Object's Attributes, Verbs, and etc stuff)

you can also click on the 'player' Player Object, so that it is highlighted, and then from the menu bar at the top, add an Object to it, or I think you can also right click on the Object's name, to bring up popup menu options, and select to add an Object to it (the 'player' Player Object), and lastly, you can click on an Object's name and hold the mouse button down, dragging it over into whatever Object you want it to be inside of (just like files and folders on your desktop), in case you added it to one Object but want it to now be in another Object. I also think that you can also "copy and paste" too, click on Object's name so it is highlighted, and then copy it, click on another Object's name (where you want to copy it to) so that it is highlighted, and then paste it.

2. the player starts without any specific Objects in his/her inventory, but the very first thing that happens at game start, is to put specific Objects into the player's inventory, for example:

the player starts with nothing before the game begins, but upon starting/playing the game, specific Objects are put into the player's inventory, before anything else happens, before you're able to starting playing (moving around and doing stuff in the) game.

briefly for now:

this is done through the special 'game' Game Object's 'start' Script Attribute, adding whatever Scripts you want to it, for example:

'game' Game Object -> 'Scripts' Tab -> 'start' Script -> (see below)

run as script -> add new script -> objects (I think) -> 'CreateObject' or 'MoveObject' (or something like these) Scripts -> (see below, it's in code, but you can probably figure out how to set it up as you want via the GUI-Editor's options)

CreateObject (dagger)
MoveObject (dagger, player)

~OR (if you already created the Object such as through the 'add Object' of the GUI~Editor) ~

MoveObject (dagger, player)

3. to randomly select from a group of Objects to give to the player (and then decide which method, #1 or #2, above to do it with):

(this can just be straight up randomization, or the randomization can be based upon 'questions and answers' of the person playing the game, ie "character creation" system)

this is a bit more advanced, and will need it's own post to guide you through it, so not talking about it here.

4. etc etc etc methods, that I'm not thinking of at the moment, lol...

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums