Pixie --- "ConvLib" and "CombatLib" Halp.

Anonynn
I'm using some of your libraries (yes, you are credited in game, don't worry) in my game but I have NO idea how do go about customizing things in your libraries, nor can I follow your instructions at all. Maybe I'm just too dumb to comprehend your explanations but some clarity would be greatly appreciated. Just talk to me like I'm a two year old so I understand. This has to do particularly with your "ConvLib" and "CombatLib". I've looked at both pretty extensively in the Notepad++ which HK suggested I get some time ago when I was first trying to understand code.

My first question is in regards to your "ConvLib" comes from this...

I would like a character to have "topics" to discuss/ask after the player initially "Speak to" them. So naturally I was very confused about how to do that in your library. So anyway, I checked out the ConvLib in Notepad++ because in another post you explained to someone that everything is there and I looked and saw...

* Set an alias
* Set them to the type "topic" or "startingtopic", the latter will be visible from the start.
* Give it a script called talk; this is run when the character is asked about the topic.
* The topic will automatically disappear once the player has seen it. Set hideafter to false to
stop this happening automatically (call the "hide" script to do it yourself).
* The count attribute notes how many times the character has been asked about this topic previously
(so is zero the first time).
* If you want new topics to be available after reading this one, put the names of the new topics in
the shownow list.



I don't know about anyone else but I can't figure out a word of this. There are three topics as follows...
Conversation Tab
None
Character
Conversation Topic
Starting Conversation Topic


Now initially I thought, oh I set up the character first, so I clicked it. All I see are..."Run this greeting script" ....which I didn't need really because I couldn't get it to work. BUT I looked at your directions "Set an alias". I assumed I do that in that "Run this greeting script" box. So I typed{specificcharacter.alias} for example in "Print" assuming it would understand that it was coming from that character. That didn't work. Okay, what did I do wrong? So I continue to try, and look at your directions again. Set them to the type "topic or starting topic".....What? I have no idea what this means. There is no script that I know named "talk". Do I type this in "Print"? I don't know how to do this step at all.

Anyway, so I moved onto the next one. I understand that topics will disappear after they are chosen. Which is fine with me. Count attribute I understand. I clicked "Conversation topic" next. Automatically hide after showing. Got it and understand. Topics will disappear. Then I read this... "Show these after showing for the first time (must be the name, not the alias)" which I think I understand...so I create a topic with the "Add", then I look below at "Run this script" but again, I have NO idea how to tie that in with each of the conversation topics. I'm at a loss now and I no idea how/why this is so complicated for me to understand. So next I move to the "Starting Conversation Topic" and again, same thing as above. No idea how to get the player and the character to talk. The Ask/Tell thing is extremely limited to 'yes' and 'no' topics as well, which doesn't help.

Would you mind explaining this to me step by step? Maybe using both code and the GUI or just the code if you don't have time or patience to do both?

The next problem I had is with the "CombatLibrary"

I read your 'notepad' on how everything works and it's semi-straight forward and well-described....until I reach the customization part of it. Very confusing. So I understand the gold, maxpoints, nameprompt, pointsprompt and understand when those things happen in the game, but the kicker is when you say "search for Boris" I figured, he/she must mean type "Boris" in the Notepad++ search box. Nothing came up. So I try it in the game itself in the code-view. Nothing came up. I try it again in the Filter, ShowLibraryMenu, nothing. I don't know if Boris is code for something...but I don't understand it.

Also, is there a way to add onto the character customization attribute...like picking a race, gender (I'd like to remove the outer prompt for gender selection and just have it be something you can select if possible), body type, haircolor, eyecolor ---- etc? I'd also like to change Hit Points to "Health" ....and figure out a way to make "Scripted" events drain it --- not just in combat, if that's possible. Also, is it possible for enemies not to "kill" you with a gameover, but defeat you and disappear like stealing stuff from you etc, or just leaving you there with 1 Health?

I apologize for all the questions, but I have a genuine curiosity/interest about how your libraries work. I'd love to optimize them for my game and credit you. A detailed explanation of everything would be greatly appreciated! Again, sorry for the huge topic.

The Pixie
Neonayon wrote:I'm using some of your libraries (yes, you are credited in game, don't worry) in my game but I have NO idea how do go about customizing things in your libraries, nor can I follow your instructions at all. Maybe I'm just too dumb to comprehend your explanations but some clarity would be greatly appreciated. Just talk to me like I'm a two year old so I understand. This has to do particularly with your "ConvLib" and "CombatLib". I've looked at both pretty extensively in the Notepad++ which HK suggested I get some time ago when I was first trying to understand code.

My first question is in regards to your "ConvLib" comes from this...

Have you see this page:
http://docs.textadventures.co.uk/quest/ ... tions.html

I would like a character to have "topics" to discuss/ask after the player initially "Speak to" them. So naturally I was very confused about how to do that in your library.


Just to be clear here, the way it works is that the player types TALK TO BORIS, and is then given a list of available topics to pick from. Selecting one will make a discussion on that topic appear on screen. If the player again types TALK TO BORIS again, that topic will (by default) disappear and new ones might be available.

So anyway, I checked out the ConvLib in Notepad++ because in another post you explained to someone that everything is there and I looked and saw...

[quote] * Set an alias
* Set them to the type "topic" or "startingtopic", the latter will be visible from the start.
* Give it a script called talk; this is run when the character is asked about the topic.
* The topic will automatically disappear once the player has seen it. Set hideafter to false to
stop this happening automatically (call the "hide" script to do it yourself).
* The count attribute notes how many times the character has been asked about this topic previously
(so is zero the first time).
* If you want new topics to be available after reading this one, put the names of the new topics in
the shownow list.



I don't know about anyone else but I can't figure out a word of this.[/quote]
This is a list of things to do with an object you are setting up to be a topic.

Give it an alias on the Object tab.

The script is on the Conversation tab, at the bottom.

There are three topics as follows...
Conversation Tab
None
Character
Conversation Topic
Starting Conversation Topic


To be exact, they are types. You are setting the type of the object to be (in the last two cases) a topic.

Now initially I thought, oh I set up the character first, so I clicked it. All I see are..."Run this greeting script" ....which I didn't need really because I couldn't get it to work.


If you do not need it, leave it blank.

BUT I looked at your directions "Set an alias". I assumed I do that in that "Run this greeting script" box. So I typed{specificcharacter.alias} for example in "Print" assuming it would understand that it was coming from that character. That didn't work. Okay, what did I do wrong? So I continue to try, and look at your directions again. Set them to the type "topic or starting topic".....What? I have no idea what this means. There is no script that I know named "talk". Do I type this in "Print"? I don't know how to do this step at all.


Set alias as you would for any other item on the Object tab. The "talk" script is the bottom box on the Conversation tab. The page I linked to above explains it rather better than the read me, which I think was for an early version that did not include a Conversation tab at all.

Anyway, so I moved onto the next one. I understand that topics will disappear after they are chosen. Which is fine with me. Count attribute I understand. I clicked "Conversation topic" next. Automatically hide after showing. Got it and understand. Topics will disappear. Then I read this... "Show these after showing for the first time (must be the name, not the alias)" which I think I understand...so I create a topic with the "Add", then I look below at "Run this script" but again, I have NO idea how to tie that in with each of the conversation topics. I'm at a loss now and I no idea how/why this is so complicated for me to understand. So next I move to the "Starting Conversation Topic" and again, same thing as above. No idea how to get the player and the character to talk. The Ask/Tell thing is extremely limited to 'yes' and 'no' topics as well, which doesn't help.

Would you mind explaining this to me step by step? Maybe using both code and the GUI or just the code if you don't have time or patience to do both?


Again, look at the page linked above. If it still does not make sense, get back to me.

The Pixie

The next problem I had is with the "CombatLibrary"

I read your 'notepad' on how everything works and it's semi-straight forward and well-described....until I reach the customization part of it. Very confusing.


Customisation is signioficantly more complicated, and most will require coding.

So I understand the gold, maxpoints, nameprompt, pointsprompt and understand when those things happen in the game, but the kicker is when you say "search for Boris" I figured, he/she must mean type "Boris" in the Notepad++ search box. Nothing came up. So I try it in the game itself in the code-view. Nothing came up. I try it again in the Filter, ShowLibraryMenu, nothing. I don't know if Boris is code for something...but I don't understand it.


Sorry, I should have said it is in CombatStuff.xml. There are several files included.

Also, is there a way to add onto the character customization attribute...like picking a race, gender (I'd like to remove the outer prompt for gender selection and just have it be something you can select if possible), body type, haircolor, eyecolor ---- etc?


Yes. If you can find "boris", you can see where, just up a little.

I'd also like to change Hit Points to "Health"


A bit high above "boris" is this line:
    dictionary add (game.pov.statusattributes, "hitpointstatus", "!")

Change it to the:
    dictionary add (game.pov.statusattributes, "hitpointstatus", "Health: !")

It only changes how the figure is displayed, but that should be enough.

....and figure out a way to make "Scripted" events drain it --- not just in combat, if that's possible. Also, is it possible for enemies not to "kill" you with a gameover, but defeat you and disappear like stealing stuff from you etc, or just leaving you there with 1 Health?


Can we come back to that later?

Anonynn
Yeah! Appreciate it all the help. I'll take a look at these and see what I can do. Thank you very much for taking time out of your day to help, Pixie. We can talk about the other stuff later. Just let me know when you're available.

Anonynn
The Pixie wrote:Again, look at the page linked above. If it still does not make sense, get back to me.


I do have a question. I got the "character greeting" to work, but the "Starting Topic" automatically happens right afterward (which isn't bad...I would just rather the player initial that if they want to), and then the other four topics afterward don't appear at all even if I type "Talk to Boris" again. Is there a special command that shows the list? I set them up exactly like the "Starting Topic" and as I said, it works and auto-happens but the rest don't.

Also, I labeled an item a "healing item" but there doesn't appear to be a way to assign how much it heals at all.

The Pixie
ConvLib

What the player should see when she types TALK TO BORIS the first time is a menu with each "starting topic" as an option. If she selects one, then the Boris' greeting script will run, followed by the script for the topic chosen.

If she types TALK TO BORIS again, she will get a menu again. This time her previous choice will not be there (unless ticked otherwise), but any topic listed in the "Show this after..." box for that topic will be there. I would guess you still need to list the new topics there to get yours to work properly. If it is still not working, you you post your entire game?

With regards to healing potions, they heal back to full hits. To change that, look in CombatTypes.xml for this, and change the second line:
Print ("You drink the healing potion, and suddenly you feel fine.")
game.pov.hitpoints = CalcFullHits ()
destroy (this.name)

Anonynn
The Pixie wrote:
If she types TALK TO BORIS again, she will get a menu again. This time her previous choice will not be there (unless ticked otherwise), but any topic listed in the "Show this after..." box for that topic will be there. I would guess you still need to list the new topics there to get yours to work properly.


That was the problem. Thank you!

The Pixie wrote:
With regards to healing potions, they heal back to full hits. To change that, look in CombatTypes.xml for this, and change the second line:


Print ("You drink the healing potion, and suddenly you feel fine.")
game.pov.hitpoints = CalcFullHits ()
destroy (this.name)


Is there anyway to vary healing items? I was hoping that some would recharge a little health, and some would recharge all of it. :/

The Pixie
To have pootions that heal a little, set them to be potions, not healing potions. You will then get a "Script to run when potion is taken" area on the tab, and there you can get the potion to do anything you want.

Anonynn
The Pixie wrote:To have pootions that heal a little, set them to be potions, not healing potions. You will then get a "Script to run when potion is taken" area on the tab, and there you can get the potion to do anything you want.



Ah, okay. I'll try and figure it out.

Also, Quest is having a bunch of errors when I published the first draft of the game... For wearables. It says...

Error running script: Error compiling expression 'item.worn = true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'

^ whenever someone tries to equip something. Sometimes the items work and sometimes they don't. What does this mean?

TinFoilMkIV
What it means is that at some point 'item.worn' is being used as an object reference instead of just holding the value true/false. The error is complaining that item.worn=<shirt> when its trying to look for true/false or something of the sort.

Can't really say how or where its being set to this but as I implied in my example I suspect that the 'item.worn' is being set to an actual worn item object instead of just true/false at some point

Anonynn
TinFoilMkIV wrote:What it means is that at some point 'item.worn' is being used as an object reference instead of just holding the value true/false. The error is complaining that item.worn=<shirt> when its trying to look for true/false or something of the sort.

Can't really say how or where its being set to this but as I implied in my example I suspect that the 'item.worn' is being set to an actual worn item object instead of just true/false at some point


All fixed. I just put everything the backpack so the player has to retrieve it out of that. It seemed to fix the issue, although I'm not sure why it was happening in the first place.

Now I have to figure out how to separate the player object carry limit and the backpack object carry limit.

HegemonKhan
this is just a general example of how it can be done, but I've no idea how Pixie's Library has been set up.

<object name="player">
<attr name="current_carry_limit" type="int">0</attr>
<attr name="maximum_carry_limit> type="int">100</attr>
</object>
// as scripting: player.current_carry_limit // this has to ignore the backpack's current_carry_limit
// as scripting: player.maximum_carry_limit

<object name="backpack">
<attr name="current_carry_limit" type="int">0</attr>
<attr name="maximum_carry_limit" type="int">50</attr>
</object>
// as scripting: backpack.maximum_carry_limit
// as scripting: backpack.current_carry_limit

// scripting, example:

if (backpack.current_carry_limit > player.maximum_carry_limit - player.current_carry_limit) {
msg ("The backpack is too heavy, you must remove some items from it, or some other items from your inventory.")
}

// or to make it really easy: just have the player and backpack carry limits totally separate: just don't have my ' // scripting example: ...scripting... '

Anonynn
HegemonKhan wrote:this is just a general example of how it can be done, but I've no idea how Pixie's Library has been set up.

<object name="player">
<attr name="current_carry_limit" type="int">0</attr>
<attr name="maximum_carry_limit> type="int">100</attr>
</object>
// as scripting: player.current_carry_limit // this has to ignore the backpack's current_carry_limit
// as scripting: player.maximum_carry_limit

<object name="backpack">
<attr name="current_carry_limit" type="int">0</attr>
<attr name="maximum_carry_limit" type="int">50</attr>
</object>
// as scripting: backpack.maximum_carry_limit
// as scripting: backpack.current_carry_limit

// scripting, example:

if (backpack.current_carry_limit > player.maximum_carry_limit - player.current_carry_limit) {
msg ("The backpack is too heavy, you must remove some items from it, or some other items from your inventory.")
}

// or to make it really easy: just have the player and backpack carry limits totally separate: just don't have my ' // scripting example: ...scripting... '



Hey, HK, good to hear from you again. You must have been busy! I'll give the code a shot and see how it does. Thank you very much. How have things been?

Anonynn
Pixie had another concern about the Combat Library. In the story, the player at the very beginning is able to equip a weapon, but in the very next scene they lose it in the context of the story, which I did the standard "remove item blah blah" ...but in the inventory pane, it still shows that the weapon is still equipped, is there a specific way or anything to return it to "fist" after that?

The Pixie
Do this:
player.equiped = null

HegemonKhan
doing alright, hopefully I'll get into some programming classes in the fall registration. still slowly trying to get through JS right now (it's so boring re-doing the basics again, due to having to learn the syntax for each new language, sighs), and working on learning to code more stuff in with quest's code and inching towards a game in quest, laughs.

good to see you again too, being back. We missed you. Quest doesn't have many people posting, sighs.

Anonynn
The Pixie wrote:Do this:
player.equiped = null



So I went to the script that removes the weapon and added another script "set variable or attribute" and tried...

player.equiped = null
player.equipped = null
player.equiped = fist
player.equipped = fist

but none of them seemed to work. Maybe I was digging in the wrong place. Would I put that after the script that removes the weapon from the player's inventory? Or would I put that somewhere else?

Thank you for your time, Pixie!

Anonynn
HegemonKhan wrote:doing alright, hopefully I'll get into some programming classes in the fall registration. still slowly trying to get through JS right now (it's so boring re-doing the basics again, due to having to learn the syntax for each new language, sighs), and working on learning to code more stuff in with quest's code and inching towards a game in quest, laughs.

good to see you again too, being back. We missed you. Quest doesn't have many people posting, sighs.



Sounds like you're going to be busy then! I hope your able to get the classes you want, and I hope they go well. As for people posting on Quest, I wouldn't worry about it, it's the summer so most people are probably out doing summery stuff. As for me, I'm going to be posting a lot since I need a ton of help! So I hope to keep you and Pixie pretty busy (but only on things that I absolutely cannot figure out on my own because I hate wasting people's time with dumb stuff). Keep an eye out!

I'm also going to be taking a look at that coding website you posted soon, specifically the Python section. Maybe it'll help!

Anonynn
HegemonKhan wrote:this is just a general example of how it can be done, but I've no idea how Pixie's Library has been set up.

<object name="player">
<attr name="current_carry_limit" type="int">0</attr>
<attr name="maximum_carry_limit> type="int">100</attr>
</object>
// as scripting: player.current_carry_limit // this has to ignore the backpack's current_carry_limit
// as scripting: player.maximum_carry_limit

<object name="backpack">
<attr name="current_carry_limit" type="int">0</attr>
<attr name="maximum_carry_limit" type="int">50</attr>
</object>
// as scripting: backpack.maximum_carry_limit
// as scripting: backpack.current_carry_limit

// scripting, example:

if (backpack.current_carry_limit > player.maximum_carry_limit - player.current_carry_limit) {
msg ("The backpack is too heavy, you must remove some items from it, or some other items from your inventory.")
}

// or to make it really easy: just have the player and backpack carry limits totally separate: just don't have my ' // scripting example: ...scripting... '



Also ^ ... this is under player attributes, which I got... but is that a "string" and in the string blank box, do I type "int">0< and that's it?

And what does "as scripting" mean? Is that still in the player object and backpack object attributes or is that another part entirely?

Basically the aim is...that the character can only carry two small things in there pockets, and the rest has to be stored in the backpack, but right now the backpack is sharing the players carry limit.

HegemonKhan
there's a built-in Integer Attribute for 'weight' (or whatever it is called: HK EDIT: it is called 'volume' lol, not 'weight' ) for your 'player' Player Object, so you can use this, unless you want to create~add in your own such Integer Attribute instead.

The good thing is that, you don't have to do anything more (well excluding all the actual more stuff you got to do ~ see further below, lol), as this (the built-in or your own custom) Attribute will be 'stand alone', as in, your 'backpack' Object's custom (created~added by you) 'weight' Integer Attribute, will in no way be affected by it (your 'player' Player Object's 'weight' Integer Attribute), and vice versa.

Unless you want to make it more realistic (tie the 'backpack' Object's 'weight' Integer Attribute to the 'player' Player Object's 'weight' Integer Attribute. I wouldn't though, it's not worth the trouble.

--------

so... this is what you need to do (as the above probably is confusing, lol):

1. create~add an Integer Attribute for your 'player' Player Object

you can either use the built-in 'volume' and~or 'maxobject' Integer Attributes or create~add your own.

to use the built-in Integer Attributes:

'game' Game Object -> 'Features' Tab -> 'inventory limits: ...' check box -> have it checked (as this will toggle on additional options for Objects, including your 'player' Player Object, which are the built-in 'volume' and 'maxobjects' Integer Attributes)

'player' Player Object -> 'Inventory' Tab -> (you'll now be seeing the two new options: 'inventory limitation: maxobjects' and 'volume' Integer Attributes) -> set up as you want

to create~add your own:

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

(Object Name: player)
Attribute Name: current_carry_weight
Attribute Type: int (integer)
Attribute Value: 0

(Object Name: player)
Attribute Name: maximum_carry_weight
Attribute Type: int (integer)
Attribute Value: 100 (or whatever you want)

btw, let me explain the creation tag code lines, as you asked about them, via showing their matchup below with the above:

<object name="player">
<attr name="current_carry_weight" type="int">0</attr>
<attr name="maximum_carry_weight" type="int">100</attr>
</object>


see how they match up? see how they match up? if not, let me know, and I'll help you with it.

2. now do the same for your 'backpack' Object:

you can either use the built-in 'volume' and~or 'maxobject' Integer Attributes or create~add your own.

to use the built-in Integer Attributes:

you'll only have the 'volume' Integer Attribute for Non-Player Objects however.

'game' Game Object -> 'Features' Tab -> 'inventory limits: ...' check box -> have it checked (as this will toggle on additional options for Objects, including your 'player' Player Object, which are the built-in 'volume' and 'maxobjects' Integer Attributes)

'backpack' Object -> 'Inventory' Tab -> (you'll now be seeing the only one new option: 'volume' Integer Attributes) -> set up as you want

to create~add your own:

'backpack' Object -> 'Attributes' Tab -> Attributes -> Add -> (see below, repeat as needed)

(Object Name: backpack)
Attribute Name: current_carry_weight
Attribute Type: int (integer)
Attribute Value: 0

(Object Name: backpack)
Attribute Name: maximum_carry_weight
Attribute Type: int (integer)
Attribute Value: 100 (or whatever you want)

btw, let me explain the creation tag code lines, as you asked about them, via showing their matchup below with the above:

<object name="backpack">
<attr name="current_carry_weight" type="int">0</attr>
<attr name="maximum_carry_weight" type="int">100</attr>
</object>


see how they match up? see how they match up? if not, let me know, and I'll help you with it.

-------

you then have to give all of your item Objects (the Objects you want to be able to be stored on~ the 'player' Player Object's inventory and~or in your 'backpack' container Object), a 'weight' Integer Attribute:

'whatever' Object -> 'Attributes' Tab -> Attributes -> Add -> (see below)

(Object Name: whatever)
Attribute Name: weight
Attribute Type: int
Attribute Value: (whatever you want)

example:

'loaf_of_bread' Object -> 'Attributes' Tab -> Attributes -> Add -> (see below)

(Object Name: loaf_of_bread)
Attribute Name: weight
Attribute Type: int
Attribute Value: 1

<object name="loaf_of_bread">
<alias>loaf of bread</alias>
<attr name="weight" type="int">1</attr>
</object>


and then lastly you'll need your scripting (such as for~with using the Object's Verbs for holding~adding your scripts to) to deal with the conditionals involved, for example (for putting the Object into your 'player' Player Object's inventory):

'loaf_of_bread' Object -> 'Inventory' Tab -> Take -> run as script -> (see below)

add new script -> scripts -> 'if' Script -> [expression] -> this.weight <= player.maximum_carry_weight - player.current_carry_weight
-> then -> add new script -> objects -> 'move object' Script -> move object [object] [loaf_of_bread] to [object] [player]
add else -> add new script -> output -> print a message -> print [expression] "You don't have enough carry weight remaining for your inventory to be able to handle your object ({this.alias}) 's additional weight."

<object name="loaf_of_bread">
<alias>loaf of bread</alias>
<take type="script">
</take>
</object>


-------

to put your 'loaf_of_bread' into your 'backpack' Object, you'll have to do something similiar, except you'll use the 'Verb' Tab, see if you can figure it out on own, but if not, then ask, and I'll help out.

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

aside from my guide above (which I try to explain in regards to your questions), here's me addressing your questions directly:

neonayon wrote:Also ^ ... this is under player attributes, which I got... but is that a "string" and in the string blank box, do I type "int">0< and that's it?


1. yes, it is under the player attributes: 'player' Player Object -> 'Attributes' Tab -> Attributes -> add -> (set it up, see below or above)
2. no, change it to 'Attribute Type: int' (int is used as the short form for integer which I don't like personally, but am stuck with lol), and then select your number~amount Value (your Value box and thus the Value you can type in, changes, based upon what Attribute Type you choose)
3. no, after you change the Attribute Type drop down box from [string] to [int], you then just type in the number~amount you want for the Value

neonayon wrote:And what does "as scripting" mean?


Sorry, that's my own terminolgy which I use, lol. So, just ignore it, as it's more trouble than it's worth for me to try to explain my usage of it, lol.

There's the individual Scripts (GUI~Editor: run as script -> add a~new script), and there's the Elements that hold these Scripts (able to 'add a~new script' to them):

Verbs (Object's 'Script Attributes), Functions, Commands, Turnscripts, Timers, Object Types (via Script Attributes), and etc

what I'm saying is that after you create~add the Attributes to your Player Objects and Objects, you then got to deal with the 'run as script -> add a~new script' that they require, such as via through the 'take' thingy or a Verb.

HegemonKhan
neonayon wrote:Basically the aim is...that the character can only carry two small things in there pockets, and the rest has to be stored in the backpack, but right now the backpack is sharing the players carry limit.


this is a different method, using ***CONCEPTUALLY*** a 'quantity of objects' vs my previous posts dealing with an amount of 'weight~carry weight'.

this would use (for the built-in Attribute, if you don't want to create your own) the 'maxobjects' Integer Attribute, not the 'volume' Attribute.

However, the rest of the stuff needed is very different (it's completely different than my previous post method), and I'd have to write~post another guide for it.

if you want to do it this way, that's fine, then ignore my previous post, and wait for my new one, guiding you through doing it this other way. Though, this other way, is a bit more advanced, as you're dealing with lists, as you got to find the 'quantity of objects'. The choice is of course yours. I'll try to help you to do it either way, and if I fail, then the more clear and concise posters (such as, Pixie or Jay, as they often help, lol) will help you do it.

Anonynn
[quote="HegemonKhan"]there's a built-in Integer Attribute for 'weight' (or whatever it is called: HK EDIT: it is called 'volume' lol, not 'weight' ) for your 'player' Player Object, so you can use this, unless you want to create~add in your own such Integer Attribute instead.

does that mean ^--------- that I change current_carry_weight to current_carry_volume? Because that messes with the game's volume.

(Object Name: player)
Attribute Name: current_carry_weight
Attribute Type: int (integer)
Attribute Value: 0

Also, I'm not sure it worked.

The player can carry a very small amount of items on themselves so after they grab something the player will be encouraged to place it in their backpack. The backpack itself has no weight/volume, and can carry up to like...20 in volume. The size of the objects doesn't matter too much, just the volume.

Another problem I'm having is.....

In the story, the player at the very beginning is able to equip a weapon, but in the very next scene they lose it in the context of the story, which I did the standard "remove item blah blah" ...but in the inventory pane, it still shows that the weapon is still equipped, is there a specific way or anything to return it to "fist" after that?

Pixie said to do this:

player.equiped = null


So I went to the script that removes the weapon and added another script "set variable or attribute" and tried...

player.equiped = null
player.equipped = null
player.equiped = fist
player.equipped = fist

But none of them worked.

And another problem I'm having is...

Error running script: Error compiling expression 'item.worn = true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'

Whenever someone tries to put on the clothing items in the very first area, this error pops up, but it's not every time, so I don't know why it's having trouble compiling the clothing in the starting area.

ALSO...I made a pair of pants have an armor rating of 1 (for incentive for them to be taken) but in the armor rating section of the combat pane, the armor rating still says zero.

See I'm posting enough for everyone, told you I needed tons of help :wink:

The Pixie
I was wrong about the equipped thing, it should be this:
player.equipped = fist
UpdateWeapon

The call to UpdateWeapon changes the status attribute.

With regards to this:

Error running script: Error compiling expression 'item.worn = true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'


This is probably because you have no attribute "worn" for the item, so item.worn is null. Quest is the trying to compare null, an object, with true, a Boolean.

I am not sure where this comes from. My CombatLib does not use that system at all (similar to weapons, it uses player.armourobject to hold the current armour).

With regards to your chainmail trousers,how did you set the armour rating? It should be set by adusting the Protection value on the Combat tab. Alternatively, set the "level" attribute.

HegemonKhan
neonayon wrote:does that mean ^--------- that I change current_carry_weight to current_carry_volume? Because that messes with the game's volume.


to use the built-in Integer Attributes:

'game' Game Object -> 'Features' Tab -> 'inventory limits: ...' check box -> have it checked (as this will toggle on additional options for Objects, including your 'player' Player Object, which are the built-in 'volume' and 'maxobjects' Integer Attributes)

'player' Player Object -> 'Inventory' Tab -> (you'll now be seeing the two new options: 'inventory limitation: maxobjects' and 'volume' Integer Attributes) -> set up as you want

(you do ***NOT*** need to do this as it is built-in, already created by the game engine) if you were to create it in the GUI~Editor, it would look like this:

(Object Name: whatever)
Attribute Name: volume
Attribute Type: int
Attribute Value: (whatever you want)

and~or (the other built-in Attribute):

(Object Name: whatever)
Attribute Name: maxobjects (I think this is its name ~ going from my bad memory, lol)
Attribute Type: int
Attribute Value: (whatever you want)
// the 'maxobjects' Integer Attribute seems only to be for your Player Objects

for your Scripts in such Verbs as 'take', 'use', 'give', and etc, you would use:

Object_name.volume = Value_or_Expression

examples:

backpack.volume = 50

----------

if you want to use the 2 Attributes of my 'current~maximum' design, then do this:

leave the 'volume' as it is, as there's no reason to change (which would overwrite) it. the 'volume' will be used as your 'current volume' in concept only, but do NOT change its name from 'volume', leave it named as 'volume'.

then just create your 'maximum_volume' Integer Attribute:

(Object Name: whatever)
Attribute Name: maximum_volume
Attribute Type: int
Attribute Value: (whatever)

for example:

(Object Name: backpack)
Attribute Name: maximum_volume
Attribute Type: int
Attribute Value: 100

for your Scripts in such Verbs as 'take', 'use', 'give', and etc, you would use:

Object_name.maximum_volume = Value_or_Expression

examples:

backpack.maximum_volume = 100

HegemonKhan
actually, this:

neonayon wrote:The player can carry a very small amount of items on themselves so after they grab something the player will be encouraged to place it in their backpack. The backpack itself has no weight/volume, and can carry up to like...20 in volume. The size of the objects doesn't matter too much, just the volume.


sounds more like you're using the built-in 'maxobjects' Attribute instead... if this is the case, then ignore my above post about the 'volume' Attribute.

Maybe Pixie can help you with this stuff, as I'm not really that familiar with this built-in GUI~Editor stuff. I'm not doing a good job at helping here, sighs.

Anonynn
The Pixie wrote:I was wrong about the equipped thing, it should be this:
player.equipped = fist
UpdateWeapon

The call to UpdateWeapon changes the status attribute.

With regards to this:

Error running script: Error compiling expression 'item.worn = true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'


This is probably because you have no attribute "worn" for the item, so item.worn is null. Quest is the trying to compare null, an object, with true, a Boolean.

I am not sure where this comes from. My CombatLib does not use that system at all (similar to weapons, it uses player.armourobject to hold the current armour).

With regards to your chainmail trousers,how did you set the armour rating? It should be set by adusting the Protection value on the Combat tab. Alternatively, set the "level" attribute.



Oh, I'm using the "wearables" library from Quest. I didn't change any of the values for the clothing though, it just doesn't seem to work sometimes in the starting area. Some clothes can be worn other times it comes up with that error, which is a relatively new thing.

As for the player.equipped thing, where should I put that exactly? Does that go on the player tab, or right after the script that takes the weapon away? I'm also not sure what "UpdateWeapon" is. That goes in the player tab though under status attributes? And if so, is that the attribute name UpdateWeapon?

As for the Combat Tab, I marked the jeans as "Armor" and selected the Protection (0-5) to 1, and the cost at 0. On the inventory panel however, where it says "Armor Rating" it says 0.

Anonynn
Basically, for the separate carry volumes...I have this...

Player_Object, inventory tab.
Maximum Objects "0" (since quantity won't matter just the total volume)
Volume "9"
Maximum Volume of Inventory "9"

and then

Backpack_Object, inventory tab.
Volume "1"
Limited Container
Maximum number of objects "0"
Maximum volume of objects "20"

So ideally, I want the player_object to hold like.."2" in volume, and the backpack_object to hold "25". So if the player grabs up an item, they can't store much on the player themselves, but are instead, encouraged to store everything in their backpacks. Does that make sense?

The Pixie
Neonayon wrote:Oh, I'm using the "wearables" library from Quest. I didn't change any of the values for the clothing though, it just doesn't seem to work sometimes in the starting area. Some clothes can be worn other times it comes up with that error, which is a relatively new thing.

I am not familiar with that library. How do you tell Quest that an item is wearable? Try going to the attributes tab, and seeing if there is a "worn" attribute for the glitching item. If not create one, and set it to be a Boolean set to false, and see if the fixes it - without breaking anything else.

As for the player.equipped thing, where should I put that exactly? Does that go on the player tab, or right after the script that takes the weapon away? I'm also not sure what "UpdateWeapon" is. That goes in the player tab though under status attributes? And if so, is that the attribute name UpdateWeapon?


UpdateWeapon is a function that you need to call to get the text is the status pane to update. When you take the weapon away, you need to add the two lines of code just after.

As for the Combat Tab, I marked the jeans as "Armor" and selected the Protection (0-5) to 1, and the cost at 0. On the inventory panel however, where it says "Armor Rating" it says 0.


I would guess this is because the armour is using the WEAR from the wearables library, not CombatLib. Whatever you do for the Wearables libary to tell it an item is worn, try NOT doing it for the armour, and then see if that fixes it. That may only be a temporary fix, but will help work out the problem.

Thinking about it, you are proably better off redesigning the armour system, so each item worn contributes to the armour rating. Not trivial, but doable.

Anonynn
The Pixie wrote:

"Neonayon"

Oh, I'm using the "wearables" library from Quest. I didn't change any of the values for the clothing though, it just doesn't seem to work sometimes in the starting area. Some clothes can be worn other times it comes up with that error, which is a relatively new thing.


I am not familiar with that library. How do you tell Quest that an item is wearable? Try going to the attributes tab, and seeing if there is a "worn" attribute for the glitching item. If not create one, and set it to be a Boolean set to false, and see if the fixes it - without breaking anything else.

As for the player.equipped thing, where should I put that exactly? Does that go on the player tab, or right after the script that takes the weapon away? I'm also not sure what "UpdateWeapon" is. That goes in the player tab though under status attributes? And if so, is that the attribute name UpdateWeapon?


UpdateWeapon is a function that you need to call to get the text is the status pane to update. When you take the weapon away, you need to add the two lines of code just after.

As for the Combat Tab, I marked the jeans as "Armor" and selected the Protection (0-5) to 1, and the cost at 0. On the inventory panel however, where it says "Armor Rating" it says 0.


I would guess this is because the armour is using the WEAR from the wearables library, not CombatLib. Whatever you do for the Wearables libary to tell it an item is worn, try NOT doing it for the armour, and then see if that fixes it. That may only be a temporary fix, but will help work out the problem.

Thinking about it, you are proably better off redesigning the armour system, so each item worn contributes to the armour rating. Not trivial, but doable.



Okay, so as far as the wearables library went ((here's a link to it btw: viewtopic.php?f=18&t=2901&start=6 )) I decided just to not use it. The "wear" boolean was already set to false, and no matter what I did, it didn't seem to fix anything. The error was still happening at random. With that said, I was wondering if there was a way in your combat library for a person to wear more than one thing, or if an entire outfit would need to be set instead of individual pieces of it.

I still haven't tested the two lines of code for the Update weapon thing, but I'm going to...
Remove Object: Rickety Machete
Add new script
Set variable or attribute
set variable player.equipped = fist
add new script
msg UpdateWeapon

let me know if this is correct please.

Also, when I removed the wearables library, the armor rating worked.

The Pixie
In the GUI, the last line will look like this:
[Call function] UpdateWeapon

You can find Call function in the Scripts section.

HegemonKhan
@Neonayon and Pixie:

Sorry about the other Library (Chase's Wearables Library) being used by neonayon, as if she wants to use it too, I'll have to check for if there's any conflicts (between Chase's Wearables Library and Pixie's Combat+Equipment+etc Libraries) and explain how to use Chase's Wearables Library for~in her game.

I just mentioned it as an alternative equipment library coding to look at, forgetting to mention though that she should jsut choose one library to use, to keep it simple, and without any possible conflicts.

Anonynn
HegemonKhan wrote:@Neonayon and Pixie:

Sorry about the other Library (Chase's Wearables Library) being used by neonayon, as if she wants to use it too, I'll have to check for if there's any conflicts (between Chase's Wearables Library and Pixie's Combat+Equipment+etc Libraries) and explain how to use Chase's Wearables Library for~in her game.

I just mentioned it as an alternative equipment library coding to look at, forgetting to mention though that she should jsut choose one library to use, to keep it simple, and without any possible conflicts.


Hey HK, you shouldn't distance yourself from the discussions! You're incredibly helpful all the time actually. Sometimes I get confused but I get confused at Pixie's explanations off and on as well. But I am very thankful for both of your help regarding my game. You both do this out of the goodness and patience of your hearts and because you enjoy it, so trust me, any time that either of you give me I am very grateful for. I like prodding you both with questions too because so far you both explain things in the best ways! So keep it up.

The only errors that I've noticed that conflict between the two libraries is...
1. The Armor Rating wasn't working in Pixie's library when applying an article of clothing as armor....
2. Error running script: Error compiling expression 'item.worn = true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean', which randomly started happening off and on. Sometimes when I loaded the game everything would work fine, and other times it wouldn't let anything be equipped and would post that error instead, at least until the player moved out of the starting zone. Pixie suggested I check the worn boolean and make sure that it's false and for all of the articles it was, and all of them had different "wear" layers. So I'm not sure what was causing that problem.

Other than those two oddities nothing seemed to conflict between the libraries. I hope that saves you some time.

Now, I just need help with a million other things and we'll be good to go, lol. Not even kidding, I still help with like...5 or 6 different things majorly complicated things. Ugh.

As far clothing goes, I'm wondering if it's possible in Pixie's Combat Library to have more than one "Armor/Clothing Article". Right now, shirts, pants, shoes etc all have to be in one object set, we'll it the "Adventurer's Garb" ...but I would really like pieces of clothing to be separated so players can mix and match what they want. Pixie said I should try creating an armor/clothing system from scratch but I would have no idea where to start with that.

I still have a lot of questions about the library too.

HegemonKhan
I haven't looked at Chase's Wearables Library in quite some time (nor Pixie's numerous Libraries), so I'd have to re-learn~study it again, before I can help you with it, so when I get the time, I'll try to help you with Chase's Wearables Library (it took me awhile to understand it the first time, I like Chase's Wearables Library as the code is so concise and pretty easy to follow, but actually understanding it, I found out wasn't so easy as it looks, lol, as lots of these Libraries are quite advanced with fancy coding. Pixie, Jaynabonne, Chase, Sora, Pertex, and etc, are all really good programmers, so their libraries are really cool... but it takes a good bit of struggle+difficulty to understand them, for us noob coders, laughs)

HegemonKhan
there's many different designs for doing equipment, and also it depends upon how simple or complex you want to go with it as well.

one of the more simple but limited setups is to use Object Attributes (Attribute Type: object) for your 'body part ~ equipment slots' :

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

example:
(Object Name: player)
Attribute Name: right_hand
Attribute Type: object
Attribute Value: sword

<object name="player">
<attr name="right_hand" type="object">sword</attr>
<attr name="left_hand" type="object">shield</attr>
<attr name="head" type="object">helmet</attr>
<attr name="face" type="object">visor</attr>
<attr name="chest" type="object">mail</attr>
// etc etc etc
</object>

<object name="sword">
</object>

<object name="shield">
</object>

// etc etc etc Objects


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

run as script -> add a~new script -> variables -> 'set a variable or attribute' Script -> [expression] -> (see below)

Equipment example:

player.right_hand = sword
player.left_hand = shield
player.head = helmet
player.face = visor
player.chest = mail
player.shoulders = pauldrons
player.waist = tassets
player.back = cape
player.legs = greaves
player.feet = boots
player.arms = vambraces
player.hands = gauntlets
player.ears = earrings
player.neck = necklace
player.fingers = rings

player.right_hand = sword
// then to change ( 're-equip' ) it:
player.right_hand = axe
// 'sword' and 'axe' must be actual Objects in the game.

Clothing example:

player.head = hat
player.face = glasses
player.chest = shirt
player.back = backpack
player.waist = shorts
player.legs = socks
player.feet = shoes
player.arms = bracelets
player.neck = necklace
player.ears = studs
player.fingers = rings
player.hands = gloves

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

there is a lot more that is needed, but it's a start for you, if you want to get into trying to learn to work with equipment (it's not easy, I just barely understand it myself). Pixie, Pertex, and Chase (in their libraries) all go into much more fancy usage~design of equipment systems, far beyond my ability.

Anonynn
HegemonKhan wrote:there's many different designs for doing equipment, and also it depends upon how simple or complex you want to go with it as well.

one of the more simple but limited setups is to use Object Attributes (Attribute Type: object) for your 'body part ~ equipment slots' :

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

example:
(Object Name: player)
Attribute Name: right_hand
Attribute Type: object
Attribute Value: sword

<object name="player">
<attr name="right_hand" type="object">sword</attr>
<attr name="left_hand" type="object">shield</attr>
<attr name="head" type="object">helmet</attr>
<attr name="face" type="object">visor</attr>
<attr name="chest" type="object">mail</attr>
// etc etc etc
</object>

<object name="sword">
</object>

<object name="shield">
</object>

// etc etc etc Objects


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

run as script -> add a~new script -> variables -> 'set a variable or attribute' Script -> [expression] -> (see below)

Equipment example:

player.right_hand = sword
player.left_hand = shield
player.head = helmet
player.face = visor
player.chest = mail
player.shoulders = pauldrons
player.waist = tassets
player.back = cape
player.legs = greaves
player.feet = boots
player.arms = vambraces
player.hands = gauntlets
player.ears = earrings
player.neck = necklace
player.fingers = rings

player.right_hand = sword
// then to change ( 're-equip' ) it:
player.right_hand = axe
// 'sword' and 'axe' must be actual Objects in the game.

Clothing example:

player.head = hat
player.face = glasses
player.chest = shirt
player.back = backpack
player.waist = shorts
player.legs = socks
player.feet = shoes
player.arms = bracelets
player.neck = necklace
player.ears = studs
player.fingers = rings
player.hands = gloves

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

there is a lot more that is needed, but it's a start for you, if you want to get into trying to learn to work with equipment (it's not easy, I just barely understand it myself). Pixie, Pertex, and Chase (in their libraries) all go into much more fancy usage~design of equipment systems, far beyond my ability.


So this is what I went with...

Clothing_Feet
Clothing_Head
Clothing_Chest
Clothing_Inner_Chest
Clothing_Pelvis
Clothing_Shoulders
Clothing_Legs
Clothing_Right_Hand
Clothing_Left_Hand
Clothing_Ears
Clothing_Fingers
Clothing_Neck

But how do I go about setting up "items" to fit these categories? And giving them a "worn" status on the inventory pane?

HegemonKhan
(if my posts are confusing you more, then just, IGNORE THEM, lol)

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

well, in this simple system~design we're not using 'worn~equipped', nor the displayment of 'Object_alias (worn)' (I'd have to look this up again on one of Pixie's Libraries to see how it's done as it's been awhile and is a bit advanced, lol), and nor etc more complex stuff (so if you do want this stuff, then ignore this post!), in that by just having:

Weapon_Object_name.parent=player
~and~
player.equipment_right_hand=Weapon_Object_name

we're conceptually 'equipped' with the 'sword~axe~unarmed_right_hand' in our right hand

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

<object name="player">
<parent type="object">room</attr>
<attr name="equipment_right_hand" type="object">unarmed_right_hand</attr>
</object>

<object name="unarmed_right_hand">
<alias>unarmed</alias>
<drop type="boolean">false</attr>
<parent type="object">player</parent>
<attr name="damage" type="int">1</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=unarmed_right_hand) {
player.equipment_right_hand=unarmed_right_hand
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="sword">
<take />
<parent type="object">room</attr>
<attr name="damage" type="int">50</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=sword) {
player.equipment_right_hand=sword
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="axe">
<take />
<parent type="object">room</attr>
<attr name="damage" type="int">100</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=axe) {
player.equipment_right_hand=axe
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<verb>
<property>equip</property>
<pattern>equip</pattern>
<defaultexpression>"You can't equip that."</defaultexpression>
</verb>


we can do this:

<object name="orc">
<parent type="object">room</attr>
<attr name="life" type="int">500</attr>
<attack type="script">
orc.life = orc.life - player.Equipment_Right_Hand.damage
</attack>
</object>

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

<object name="player">
<parent type="object">room</attr>
<attr name="equipment_right_hand" type="object">unarmed_right_hand</attr>
</object>

<object name="unarmed_right_hand">
<alias>unarmed</alias>
<drop type="boolean">false</attr>
<parent type="object">player</parent>
<attr name="damage" type="int">1</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=unarmed_right_hand) {
player.equipment_right_hand=unarmed_right_hand
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="sword">
<parent type="object">room</attr>
<take />
<attr name="damage" type="int">50</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=sword) {
player.equipment_right_hand=sword
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="axe">
<take />
<parent type="object">room</attr>
<attr name="damage" type="int">100</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=axe) {
player.equipment_right_hand=axe
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<verb>
<property>equip</property>
<pattern>equip</pattern>
<defaultexpression>"You can't equip that."</defaultexpression>
</verb>


----------

oh, if you want to see this stuff during game play:

in the status pane:

<object name="player">
<parent type="object">room</attr>
<attr name="equipment_right_hand" type="object">unarmed_right_hand</attr>
<attr name="equipment_left_hand" type="object">unarmed_left_hand</attr>
<statusattributes type="simplestringdictionary">equipment_right_hand = Equipment Right Hand: !; equipment_left_hand = Equipment Left Hand: !</statusattributes>
</object>


and~or, as a typed-in input of 'equipment' by the person during game (via usage of a Command):

<command name="character_equipment_screen">
<pattern>equipment</pattern>
<script>
ClearScreen
msg ("Character Equipment Screen")
msg ("")
msg ("Right Hand: " + player.equipment_right_hand)
msg ("Left Hand: " + player.equipment_left_hand)
wait {
ClearScreen
}
</script>
</command>

Anonynn
HegemonKhan wrote:(if my posts are confusing you more, then just, IGNORE THEM, lol)

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

well, in this simple system~design we're not using 'worn~equipped', nor the displayment of 'Object_alias (worn)' (I'd have to look this up again on one of Pixie's Libraries to see how it's done as it's been awhile and is a bit advanced, lol), and nor etc more complex stuff (so if you do want this stuff, then ignore this post!), in that by just having:

Weapon_Object_name.parent=player
~and~
player.equipment_right_hand=Weapon_Object_name

we're conceptually 'equipped' with the 'sword~axe~unarmed_right_hand' in our right hand

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

<object name="player">
<parent type="object">room</attr>
<attr name="equipment_right_hand" type="object">unarmed_right_hand</attr>
</object>

<object name="unarmed_right_hand">
<alias>unarmed</alias>
<drop type="boolean">false</attr>
<parent type="object">player</parent>
<attr name="damage" type="int">1</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=unarmed_right_hand) {
player.equipment_right_hand=unarmed_right_hand
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="sword">
<take />
<parent type="object">room</attr>
<attr name="damage" type="int">50</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=sword) {
player.equipment_right_hand=sword
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="axe">
<take />
<parent type="object">room</attr>
<attr name="damage" type="int">100</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=axe) {
player.equipment_right_hand=axe
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<verb>
<property>equip</property>
<pattern>equip</pattern>
<defaultexpression>"You can't equip that."</defaultexpression>
</verb>


we can do this:

<object name="orc">
<parent type="object">room</attr>
<attr name="life" type="int">500</attr>
<attack type="script">
orc.life = orc.life - player.Equipment_Right_Hand.damage
</attack>
</object>

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

<object name="player">
<parent type="object">room</attr>
<attr name="equipment_right_hand" type="object">unarmed_right_hand</attr>
</object>

<object name="unarmed_right_hand">
<alias>unarmed</alias>
<drop type="boolean">false</attr>
<parent type="object">player</parent>
<attr name="damage" type="int">1</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=unarmed_right_hand) {
player.equipment_right_hand=unarmed_right_hand
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="sword">
<parent type="object">room</attr>
<take />
<attr name="damage" type="int">50</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=sword) {
player.equipment_right_hand=sword
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<object name="axe">
<take />
<parent type="object">room</attr>
<attr name="damage" type="int">100</attr>
<equip type="script">
if (this.parent = player) {
if (not player.equipment_right_hand=axe) {
player.equipment_right_hand=axe
} else {
msg ("You're already equipped with it.")
}
}
</equip>
</object>

<verb>
<property>equip</property>
<pattern>equip</pattern>
<defaultexpression>"You can't equip that."</defaultexpression>
</verb>


----------

oh, if you want to see this stuff during game play:

in the status pane:

<object name="player">
<parent type="object">room</attr>
<attr name="equipment_right_hand" type="object">unarmed_right_hand</attr>
<attr name="equipment_left_hand" type="object">unarmed_left_hand</attr>
<statusattributes type="simplestringdictionary">equipment_right_hand = Equipment Right Hand: !; equipment_left_hand = Equipment Left Hand: !</statusattributes>
</object>


and~or, as a typed-in input of 'equipment' by the person during game (via usage of a Command):

<command name="character_equipment_screen">
<pattern>equipment</pattern>
<script>
ClearScreen
msg ("Character Equipment Screen")
msg ("")
msg ("Right Hand: " + player.equipment_right_hand)
msg ("Left Hand: " + player.equipment_left_hand)
wait {
ClearScreen
}
</script>
</command>


Well, I don't have to worry about the equipped thing so much since Pixie's library already takes care of equipping a weapon and displaying that it's equipped in the status pane. I'm more concerned at the moment with letting players 'wear' different layers of clothing on different body parts. I think the wearables library had wear layers to take care of that, but I have no idea how to implement it. Maybe I should just bring that library back...but I'm afraid the same problems and errors will happen again, particularly that error with the worn boolean being true or whatever it was.

The Pixie
I think HK is suggesting a system where the player wears a piece of armour on a certain location - chainmail gauntlets on the hands, or a leather cuirass on the chest (like the Elder Scrolls games for example).

If you want to use wearables, I would suggest removing my armour system from the libraries. A basic plan is to back everythng up, then

Step 1: Delete the entire armour type in CombatTypes.xml.

In CombatStuff there is a line like this:
      damage = damage + GetRandomInt (1, weapon.damagedicesides) - foe.armour

Change to
      damage = damage + GetRandomInt (1, weapon.damagedicesides) - GetArmour(foe)

Comment out this line (put // at the start):
    dictionary add (game.pov.statusattributes, "armour", "Armour rating: !")


Then create a new function, GetArmour, of type int, with a single parameter. Make it just return 0.

Check the game will play. Very likely there will be other bits you need to change, so good luck!

Step 2: Add the wearables library. Add your armour items (at least enough to test with).

Check the game will play.

Step 3: Modify your GetArmour function. If the foe is the player, get a value for the amour, based on what the player is wearing. Otherwise return foe.armour.

Step 4: Bear in mind that the system assumes armour ranges from 0 to 4, which is not much of range for what you want to do - with only five different values, there is not much scope for variety. You may need to tweak the combat mechanics to make the system meaningful. Is there actually any difference between going barefoot and wearing steel boots? This is part of the reason I choice not to go this route, the other reason being I did not want to have to implement literally hundreds of bits of armour for my game.

Anonynn
The Pixie wrote:I think HK is suggesting a system where the player wears a piece of armour on a certain location - chainmail gauntlets on the hands, or a leather cuirass on the chest (like the Elder Scrolls games for example).

If you want to use wearables, I would suggest removing my armour system from the libraries. A basic plan is to back everythng up, then

Step 1: Delete the entire armour type in CombatTypes.xml.

In CombatStuff there is a line like this:
      damage = damage + GetRandomInt (1, weapon.damagedicesides) - foe.armour

Change to
      damage = damage + GetRandomInt (1, weapon.damagedicesides) - GetArmour(foe)

Comment out this line (put // at the start):
    dictionary add (game.pov.statusattributes, "armour", "Armour rating: !")


Then create a new function, GetArmour, of type int, with a single parameter. Make it just return 0.

Check the game will play. Very likely there will be other bits you need to change, so good luck!

Step 2: Add the wearables library. Add your armour items (at least enough to test with).

Check the game will play.

Step 3: Modify your GetArmour function. If the foe is the player, get a value for the amour, based on what the player is wearing. Otherwise return foe.armour.

Step 4: Bear in mind that the system assumes armour ranges from 0 to 4, which is not much of range for what you want to do - with only five different values, there is not much scope for variety. You may need to tweak the combat mechanics to make the system meaningful. Is there actually any difference between going barefoot and wearing steel boots? This is part of the reason I choice not to go this route, the other reason being I did not want to have to implement literally hundreds of bits of armour for my game.



^------ I tried all of this but nothing seemed to happen.

On that note though...

[quote="The Pixie"]I think HK is suggesting a system where the player wears a piece of armour on a certain location - chainmail gauntlets on the hands, or a leather cuirass on the chest (like the Elder Scrolls games for example).

^--- I wouldn't mind this at all, that's why I was going with the idea. I don't really mind if none of the clothing has armor or not (for the time being).

Clothing_Feet
Clothing_Head
Clothing_Chest
Clothing_Inner_Chest
Clothing_Pelvis
Clothing_Shoulders
Clothing_Legs
Clothing_Right_Hand
Clothing_Left_Hand
Clothing_Ears
Clothing_Fingers
Clothing_Neck

HK helped me come up with these item slots, and I've already applied them to the player_object. The problems I have now is a way for items such as the starting shirt "Plain black shirt" and the starting "backpack", "pants" and "shoes" and whatnot to display "worn" in the inventory pane, and to make it so that the clothing....let's say the player finds another shirt, for example can't be overlapped. Of course, it would be wonderful too if each item could be applied to the correct slot too, for example "Clothing_Feet" would fit the shoe/boot.

Does that make sense?

HegemonKhan
bare with me (as I'm a really ignorant guy when it comes to clothing, clothing types and names, laughs).

'clothing layers and clothing-body_part slots-locations' is a huge leap in code advancement of a clothing system, it took me a very long long long long time to understand Chase's Wearables Library (and will likely take me a good bit of time to re-learn it too, to help you with it, neonayon). So, this may not be soemthing that you want to jump into right away (as just a clothing system of itself is one of the more advanced concepts~things to work on, by itself, even at its most simpliest design). If you want to, that's fine, but it's going to take us some time to try to help you through it (you'll have to have patience, it will take some time for you to learn, and for us to try to teach~help you through it), as it's really advanced stuff (at least for me it was~is, lol).

first, the concept of 'layers':

it's kinda impractical or impossible to take off your underwear~boxers~panties, when you're still wearing jean pants, well, so, that is what Chase's 'layer' coding is addressing: Realism (and code practicality too, coincidentally). Your underwear~panties~boxers would have a 'layer' Integer Attribute with the Value of '0'. Your jean pants would have a 'layer' Integer Attribute with the Value of '1'. Your belt would have a 'layer' Integer Attribute with the Value of '2'. Your trench coat would have a 'layer' Integer Attribute with the Value of '3'. The reason for this is that you can then compare (using the 'if' Script) those clothing's 'layer' Integer Attributes, using greater than or lesser than, to prevent the removal of the underwear~panties~boxers~belt~jean_pants before the removal of the trench_coat, preventing the removal of the panties~underwear~boxers~jean_pants before the removal of the belt, and etc etc etc.

'wear' Verb~Command:

(you want to wear your boxers, so you can to go to bed, but you still got your pants on, so we don't want you to be able to wear your boxers!)

// from: player.waist = pants
pants.layer = 1
// to: player.waist = boxers
boxers.layer = 0

if (player.waist1.layer > boxers.waist.layer) {
msg ("Sorry, you got to remove your pants first, before you can wear your boxers.")
} else {
player.waist = boxers
msg ("You wear your boxers, and go to bed.")
}


second, is the concept of body_part~clothing locations~slots:

which my previous post demonstrates (though Chase uses Objectlist Attributes:multiple Values: multiple Objects, instead of my using of Object Attributes:single Values: single Objects, so his~her code design is very different~better~more advanced than mine).

what these two things allow for conceptually:

waist slot~location: underwear~boxers~panties (layer:0), jean_pants (layer:1), belt (layer:2), trench_coat (layer:3)
chest slot~location: bra (layer:0), undershirt~bodice (layer:1), shirt~blouse~dress~gown~etc (layer:2), outer_clothing (layer:3)
etc etc etc

as opposed to my simple:

head slot~location: hat
face slot~location: glasses
waist slot~location: pants
chest slot~location: shirt

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

off-topic

laughs, as a male, we think in terms of violence~fighting~combat~war~etc (males are specialized for outward~outside threats: if another organism, be it a human or non-human, is threatening to steal~eat~kill your baby, get a male to help), and so I use 'equipment' as it is familiar to me (and other males), whereas, females are more interested~familiar with~in 'clothing' (females are specialized for inward~inside threats: if a bacteria or virus is threatening someone, get a female to help), so my apologizes for using the less familiar 'equipment', than 'clothing' for you, neonayon. (if interested further in the science of sexual specialization, I can give a very long lecture, laughs. I'm a huge science nerd, loving all fields of science, such as this one, laughs).

HegemonKhan
neonayon wrote:The problems I have now is a way for items such as the starting shirt "Plain black shirt" and the starting "backpack", "pants" and "shoes" and whatnot to display "worn" in the inventory pane, and to make it so that the clothing....let's say the player finds another shirt, for example can't be overlapped. Of course, it would be wonderful too if each item could be applied to the correct slot too, for example "Clothing_Feet" would fit the shoe/boot.

Does that make sense?


this is exactly what Chase's Wearable Library does, I just need to (re)study it (or Pixie can design his~her own ~similiar code to do the same thing, helping you with it ~ or to just study Chase's code too, to help you with it), so I can help guide you through getting it to work within your game.

Unfortunately, Libraries are usually systems, so there's a bit of configuring required within the person's own game code, to get them to be "sync'ed up".

here's Chase's Wearables Library (I'm trying to re-study it on how to get the displayment of 'worn' to work right now):

(do note, that if you're using Pixie's Libraries, you're going to need Pixie's help on what conflicts exist as I don't know Pixie's Library, I'm too lazy to study Pixie's Library on top of Chase's, lol)

<library>
<!--
Chase's Wearables Library v2.3
Based on: Pixie's Clothing Library (originally)

You may edit this library however you please.

I decided to include a UI, since not having a UI kinda bugged me.

v1.01
-Fixed a typo

v1.02
+Added Event Handlers
+Fixed drop bug

v1.03
+Added configurable wear/remove messages
-Removed redundant events

v1.04
=Fixed an issue with wearing multiple blank items
=Fixed the issue with wearing items without aliases

v2.0
=Rewritten to better support base systems, may have broken older usages
+Added wear layer support

v2.1
=Fixed an issue of an error being thrown when trying to wear something that is not wearable.

v2.2
=Fixed an issue where the custom remove message doesn't play if the item cannot be removed.

v2.3
=Fixed a significant bug where you could not wear something if a non-wearable item was in your inventory.

Chase
chasesan@gmail.com
-->

<dynamictemplate name="WearSuccessful">"You put " + object.article + " on."</dynamictemplate>
<dynamictemplate name="WearUnsuccessful">"You can't wear " + object.article + "."</dynamictemplate>
<dynamictemplate name="AlreadyWearing">"You are already wearing " + object.article + "."</dynamictemplate>
<dynamictemplate name="CannotWearOver">"You cannot wear that over " + object.display + "."</dynamictemplate>
<dynamictemplate name="CannotWearWith">"You cannot wear that while wearing " + object.display + "."</dynamictemplate>

<dynamictemplate name="RemoveSuccessful">"You take " + object.article + " off."</dynamictemplate>
<dynamictemplate name="RemoveUnsuccessful">"You can't remove " + object.article + "."</dynamictemplate>
<dynamictemplate name="RemoveFirst">"You can't remove that while wearing "+object.display+"."</dynamictemplate>

<template name="Wear">Wear</template>
<verbtemplate name="wear">wear</verbtemplate>
<verbtemplate name="wear">put on</verbtemplate>

<template name="Remove">Remove</template>
<verbtemplate name="remove">remove</verbtemplate>
<verbtemplate name="remove">take off</verbtemplate>

<command name="wear" template="wear">
<multiple>
return (ScopeInventory())
</multiple>
<script>
foreach (obj, object) {
DoWear(obj)
}
</script>
</command>

<command name="remove" template="remove">
<multiple>
return (ScopeInventory())
</multiple>
<script>
foreach (obj, object) {
DoRemove(obj)
}
</script>
</command>

<function name="DoWear" parameters="object"><![CDATA[
if(not HasAttribute(object,"worn")) {
msg (DynamicTemplate("WearUnsuccessful", object))
} else if (object.parent = player and object.worn = true) {
msg (DynamicTemplate("AlreadyWearing", object))
} else if (not ListContains(ScopeInventory(), object)) {
msg (DynamicTemplate("WearUnsuccessful", object))
} else {
isLayerProblem = false
conflictedItem = null

if(HasAttribute(object,"wear_slots")) {
foreach(item, ScopeReachableInventory()) {
if(HasAttribute(item,"wear_slots")) {
if(item.worn = true) {
foreach(itemSlot,item.wear_slots) {
if(ListContains(object.wear_slots,itemSlot)) {
if(object.wear_layer < item.wear_layer) {
conflictedItem = item
isLayerProblem = true
} else if(object.wear_layer = item.wear_layer) {
conflictedItem = item
}
}
}
}
}
}
}

if(conflictedItem = null) {
object.worn = True
object.original_drop = object.drop
object.original_alias = object.alias
object.drop = false

object.display = GetDisplayName(object)
object.alias = GetDisplayAlias(object) + " (worn)"

if(object.wearmsg = null) {
msg (DynamicTemplate("WearSuccessful",object))
} else {
msg(object.wearmsg)
}

//do after
if (HasScript(object, "onafterwear")) {
do(object, "onafterwear")
} else if(HasString(object, "onafterwear")) {
msg(object.onafterwear)
}
} else if(isLayerProblem = true) {
msg(DynamicTemplate("CannotWearOver",conflictedItem))
} else {
msg(DynamicTemplate("CannotWearWith",conflictedItem))
}

}
]]></function>

<function name="DoRemove" parameters="object"><![CDATA[
if (not object.parent = player or not object.worn or not object.removeable) {
if(object.removemsg = null) {
msg (DynamicTemplate("RemoveUnsuccessful",object))
} else {
msg (object.removemsg)
}
} else {
conflictedItem = null
//check if we are wearing anything over it
if(HasAttribute(object,"wear_slots")) {
foreach(item, ScopeReachableInventory()) {
if(HasAttribute(item,"wear_slots")) {
if(item.worn = true) {
foreach(itemSlot,item.wear_slots) {
if(ListContains(object.wear_slots,itemSlot)) {
if(object.wear_layer < item.wear_layer) {
conflictedItem = item
}
}
}
}
}
}
}

if(conflictedItem = null) {
if(object.removemsg = null) {
msg (DynamicTemplate("RemoveSuccessful",object))
} else {
msg(object.removemsg)
}

object.worn = false
object.drop = object.original_drop
object.alias = object.original_alias
object.original_drop = null
object.original_alias = null
object.display = null

//do after
if (HasScript(object, "onafterremove")) {
do(object, "onafterremove")
} else if(HasString(object, "onafterremove")) {
msg(object.onafterremove)
}
} else {
msg (DynamicTemplate("RemoveFirst", conflictedItem))
}
}
]]></function>

<type name="wearable">
<worn type="boolean">false</worn>
<removeable type="boolean">true</removeable>
<wear_layer type="int">2</wear_layer>
<inventoryverbs type="listextend">[Wear];[Remove]</inventoryverbs>
</type>
<!-- Interface -->
<tab>
<parent>_ObjectEditor</parent>
<caption>Wearable</caption>
<mustnotinherit>editor_room; defaultplayer</mustnotinherit>

<control>
<controltype>title</controltype>
<caption>Wearable</caption>
</control>

<control>
<controltype>dropdowntypes</controltype>
<caption>Can be worn?</caption>
<types>*=Cannot be worn; wearable=Can be worn</types>
<width>150</width>
</control>

<control>
<mustinherit>wearable</mustinherit>
<controltype>checkbox</controltype>
<attribute>removeable</attribute>
<caption>Removeable?</caption>
</control>

<control>
<mustinherit>wearable</mustinherit>
<controltype>number</controltype>
<caption>Wear Layer</caption>
<attribute>wear_layer</attribute>
</control>

<control>
<mustinherit>wearable</mustinherit>
<caption>Wear Slot</caption>
<controltype>list</controltype>
<attribute>wear_slots</attribute>
<editprompt>Please enter the name for the wear location</editprompt>
</control>

<control>
<mustinherit>wearable</mustinherit>
<controltype>label</controltype>
<caption>If two objects have the same wear location, they will not be able to be worn at a same time. Any number items without wear locations can be worn.</caption>
<advanced/>
</control>

<!-- snip -->

<control>
<mustinherit>wearable</mustinherit>
<controltype>textbox</controltype>
<attribute>wearmsg</attribute>
<caption>Message to print when wearing (leave blank for default)</caption>
<nullable/>
</control>

<control>
<mustinherit>wearable</mustinherit>
<controltype>textbox</controltype>
<attribute>removemsg</attribute>
<caption>Message to print when removing or trying to remove (leave blank for default)</caption>
<nullable/>
</control>

<!-- Event Handlers from here down none/text/scripts -->

<control>
<mustinherit>wearable</mustinherit>
<controltype>title</controltype>
<caption>After Wearing</caption>
</control>

<control>
<mustinherit>wearable</mustinherit>
<selfcaption>After wearing the object</selfcaption>
<controltype>multi</controltype>
<attribute>onafterwear</attribute>
<types>null=None; string=Text; script=Run script</types>
<editors>string=textbox</editors>
<expand/>
</control>

<control>
<mustinherit>wearable</mustinherit>
<controltype>title</controltype>
<caption>After Removing</caption>
</control>

<control>
<mustinherit>wearable</mustinherit>
<selfcaption>After removing the object</selfcaption>
<controltype>multi</controltype>
<attribute>onafterremove</attribute>
<types>null=None; string=Text; script=Run script</types>
<editors>string=textbox</editors>
<expand/>
</control>

</tab>
</library>

HegemonKhan
the displayment that you want:

Player Inventory Pane:

coat
shirt (worn)
pants (worn)
hat

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

the code trick to doing it:

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

object.alias = GetDisplayAlias (example, see below: shirt_1) + " (worn)"

conceptually:

<object name="shirt_1">
<alias>shirt</alias>
</object>


shirt_1.name = shirt_1
shirt_1.alias = shirt
// the 'alias' will over-ride the 'name' for displayment during the game, so the displayment is: shirt
// the 'GetDisplayAlias()' Function will get and return that displayment (which is: shirt) of the Object you put into its parenthesis
// so we've got: shirt_1.alias = GetDisplayAlias (shirt_1) + " (worn)"
// so now we got: shirt_1.alias = shirt + " (worn)"
// and now we got: shirt_1.alias = shirt (worn)
// and this new alias, is what is now displayed as (and on the):

Player Inventory Pane (during game play):

shirt (worn)

instead of it being not-worn:

shirt

-----------

I'm not sure if the above is correct (it's been awhile, and Chase's Library really doesn't answer this for me, lol. I may have to look at Pixie's libraries as they also use this code trick and explain what fully needs to be done for it to work), if there's something else we need to do or not, such as Chase's use of 'display', if this is a built-in Attribute that is involved in getting the displayment to work, or if it's just a custom Attribute for his~her Library code system to work.

----------

however, there's more code involved than just this, as we got to save the non-worn displayment of just 'shirt' too, for when we unequip~remove the shirt from being worn by the player. But we can get into this later. Do you kinda understand the concept here of what~how we want to do this stuff?

HegemonKhan
as to using Chase's Wearables Library:

he~she has GUI~Editor tabs created for you to use to set up your clothing items in your game, so just use the GUI~Editor (once you got Chase's Library File referenced in your game, and the library file in the same folder as your 'quest.exe' file, of course).

everything is set up for you, all you got to do is in the GUI~Editor:

'whatever clothing' (any NON-Room and NON-Player) Object -> 'Wearable' Tab (due to Chase's Wearables Library) -> 'can be worn?' -> [can be worn] -> (set up the rest of the options, as you want, ask if you need help or explanation of any of them)

Anonynn

'wear' Verb~Command:

(you want to wear your boxers, so you can to go to bed, but you still got your pants on, so we don't want you to be able to wear your boxers!)

// from: player.waist = pants
pants.layer = 1
// to: player.waist = boxers
boxers.layer = 0

if (player.waist1.layer > boxers.waist.layer) {
msg ("Sorry, you got to remove your pants first, before you can wear your boxers.")
} else {
player.waist = boxers
msg ("You wear your boxers, and go to bed.")
}



Okay! This is super complex so in order to not get lost I'll be breaking it down bit by bit. I actually don't mind (for now) if the layers are unrealistic. How I set it up in the library code with wearables (before I deleted it and removed it from the game) was:
panties/boxers were layer 0
bra/undershirt/corset/A-shirts/long-johns were layer 1
shirts/blouses/dresses were layer 2
pants/skirts were layer 3
jackets/overcoats layer 4
backpacks/purses layer 5
gloves/long sleeves layer 6
shoes/boots/heels were layer 7.

With that being said, I don't mind if people can remove boxers before pants (for now) seeing as that is just semantics, but I would like to prevent people from wearing pants and a skirt at the same time, or two pairs of pants, or two shirts.

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

off-topic

laughs, as a male, we think in terms of violence~fighting~combat~war~etc (males are specialized for outward~outside threats: if another organism, be it a human or non-human, is threatening to steal~eat~kill your baby, get a male to help), and so I use 'equipment' as it is familiar to me (and other males), whereas, females are more interested~familiar with~in 'clothing' (females are specialized for inward~inside threats: if a bacteria or virus is threatening someone, get a female to help), so my apologizes for using the less familiar 'equipment', than 'clothing' for you, neonayon. (if interested further in the science of sexual specialization, I can give a very long lecture, laughs. I'm a huge science nerd, loving all fields of science, such as this one, laughs).



That is actually really interesting! I didn't know that. I mean, I guess it does make sense though.

As for this...

object.alias = GetDisplayAlias (example, see below: shirt_1) + " (worn)"

I follow that so far...
Type: Object
Name: plain_black_shirt
Alias: Plain Black Shirt

<object name="shirt_1">
<alias>shirt</alias>
</object>

^--- which is that.

So for the 'GetDisplayAlias()' Function....I'm not sure how to access that. Do I view Filter, Show Library Elements and find it there, or is it found in the object attributes? once I find it, I can follow this more clearly.

shirt_1.name = shirt_1
shirt_1.alias = shirt
// the 'alias' will over-ride the 'name' for displayment during the game, so the displayment is: shirt
// the 'GetDisplayAlias()' Function will get and return that displayment (which is: shirt) of the Object you put into its parenthesis
// so we've got: shirt_1.alias = GetDisplayAlias (shirt_1) + " (worn)"
// so now we got: shirt_1.alias = shirt + " (worn)"
// and now we got: shirt_1.alias = shirt (worn)
// and this new alias, is what is now displayed as (and on the):

HegemonKhan
neonayon wrote:With that being said, I don't mind if people can remove boxers before pants (for now) seeing as that is just semantics, but I would like to prevent people from wearing pants and a skirt at the same time, or two pairs of pants, or two shirts.


the code setup~design would actually be the same, with only a tiny change:

instead of using greater than or lesser than, you'd use equals, (and I slightly changed the order of one code line's Attributes for it to make more sense), see below

'wear' Verb~Command:

(we don't want to be stupid, putting on two underwears~panties, lolololol. I actually have a super funny real story related somewhat to this... hehe)

<object name="underwear_1">
<attr name="layer" type="int">0</attr>
</object>

<object name="underwear_2">
<attr name="layer" type="int">0</attr>
</object>

currently wearing: player.waist = underwear_1

if (underwear_2.layer = player.waist.layer) {
msg ("No no no, you really do not want to put on a second underwear over the underwear you're already wearing!")
} else {
player.waist = underwear_2
msg ("You wear the underwear_2.")
}

HegemonKhan
neonayon wrote:As for this...

"hk"

object.alias = GetDisplayAlias (example, see below: shirt_1) + " (worn)"

I follow that so far...
Type: Object
Name: plain_black_shirt
Alias: Plain Black Shirt

<object name="shirt_1">
<alias>shirt</alias>
</object>



^--- which is that.

So for the 'GetDisplayAlias()' Function....I'm not sure how to access that. Do I view Filter, Show Library Elements and find it there, or is it found in the object attributes? once I find it, I can follow this more clearly.



I've no idea where or if it can be found in the GUI~Editor...

what you can do however in the GUI~Editor (an example):

'shirt' Object -> 'Verb' Tab -> Add -> Name: wear -> (see below)

run as script -> add a~new script -> variables -> 'set a variable or attribute' Script -> (set it up as seen below)

set attribute player.alias = GetDisplayAlias (shirt) + " (worn)"

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

though in full, you would want this, an example:

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

(Object Name: player)
Attribute Name: Feet_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Feet

(Object Name: player)
Attribute Name: Head_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Head

(Object Name: player)
Attribute Name: Chest_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Chest

(Object Name: player)
Attribute Name: Pelvis_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Pelvis

(Object Name: player)
Attribute Name: Shoulders_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Shoulders

(Object Name: player)
Attribute Name: Legs_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Legs

(Object Name: player)
Attribute Name: Right_Hand_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Right_Hand

(Object Name: player)
Attribute Name: Left_Hand_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Left_Hand

(Object Name: player)
Attribute Name: Ears_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Ears

(Object Name: player)
Attribute Name: Fingers_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Fingers

(Object Name: player)
Attribute Name: Neck_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Neck

'player' Player Object -> 'Objects' Tab -> Add -> (see below)

Object Name: Naked_Feet
Object Name: Naked_Head
Object Name: Naked_Chest // I'm combining your 'chest' and 'inner chest', but you can keep them separated if you want
Object Name: Naked_Pelvis
Object Name: Naked_Shoulders
Object Name: Naked_Legs
Object Name: Naked_Right_Hand
Object Name: Naked_Left_Hand
Object Name: Naked_Ears
Object Name: Naked_Fingers
Object Name: Naked_Neck

(also: give all of these Objects, the same alias of 'naked' under the 'setup' Tab, I think... lol)

(also: make these Objects, so you can't 'drop' them, make sure the 'drop' checkbox is not checked in, forgot what Tab this option is in... sighs)

'using each of the naked Objects above' Object -> 'Attributes' Tab -> Attributes -> Add -> (see below, repeat as needed)

(Object Name: Naked_Feet)
Attribute Name: Layer
Attribute Type: int
Attribute Value: 0

(Object Name: Naked_Head)
Attribute Name: Layer
Attribute Type: int
Attribute Value: 0

etc etc etc naked objects

'room' Room Object -> 'Objects' Tab -> Add -> Name: shirt

'shirt' Object -> 'Attributes' Tab -> Attributes -> Add -> (see below, repeat as needed)

(Object Name: shirt)
Attribute Name: Layer
Attribute Type: int
Attribute Value: 2

(Object name: shirt)
Attribute Name: Slot
Attribute Type: string
Attribute Value: chest

'shirt' Object -> 'Verb' Tab -> Add -> Name: wear

(ach, this is a lot of work and I'm getting tired... can't think straight anymore, lol)

(I'll get back to this... these Verbs are going to use 'if' Scripts and the 'add~remove list items', as our player's 'slot' Attributes are Objectlists. This is a bit of complex scripting, which I need to have a clear head on, as it's even harder in doing it as a step by step guide via the GUI~Editor, laughs)

HegemonKhan
oh, if you're unfamiliar with the concept of equipment~clothing~bodypart slots, here's an example (using Diablo 2 game):

http://classic.battle.net/images/battle ... ling01.jpg

now, we're trying to do the same thing with Quest, via Attributes (as quest is a text adventure game, not a 3d world movement graphical game, lol).

notice how in Diablo 2, you can only have one Object per slot.

You said want to be able to have multiple Objects (which we'll be via a 'layer' Integer Attribute) per slot (example of chest slot): naked<undershirt<shirt<jacket. This is quite more complex, but hey, why not, jump into it, hehe :D (if you want to learn to swim, jump into the deep end of the swimming pool! swim or drown~die, muwahaha!)

Anonynn
(Object Name: player)
Attribute Name: Fingers_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Fingers

^--- just curious

Attribute Type: objectlist

^---- did you mean "object" between stringlist and command pattern? And do I make the object "player"?

I'm still working on everything else you wrote. I also added both you and Pixie in the "thanks" page of my game too!

The Pixie
HegemonKhan wrote:oh, if you're unfamiliar with the concept of equipment~clothing~bodypart slots, here's an example (using Diablo 2 game):

http://classic.battle.net/images/battle ... ling01.jpg

now, we're trying to do the same thing with Quest, via Attributes (as quest is a text adventure game, not a 3d world movement graphical game, lol).

notice how in Diablo 2, you can only have one Object per slot.

You said want to be able to have multiple Objects (which we'll be via a 'layer' Integer Attribute) per slot (example of chest slot): naked<undershirt<shirt<jacket. This is quite more complex, but hey, why not, jump into it, hehe :D (if you want to learn to swim, jump into the deep end of the swimming pool! swim or drown~die, muwahaha!)

Don't show them that! They'll want a status pane like that next.

HegemonKhan
Neonayon wrote:(Object Name: player)
Attribute Name: Fingers_Slot
Attribute Type: objectlist
Attribute Value (add object): Naked_Fingers

^--- just curious

Attribute Type: objectlist

^---- did you mean "object" between stringlist and command pattern? And do I make the object "player"?

I'm still working on everything else you wrote. I also added both you and Pixie in the "thanks" page of my game too!


I'm not quite sure what you're asking about... but...

we're giving (adding to) the 'player' Player Object: Objectlist Attributes, as this allows the Attribute to hold multiple Objects at the same time:

player.chest_slot_objectlist_attribute = split ("undershirt;shirt;jacket", ";")

whereas, with just using Object Attributes, it can only hold a single object at a time:

player.chest_slot_object_attribute = shirt

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

or another example:

hk.favorite_food = pizza

this is nice, but what if I want the Attribute to hold more than one favorite food ???

then I got to use a List Attribute (the concept of a list is more than 1 item. if you need your husband to get 1 thing from the store, you just tell him what to get, but if you need multiple things from the store, you better give him a list of those things, or he's going to mess up, as guys don't have as good a memory, in general, as do females):

hk.favorite_foods = split ("bacon;pizza;hamburger;pasta;ice cream;chocolate;candy", ";")

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

and the default~initially (and~or for when unequiping too) held Object is my 'naked' Object, as a List Attribute acts a bit funny without any Object in it... I don't really understand this built-in stuff that well (maybe Pixie knows of a way ~ or how to deal with this 'funny business' with List Attributes), so my way of dealing with this 'funny business' is to have some default Object, in this case a 'naked ~ (no clothing)' Object.

----------

Pixie wrote:Don't show them that! They'll want a status pane like that next.


laughs... that's beyond my ability, I still haven't even learned to work with the UI code stuff, nor html, never done window box positioning code + formating code + etc, either. Chuckles, we know what the next library people now expect of you, Pixie, due to me showing that d2 equipment screen link, laughs (just kiding). if anyone does want that, jsut tell them that HK said: this is a text game! if you want it to be more graphical, then you got to do it yourself! Pixie is busy enough already helping everyone with everything!

Anonynn
The Pixie wrote:

"HegemonKhan"

oh, if you're unfamiliar with the concept of equipment~clothing~bodypart slots, here's an example (using Diablo 2 game):

http://classic.battle.net/images/battle ... ling01.jpg

now, we're trying to do the same thing with Quest, via Attributes (as quest is a text adventure game, not a 3d world movement graphical game, lol).

notice how in Diablo 2, you can only have one Object per slot.

You said want to be able to have multiple Objects (which we'll be via a 'layer' Integer Attribute) per slot (example of chest slot): naked<undershirt<shirt<jacket. This is quite more complex, but hey, why not, jump into it, hehe :D (if you want to learn to swim, jump into the deep end of the swimming pool! swim or drown~die, muwahaha!)


Don't show them that! They'll want a status pane like that next.



LOL That would be sweet! How do we do that???? Kidding.

HegemonKhan wrote:I'm not quite sure what you're asking about... but...


When you click 'Attributes', 'Add' --- the list of attribute types appears...such as..

String
Boolean
Integer
Double
Script
Stringlist
Object
Command pattern
String Dictionary
Script Dictionary
Null

HegemonKhan wrote:(Object Name: player)
Attribute Name: Fingers_Slot
Attribute Type: objectlist <------- so I'm wondering, which of those types objectlist it is.
Attribute Value (add object): Naked_Fingers

HegemonKhan
My posts are very unclear and haphazard, as it's hard to do a guide as posts for me. It might be better if I make a sample game for you, as that would be easier for me to do, than trying to do it as coherant posts, which I fail miserably at. And then with that sample game, I can help you create the same system for your own game. I think this strategy would work better for me, to help you. As I'm really bad with using posts to help, unlike Pixie and Jay.

HegemonKhan
hmm... that's weird... no 'objectlist' Attribute to choose (no wonder your confusion!). Sorry about that... I really need to learn the GUI~Editor better, laughs.

Um... I'm guessing that you can probably just use the 'stringlist' Attribute, as they really are the same thing, with the only difference being:

for it to be an objectlist, the list attribute's values must be actual Objects existing in the game, whereas for it to be a stringlist, its values are just text.

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

example:

in GUI~Editor: stringlist -> add -> apple, berry, banana

------ VS --------

in GUI~Editor: stringlist -> add -> apple, berry, banana

'room' Object -> 'object' tab -> add -> (see below)

Object Name: apple
Object Name: berry
Object Name: banana

Anonynn
HegemonKhan wrote:My posts are very unclear and haphazard, as it's hard to do a guide as posts for me. It might be better if I make a sample game for you, as that would be easier for me to do, than trying to do it as coherant posts, which I fail miserably at. And then with that sample game, I can help you create the same system for your own game. I think this strategy would work better for me, to help you. As I'm really bad with using posts to help, unlike Pixie and Jay.


Actually, you're pretty clear thus far. That was the only part that I couldn't follow lol. I should be all caught up in a couple of minutes! :)


EDIT

Okay! So I'm all caught up with the work you did last night (which is greatly appreciated by the way).

So you mentioned the verbs next? Or do we work on the stringlist?

HegemonKhan
Just been looking at how to do an 'Objectlist' Attribute in the GUI~Editor...

choosing 'stringlist' for your Attribute Type, doesn't work.

as far as I can tell, you can't 'add' an Objectlist Attribute in the GUI~Editor... (no idea why, argh)

so, either:

you got to set up your Objectlist Attributes via through scripting (using the GUI~Editor): run as script -> 'add a~new script' circle buttons

or, you got to just directly code in your Objectlist Attributes (not using the GUI~Editor: using code view ~ in-code)

Anonynn
HegemonKhan wrote:Just been looking at how to do an 'Objectlist' Attribute in the GUI~Editor...

choosing 'stringlist' for your Attribute Type, doesn't work.

as far as I can tell, you can't 'add' an Objectlist Attribute in the GUI~Editor... (no idea why, argh)

so, either:

you got to set up your Objectlist Attributes via through scripting (using the GUI~Editor): run as script -> 'add a~new script' circle buttons

or, you got to just directly code in your Objectlist Attributes (not using the GUI~Editor: using code view ~ in-code)


Sounds fine to me, no worries! I went back and deleted the stringlist, and changed the player_object: naked_feet child objects back into scripts (instead of stringlists). So I'm with you so far on that. What kind of script do I add?

HegemonKhan
actually (sorry, as I mislead you with not explaining what I said in that previous post), you need to just delete those Attributes entirely, don't change them to Attrbute Type: scripts. DELETE them, delete these Attributes.

what I should have explained:

to create the 'slot' Objectlist Attributes for the 'player' Player Object, we'll have to use the 'start' Script in the 'game' Game Object, and it's a bit complex, so we're not going to set it up right now.

or, if you're confortable with writing in code, into your game code, then we can do it that way too (which will be much easier~simplier actually, lol).

----

I'm working on a sample game for you, it'll take a bit of time, as this is about at the limit of my ability, lol. I have to really think about it, and test it to get everything working.

-----

in the meantime... you can actually just literally use Chase's Wearables Library, setting up your clothing in the GUI~Editor, using the new 'Wearables' Tab (from Chase's Library) with your clothing Objects. Ask if you need help with implementing Chase's Library into your game, and~or with any part of Chase's Library's setup options~etc. (though if you also got Pixie's Library in your game... we'll need to deal with any conflicts)

(my sample game is really just a simplier but inferior re-creation in my own limited ability of Chase's Wearables Library, lol. So, I'm kinda re-inventing the wheel, in hopes that my way, my clothing system, is more simple to understand than Chase's, lol)

Anonynn
HegemonKhan wrote:actually (sorry, as I mislead you with not explaining what I said in that previous post), you need to just delete those Attributes entirely, don't change them to Attrbute Type: scripts. DELETE them, delete these Attributes.

what I should have explained:

to create the 'slot' Objectlist Attributes for the 'player' Player Object, we'll have to use the 'start' Script in the 'game' Game Object, and it's a bit complex, so we're not going to set it up right now.

or, if you're confortable with writing in code, into your game code, then we can do it that way too (which will be much easier~simplier actually, lol).

----

I'm working on a sample game for you, it'll take a bit of time, as this is about at the limit of my ability, lol. I have to really think about it, and test it to get everything working.

-----

in the meantime... you can actually just literally use Chase's Wearables Library, setting up your clothing in the GUI~Editor, using the new 'Wearables' Tab (from Chase's Library) with your clothing Objects. Ask if you need help with implementing Chase's Library into your game, and~or with any part of Chase's Library's setup options~etc. (though if you also got Pixie's Library in your game... we'll need to deal with any conflicts)

(my sample game is really just a simplier but inferior re-creation in my own limited ability of Chase's Wearables Library, lol. So, I'm kinda re-inventing the wheel, in hopes that my way, my clothing system, is more simple to understand than Chase's, lol)


Oh, okay then. I deleted all the attributes entirely, but I kept the player child objects like Naked_Feet, for example until noted otherwise. And thank you for working a sample game. I cannot use Chase's "Wearables" library though because of that error that was preventing all of the clothing from being worn but it's good to have multiple options for people to chose from anyway! If we can design a new clothing library from this then I think it's doing Quest a service!

I'll keep working on the game in the meantime while you work on it!

PS I wouldn't mind learning how to do it in code either! But I'll need a lot of walkthroughs!

HegemonKhan
creating an Objectlist Attribute in code is very easy (right click on your game file and open your game file with notepad, wordpad, notepad++, text editor, etc, to ensure you're seeing your full~entire game code):

for example, giving an Objectlist Attribute to the 'player' Player Object:

<Element_name name="Attribute_name" type="Attribute_Type_name">object_1_name; object_2_name;etc</Element_name>

<attr name="xxx" type="objectlist">xxx1;xxx2;xxx3;etc</attr>

example:

<attr name="family" type="objectist">mom;dad;sister;brother;son;daughter</attr>

-----
'attr' is used, like 'int', as Alex didn't want us having to write out 'attribute', nor 'integer', lol.
-----

<object name="player">
<attr name="chest" type="objectlist">undershirt;shirt;jacket</attr>
<attr name="waist" type="objectlist">boxers;pants;belt</attr>
<attr name="feet" type="objectlist">socks;shoes</attr>
<attr name="face" type="objectlist">glasses</attr>
<attr name="pets" type="objectlist">dog;cat;bunny;bird;snake;tarantula;lizard;hamster;mouse</attr>
</object>


-------

and here is how a (horizontal uses this special type: simplestringlist, whereas vertical uses type: stringlist) Stringlist Attribute looks like for comparison:

<attr name="pets" type="simplestringlist">dog;cat;bunny;bird;snake;tarantula;lizard;hamster;mouse</attr>

or vertical (this is good if your individual Values are long (sentences), otherwise, if the individual Values are just single words, as seen in my examples, the horizontal form is probably more preferred, at least I prefer it, anyways):

<attr name="pets" type="stringlist">
<value>dog</value>
<value>cat</value>
<value>bunny</value>
// etc Values
</attr>


------

I don't know if an Objectlist Attribute has a vertical form or not.

Anonynn

"HegemonKhan"]creating an Objectlist Attribute in code is very easy (right click on your game file and open your game file with notepad, wordpad, notepad++, text editor, etc, to ensure you're seeing your full~entire game code)



See this is easy to follow...I got Notepad++ because you suggested it several months ago.....

but..


for example, giving an Objectlist Attribute to the 'player' Player Object:

<Element_name name="Attribute_name" type="Attribute_Type_name">object_1_name; object_2_name;etc</Element_name>

<attr name="xxx" type="objectlist">xxx1;xxx2;xxx3;etc</attr>

example:

<attr name="family" type="objectist">mom;dad;sister;brother;son;daughter</attr>

-----
'attr' is used, like 'int', as Alex didn't want us having to write out 'attribute', nor 'integer', lol.
-----

<object name="player">
<attr name="chest" type="objectlist">undershirt;shirt;jacket</attr>
<attr name="waist" type="objectlist">boxers;pants;belt</attr>
<attr name="feet" type="objectlist">socks;shoes</attr>
<attr name="face" type="objectlist">glasses</attr>
<attr name="pets" type="objectlist">dog;cat;bunny;bird;snake;tarantula;lizard;hamster;mouse</attr>
</object>



This is where coding becomes difficult because I already have a bunch of files and codes in my game since I'm not starting completely over. So the question I would have is...where do I put this line of code in my game?

If I could figure out where to place stuff, I wouldn't be nearly as scared to edit in code, but if I get something wrong, the game will crash and Quest wouldn't open it anymore, and I'd have to seek it out in the editor of where it went wrong, how to fix it, or remove it to restore all that work back to working order.

The Pixie
Neonayon wrote:This is where coding becomes difficult because I already have a bunch of files and codes in my game since I'm not starting completely over. So the question I would have is...where do I put this line of code in my game?

If I could figure out where to place stuff, I wouldn't be nearly as scared to edit in code, but if I get something wrong, the game will crash and Quest wouldn't open it anymore, and I'd have to seek it out in the editor of where it went wrong, how to fix it, or remove it to restore all that work back to working order.

Quest has two types of code, XML (the stuff with all the angle brackets, < and >) and scripts. I would advise leaving Quest to sort out the XML. As you say, if you get it wrong, Quest will not load and it can be very tricky to track down the error. Create objects and give them attributes through the GUI and it should be safe.

Script code is safer as at least your game will load if you mess it up, and you can isolate any error to a fair small area. I think editing script in code is easier, for one thing it is more compact so you can see it better.

If you are editing stuff in libraries, of course, you do not get the choice.

Have said all that, the GUI does not support object lists... So you will have to go in code. This bit will already be there somewhere, so do a search for "player":
<object name="player">

You can insert the next five lines directly after that. Do not include the last line, the object end tag, as that will already be there too.

HegemonKhan
neonayon wrote:This is where coding becomes difficult because I already have a bunch of files and codes in my game since I'm not starting completely over. So the question I would have is...where do I put this line of code in my game?

If I could figure out where to place stuff, I wouldn't be nearly as scared to edit in code, but if I get something wrong, the game will crash and Quest wouldn't open it anymore, and I'd have to seek it out in the editor of where it went wrong, how to fix it, or remove it to restore all that work back to working order.


ah, thanks, this helps me a lot!

it's always a very good policy to make at least one backup (make a second save~game file: give it a different name), but still, anything you do in the GUI~Editor and~or within your game file, is fixable, even if your game file won't open up into the GUI~Editor or not be able to play, as we~you can still open up the game file (notepad++, notepad, word pad, etc), and fix the code errors for it to work again. So, don't get scared by the error messages and especially not if your game file won't go into the GUI~Editor, or won't play, as it's just a code issue that you caused (usually some stupid typo or missing character or mispelling or etc something stupid and small, ARGH, lol), which we can still get into your game file's code (open game file with a text software: notepad,wordpad,notepad++,etc), and fix it up, so it works again. So don't worry! :D (someone has asked this very question: they're unable to get into the GUI~Editor or play with their game file, Jay and I will have his~her game file back working in no time, hehe. here's the link: http://ifanswers.com/841/is-there-a-kno ... unctioning , err nvm, I'm hallucinating... they can still get into their game, lol, just just have an issue with their 'say' Command not working... wow, HK is~was really hallucinating... haha. oopsy. errr 2.0, lol. I wasn't hallucinating... I just got confused~wasn't paying attention, and looked at the wrong question. here's the correct link: http://ifanswers.com/823/quest-game-wont-open-for-edit )

(though, I'm not sure if you change the underlying game code stuff, if that will mess up your game file or not. Have to ask Pixie about that. Quest is safe though through the GUI~EDitor, as alex has it so that it forces you to 'copy' before you change the underlying code, thus preserving the underlying code and quest from being messed up. But I don't know how it works with your game file itself, if it can be fixed up or not)

now if you actually go into the quest's folders 'core' files, than you're directly accessing the quest engine ~underlying code files, and messing them up will make quest unusable (you'd have to re-download and install quest again). So, you should not ever do this, unless you're a good programmer, and are able to do so without messing anything up, and creating your own entire engine (which quest enables ~ it's very well built~powerful, if you're a good programmer, anyways), lol.

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

okay... here we go... lol

first of all, code can be written vertically and~or horizontally. Hackers (and expert~top programmers) can read+write+troubleshoot code horizontally, but especially for us code noobs, vertical is so much easier to read, write, troubleshoot, and work with, as can be seen, using the default new game code:

for short code (like for most types of Attributes), we can manage horizontal, and thus we use it, but otherwise, vertical is much better for us.

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

(I haven't tested if quest supports everything as horizontal code... I should go test it, for actual fun, I'm interested if it can, hehe)

<asl version="550"><include ref="English.aslx" /><include ref="Core.aslx" /><game name="xxx"><gameid>xxx</gameid><version>1.0</version><firstpublished>2015</firstpublished></game><object name="room"><inherit name="editor_room"><object name="player"><inherit name="editor_object" /><inherit name="editor_player" /></object></object></asl>


YUCK! This is totally unreadable for me (though a hacker or expert~top programmer can read this as if they were reading a book... crazy, huh, sighs)

Hackers (or expert~top programmers) like it due to it being so much more concise, only 3 lines! 3 lines! lol.

(and if you wanted~needed to print out code, you're saving A LITERAL TON of paper to print out horizontal code, compared to vertical code: most OS', like win xp~7~8, the apple OS', and etc OS', are like at least 50 million lines of code! And that's expert~efficient code, and probably it is already done as horizontal code too... that's A LOT of characters, A LOT of typing... lol)

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

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


ah, this is so much better, I can understand this stuff now! (and hopefully I can tech you to be able to also, hehe)

but wow... this is a lot more than just 3 lines!

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

<asl version="550">

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

<game name="xxx">

<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>

</game>

<object name="room">

<inherit name="editor_room">

<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>

</object>

</asl>


and maybe this is an 'ah, much better', for you, hehe :D

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

as Pixie explained technically, there's two types of code. I'm going to describe it untechnically, in a way that makes sense for me, and hopefully it will make sense for you too.

one type of code, is what I call the 'creation tag code blocks~lines' (or as Pixie technically explained: the 'XML' code), these are the 'physical things' in your code. Besides the default 'physical things' (like the special 'game' Game Object, the 'player' Player Object, the 'room' Room Object, and the two libraries: 'English.aslx' and 'Core.aslx', which the engine has already added into your game for you), these are the exact same things as when you do the 'add -> Object~Exit~Verb~Function~Command~Attribute~Object Type~etc' in the GUI~Editor (in fact, go ahead and try it out: add an Object in the GUI~Editor, and then look at your game code, and find its 'creation tag code block~line' that is now added to your game code!, hehe). Any, block or line, that has the '<>' tags is our 'physical things', our 'creation tag code block~line', as seen below:

<xxx xxx="xxx">
xxx
</xxx>

<xxx>xxx</xxx>

<xxx xxx="xxx">xxx</xxx>

<xxx xxx="xxx" />

~OR, a bit more descriptively for you ~

<xxx xxx="xxx">
content
</xxx>

<xxx>content</xxx>
// this is also a shortened form of specifically~only: String Attributes

<xxx xxx="xxx">content</xxx>
// this is the full form (aka the normal) syntax

<xxx xxx="xxx" />
// this is understood content (and thus has this unique shortened form seen above): its a Boolean Attribute with the Value of true


so try to see the code as these 'creation tag code blocks' and creation tag code lines', for example:

you want to be able to see this:

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


as this (think of these 'creation tag code blocks' and 'creation tag code lines' as our 'paragraphs' and 'sentences' of normal reading~english language):

<asl version="550">
xxx
</asl>

<game name="xxx">
xxx
</game>

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

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

<include ref="English.aslx" />

<include ref="Core.aslx" />

<gameid>xxx</gameid>

<version>1.0</version

<firstpublishd>2015</firstpublished>

<inherit name="editor_room" />

<inherit name="editor_object" />

<inherit name="editor_player" />


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

now, we need to understand placement:

*******************
think of it as like an outline:

(except an outline doesn't use ending~bottom lines, like code does)

(my '-> arrow' is just my way of representing~showing indenting, so hopefully don't get confused by them lol)

I. xxx
-> A. xxx
->-> 1. xxx
-> B. xxx
II. xxx
-> A. xxx
->-> 1. xxx
-> B.

HK
-> pants_with_pockets
->-> wallet
->->-> $1.00
Neonayon (hehe, lol)
-> purse
->-> make-up
->-> mascara
->-> mirror
->-> $100.00
->-> pills
->-> gum
->-> mace ~ pepper spray
->-> tazer ~ gun

C:\ (C Drive)
-> programs
->-> quest
********************


<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


<asl version="555"> // beginning~top code line of the 'asl' block
xxx
</asl> // ending~bottom code line of the 'asl' block


notice how every block~line is actually inside (via being INDENTED~'nested' over and between the top~start an bottom~end lines of the 'asl' block) of the 'asl' block?

that is because the 'asl' creation tag block IS YOUR GAME, thus everything must be within (indented over and between) it!

<asl version="550"
// your mass of game code
</asl>


such as the tiny mass (lol) of a new~default game's code:

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


----------

so, is this starting to make sense to you now? Are you starting to see~understand its structure, being able to start to be able to read and write it now?

let's see, with some tests for you... hehe (they're going to be unfair, you're probably not going to get them right, but hopefully they'll teach you, the answers ~ the why~how of the answers, that I'll give, and along with the explanation too)

I want to add an 'orc' Object to the 'room' Room Object, so which is~are correct (can be no right answers, all right answers, or whatever other amount~combination of right answers) ?

I want you to give your answers for 1-7, telling why you think they're correct or incorrect, okay ??? I want to get you thinking about this, as it'll get you to be learning it quickly, as I'm very impatient, lol.

1.
<object name="orc">
</object>
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


2.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<object name="orc">
</object>
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


3.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="orc">
</object>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


4.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="orc">
</object>
</object>
</asl>


5.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="orc">
</object>
</asl>


6.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="orc">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</object>
</asl>


7.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<object name="orc">
</object>
</object>
</object>
</asl>


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

now I want you to:

add this Integer Attribute to the 'player' Player Object:

<attr name="strength" type="int">58</attr>

and this Integer Attribute to the 'game' Game Object:

<attr name="game_state" type="int">0</attr>

and this Script Attribute to the 'game' Game Object:

<start type="script">
msg ("I'm learning to read and write code! HK is so awesome!")
</start>


and add this Script Attribute to the 'player' Player Object:

<pov_look type="script">
msg ("Neonayon is a very pretty and nice~sweet girl, who loves nekos, and she probably has 20 pet cats living with her, yikes!")
</pov>


all into this code:

[code]<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>

HegemonKhan
the other type of code:

is what I call 'scripting', this is your ACTION~EVENT code blocks~lines, which are *NOT* encased in the '<>' tags. In the GUI~Editor, this is your 'run as script -> add a~new script' circle buttons. However, scripting MUST be within certain creation code tag blocks.

---------

here's a good example:

<function name="name_function">
msg ("What is your name?")
get input {
name_variable = ToString (result)
msg ("Your name is {name_variable}.")
show menu ("Is this indeed your name?, split ("yes;no", ";"), false) {
if (result = "yes") {
player.alias = name_variable
msg ("Ah, so {player.alias} is your name. Now I got another question for you...")
} else if (result ="no") {
msg ("No, hmm, then let me ask you again...")
name_function
}
}
}
</function>


the 'creation code tag block' ( 'physical thing' ) is this:

<function name="name_function">
</function>


the 'scripting' (ACTION~EVENT code blocks~lines) is~are this~these:

msg ("What is your name?")
get input {
name_variable = ToString (result)
msg ("Your name is {name_variable}.")
show menu ("Is this indeed your name?, split ("yes;no", ";"), false) {
if (result = "yes") {
player.alias = name_variable
msg ("Ah, so {player.alias} is your name. Now I got another question for you...")
} else if (result ="no") {
msg ("No, hmm, then let me ask you again...")
name_function
}
}
}

HegemonKhan
if interested, you can view the code for any web~browser page, via:

if you got a pc, open up whatever browser you want~have (IE, firefox, chrome, opera, safari, etc) and right click on the web~browser page, select 'view source'

if you got an apple, open up safari, select 'view' (its one of the categories of the bar at the top of the screen), and then select 'vew source'

see if you're starting to understand code structure a bit, and kinda understand the html (web~browser page) code. It should be somewhat readable now.

(each language, and there's A LOT OF THEM (you can see that in the 'notepad++' software you downloaded~installed), is different, especially the syntax and format, but coding is coding, so they all have a similiar structure, and use the same fundamental concepts: VARIABLES~Attributes and their types, 'if' and etc Scripts, Functions~Methods, global vs local, Object Types~Classes~Groups, and etc concepts~stuff)

Anonynn


3.

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="orc">
</object>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


6.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<gameid>xxx</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room">
<object name="orc">
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</object>
</asl>



^---- these two looked the most correct to me, but I wasn't sure which one was.

Thanks for all of that! That must have taken forever to write out. How is your mini-clothing game coming along?

The Pixie wrote:
If you are editing stuff in libraries, of course, you do not get the choice.

Have said all that, the GUI does not support object lists... So you will have to go in code. This bit will already be there somewhere, so do a search for "player":

Code: Select all
<object name="player">

You can insert the next five lines directly after that. Do not include the last line, the object end tag, as that will already be there too.


Appreciate it, Pixie

HegemonKhan
#6 is wrong, because of the 'orc' tag code ending line:

see the bottom ' </object> ' code line below

-> <object name="room">
->-> <inherit name="editor_room">
->-> <object name="orc">
->-> <object name="player">
->->-> <inherit name="editor_object" />
->->-> <inherit name="editor_player" />
->-> </object>
->-> </object> // the 'orc' tag ending line
-> </object>

because the 'orc' ending tag line is on the other side of the SAME INDENT LEVEL (my '->' arrow symbols on the left represent the indenting levels) 'player' tag block, it stands by itself, which means that there's no 'tag' ending line for the 'orc' tag block, and there's this ending block (what was suppose to be the 'orc' ending tag line) all by itself, which is a huge error for the quest engine.

let me try to explain via as what an outline would look like as a 'code outline' :

I. <asl version="550">
A. <include ref="English.aslx" />
B. <include ref="Core.aslx" />
C. <game name="xxx">
1. <gameid>xxx</gameid>
2. <version>1.0</version>
3. <firstpublished>2015</firstpublished>
C. </game>
D. <object name="room">
1. <inherit name="editor_room">
2. <object name="orc">
3. <object name="player">
a. <inherit name="editor_object" />
b. <inherit name="editor_player" />
3. </object>
2. </object>
D. </object>
I. </asl>


do you see how this would be wrong, via me showing it as a 'code outline' ???

-----

this can be made functional, by doing this:

-> <object name="room">
->-> <inherit name="editor_room">
->-> <object name="orc">
->->-> <object name="player">
->->->-> <inherit name="editor_object" />
->->->-> <inherit name="editor_player" />
->->-> </object>
->-> </object>
-> </object>

HOWEVER, now you got the 'player' Player Object inside~within (held by ~ added to) the 'orc' Object, which is incorrect, as I never said I wanted for this to be done.

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

using color is actually pretty helpful to see the placement structure, so let me just show the 'new game code' in color for you to see and maybe understand it better:

(hopefully I can figure out enough color-codes, lol)

(I have to use my '->' because the 'code box code' doesn't allow for coloring code, and so to show the indenting, I need to use my '->', so bare with it)

(since I can't do stripped~rainbow colors, I'm using black. The black is both their own individual creation code tag lines, but are also apart of the block that they're held within)

(and technically, everything between the green, should be black as well, as it is all within the green 'asl' block)

(and technically, the blue 'player' block should be black as it is within the red 'room' block)

<asl version="550">
-> <include ref="English.aslx" />
-> <include ref="Core.aslx" />
-> <game name="xxx">
->-> <gameid>xxx</gameid>
->-> <version>1.0</version>
->-> <firstpublished>2015</firstpublished>
-> </game>
-> <object name="room">
->-> <inherit name="editor_room">
->-> <object name="player">
->->-> <inherit name="editor_object" />
->->-> <inherit name="editor_player" />
->-> </object>
-> </object>
</asl>

--------

(I got to still talk about the other answers too... so this post isn't done yet)

HegemonKhan
I'll get to explaining the other answers, and I'm still working on the sample game (troubleshooting... it'll take a while, as this is actually my first time trying to make an equipment~clothing system, especially as a playable~functional sample game).

But right now I got school classes I need to register for, so I'll be busy this week with that first. So, this quest stuff takes a back seat until I get registered into the school classes and etc stuff.

Anonynn
That sounds fine. I just got back from camping and didn't have cell-reception for a couple of days (or email) so I couldn't respond until now. Good luck on registering for your classes. I can't wait to see the sample game.

magano
Wow now that can cause headaches for me...
I've been using Quest for years and never EVER touched the code view until today
Oh and one thing i would like to point out from Pixie's library... the spells are really useless for me in giving enough damage because the weapons are more effective and deal greater damage than a spell... I figured that you're just modifying what the documentation told you? Anyway thanks for the libraries

Anonynn
I'm wondering if I should try to find help on the numerous other parts of the project while I wait for HK to come back! Argh!

HegemonKhan
I'm still having trouble making an equipment system sample game for you, speaking of 'argh', laughs. I bit off a bit more than I can chew, I decided to ditch my first attempt at it, trying to start over from scratch. You might want to try to get help from others, as I'm struggling with this equipment stuff.

I'm trying, but equipment is still seemingly beyond my ability. I can do individual and simple parts of equipment coding... but I really have trouble trying to put together a system. This is where I'm really stuck in my code learning progression, sighs. Ya I get how the individual gears work and how to use them and etc, but when I try to make a clock, it takes more knowledge than just that basic individual gears knowledge, sighs. A clock truly is more than its parts, as it's a big complex system, whereas the gears are not, laughs.

Anonynn
HegemonKhan wrote:I'm still having trouble making an equipment system sample game for you, speaking of 'argh', laughs. I bit off a bit more than I can chew, I decided to ditch my first attempt at it, trying to start over from scratch. You might want to try to get help from others, as I'm struggling with this equipment stuff.

I'm trying, but equipment is still seemingly beyond my ability. I can do individual and simple parts of equipment coding... but I really have trouble trying to put together a system. This is where I'm really stuck in my code learning progression, sighs. Ya I get how the individual gears work and how to use them and etc, but when I try to make a clock, it takes more knowledge than just that basic individual gears knowledge, sighs. A clock truly is more than its parts, as it's a big complex system, whereas the gears are not, laughs.


I'm wondering if you got all the pieces in place, if Pixie or another programmer would just basically connect the dots for you? Ya know?

I still have a ton of things to work on in the meantime...

- Hair/Nail growth (probably turn-scripts)
- The Transformation Item rewrites to incorporate the new body parts the POV has (that you and I worked on)
- And one other thing...(which is also a turn-script)

HegemonKhan
I'm stuck in trying to design an equipment system for using multiple Objectlist Attributes, along with 'layers' and 'slots' for the equipment Objects (a far too complex~advanced design for my limited abilities). In my initial attempt, I again ran into the same issue I'm still having trouble with, which is 'dynamic usage of function names', as I try to name~describe it, lol. So, I started over, but I've been busy with other stuff, so haven't made much new attempted progress, sighs.

******************
example of the above design system I'm failing to code (using equipment~armor~weapons + clothing), as quasi-pseudo code:

(if the Object is in, added to, the Objectlist Attributes, it is 'equipped' on you)

player.chest_objectlist_attribute = shirt (layer 0), some type of energy absorption material over-shirt (layer 1), plate mail (layer 2)

player.waist_objectlist_attribute = undies (layer 0), some type of energy absorption material pants (layer 1), belt to hold up the energy absoption material (layer 2), plate armor (layer 3)
******************

Chase's and Pixie's Libraries are so nice, while I struggle so much with my own design system with equipment. Their libraries make it look so easy, but it's not, at last not for me. The problem is that even if I am finally successful at a sample game of a design~system for equipment, it's going to be so messy ~ ugly ~ poor, that why would you or anyone even want to see~use it, when you've~they got Pixie's and Chase's, both of which are really good, excellent, and concise, in quality.

I'm going to keep working on it, as I got the time, but try to get help from others, as this is still beyond my abilities (I had thought~hoped that I could do this stuff now, but am finding that I still can't yet do this level of stuff yet, sighs)

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

your hair~nail growth stuff (aka 'growth' ) can be done a bunch of different ways....

1. current length integer * growth multiplier integer

hair length: 6 inches
growth multiplier integer: 2 (this is a bit too high~big for a multiplier ~ see below, lol. 1.0 to 1.5 would probably be better ~ or google what is the real growth multiplier~integer of actual~real hair growth, lol)

6 * 2 = 12 inches as new hair length (foot long hair now!)
12 * 2 = 24 inches as new hair length (2 foot long hair now!)
24 * 2 = 48 inches as new hair length (we're just about getting into repunsel ~ disney princess hair 'dragging on the floor' length, lol)
etc etc etc

2. current length integer + hair growth integer

hair length: 6 inches
hair growth: hair length + 2

6+2=8
8+2=10
10+2=12
etc etc etc

3. etc etc etc ways...

-------

as for the triggers... there's many ways as well...

the easiest being just directly using a Turnscript (or Timer), and~or using another Integer Attribute that is increasing (such as a 'day' Integer Attribute, which your 'growth' uses ~ is based off of), which has a trigger (such as, again, a Turnscript or a Timer).

Anonynn
Hey Pixie, I came across this when running through the game and trying to equip another weapon after this code...

RemoveObject (rickety_machete)
player.equipped = "fist"
UpdateWeapon
ClearScreen


essentially it makes the space where the weapon is blank, instead of inputting "fist" again. So when I tried to have the character equip a new weapon, this error popped up.

Error running script: Error evaluating expression 'HasString(obj, "alias")': HasString function expected object parameter but was passed 'fist'

but only during the initial equip. If you unequip and requip this error doesn't pop up. I'm assuming it happens because the system recognizes "fist" as the default and without "fist" being there it gets confused.

Anyway to fix it?

HegemonKhan
I think... just remove the double quotes from your Attribute's Value:

change from:

player.equipped = "fist"

change to:

player.equipped = fist

----------

when you write~work in code and~or use the Scripts' [expression] options in the GUI~Editor, putting the double quotes on a Value, makes that Value a string, and thus makes the Attribute a String Attribute. And, likeless, by NOT putting double quotes on a Value, makes that Value an Object, and thus makes the Attribute an Object Attribute:

player.equipped = "fist" ----> a String Attribute, 'fist' is just a string, a word~text.

player.equipped = fist -----> an Object Attribute: 'fist' is an actual Object's name (that must exist within the game). Though, you're not actually moving~putting 'physically moving~placing' the Object into the Attribute as its Value, only the Object's name. Argh, sorry if this is confusing, it's hard to explain, lol. So, just ignore this... and remember for an Object Attributes' Values (Object's names), no double quotes on its Values.

as I'm guessing Pixie's system uses actual Objects, you have an actual 'fist' Object, so your 'player.equipped' Object Attribute must *NOT* have the double quotes on its Value, in other words, your Attribute syntax (in code), must be:

add object: Name: fist
add object: Name: claymore
add object: Name: kitchen_knife

player.equipped = fist
player.equipped = claymore
player.equpped = kitchen_knife

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

HOWEVER, if you're using the GUI~Editor to do this stuff, it does it for you, so you don't need to worry about using double quotes or not for your Attributes' Values (same thing with the 'msg' Script too ~ ya it gets really confusing and is a pain to explain these differences between using the GUI~Editor vs in-code. You just got to slowly starting remembering them, sighs. It's a pain).

Anonynn


I think... just remove the double quotes from your Attribute's Value:

change from:

player.equipped = "fist"

change to:

player.equipped = fist



Tried that. It didn't even take the old weapon out of the equip section, but with the qoutes it does, it just leaves the space blank though instead of returning the attribute or whatever to "fists".

Hm...any other thoughts?

The Pixie
It is fists not fist. You need to call UpdateWeapon afterwards to get everything sorted.
game.pov.equipped = fists
UpdateWeapon

Anonynn
The Pixie wrote:It is fists not fist. You need to call UpdateWeapon afterwards to get everything sorted.
game.pov.equipped = fists
UpdateWeapon


Thank you, Pixie! You're awesome.

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

Support

Forums