how to make an object wear able?
sasha2cool
17 Dec 2015, 02:38i wanted to make clothes for the player.. i tried making a wear verb and made the object move to the player. that made the player just hold it.
i was thinking about making the inventory tag (or whatever it should be referred to)
have like this - Coat (wearing)
but if i did that if i typed take coat the inventory tag would say that too
and i just want it to look like that when they wear it not take it and too hold it
i was thinking about making the inventory tag (or whatever it should be referred to)
have like this - Coat (wearing)
but if i did that if i typed take coat the inventory tag would say that too
and i just want it to look like that when they wear it not take it and too hold it
HegemonKhan
17 Dec 2015, 03:02there's 3 Libraries using equipment (equipment: weapons~armors~jewelry~clothing~etc):
Pixie's Combat Library
Chase's Wearables Library
Pertex' Combat Library
equipment is complex, not easy for noobs (like me), and also there's different ways~designs to implement equipment too, along with whether you want a simple equipment system or a complex equipment system.
--------
if you want to do it with having the inventory displaying: 'equipment_name' vs 'equipment_name (equipped)', the three guides~libraries above do this (well, at least Pixie's and Chase's ~ I've not looked at Pertex' Combat Library for a long long long time, lol).
the basic idea of it is this:
when you equip, you change the alias to display: equipment_name (equipped)
when you unequip, you change the alias to display: equipment_name
which is done via:
http://docs.textadventures.co.uk/quest/ ... alias.html
for example, to equip:
sword_1.alias = "katana" // this is the current 'display alias', the non-equipped alias
sword_1.equipped = false
// our boolean, set to initially being unequiped (sword_1.equipped = false), but for actually applying it's equipped state, we need to reset it to being: sword_1.equipped = true, to be able to apply it whatever scripts in your game (such as combat 'attack' )
we need to first store~save this non-equipped alias (for when we unequip it), via, for example:
sword_1.old_alias = sword_1.alias
// sword_1.old_alias = "katana"
and now, we can give the sword, its new equipped alias, via, for example:
sword_1.alias = GetDisplayAlias (sword_1) + " (equipped)"
// CONCEPTUALLY ONLY:
// sword_1.alias = {GetDisplayAlias (sword_1)} + " (equipped)"
// sword_1.alias = {katana} + (equipped)
// sword_1.alias = katana (equipped)
sword_1.equipped = true // boolean's are an easy way to tell quest whether something is switched on or switched off, and we're re-setting it to being 'true' (equipped state), which we can use (via 'if' checking for) this, for doing our various scripts in your game.
and, then when we want to unequip the sword, we simply re-set it's alias back to the stored~saved non-equipped alias:
sword_1.alias = sword_1.old_alias
// sword_1.alias = "katana"
sword_1.equipped = false // we're re-setting it to be 'false' (unequipped state)
----------
as for actually being able to implement~utilize the 'equipped' state, you can use a Boolean Attribute (upon equipping, you set it to 'true', and upon unequipping, you set it back to 'false' ), which you can check for in your various scriptings of actions~events (combat 'attacks'), etc. A more difficult way would be to check what it's alias is, but you might as well just use a Boolean Attribute, instead.
for example, using the Boolean Attribute:
---------
however, this is just the basics, for a simple combat system.
Pixie's Combat Library
Chase's Wearables Library
Pertex' Combat Library
equipment is complex, not easy for noobs (like me), and also there's different ways~designs to implement equipment too, along with whether you want a simple equipment system or a complex equipment system.
--------
if you want to do it with having the inventory displaying: 'equipment_name' vs 'equipment_name (equipped)', the three guides~libraries above do this (well, at least Pixie's and Chase's ~ I've not looked at Pertex' Combat Library for a long long long time, lol).
the basic idea of it is this:
when you equip, you change the alias to display: equipment_name (equipped)
when you unequip, you change the alias to display: equipment_name
which is done via:
http://docs.textadventures.co.uk/quest/ ... alias.html
for example, to equip:
sword_1.alias = "katana" // this is the current 'display alias', the non-equipped alias
sword_1.equipped = false
// our boolean, set to initially being unequiped (sword_1.equipped = false), but for actually applying it's equipped state, we need to reset it to being: sword_1.equipped = true, to be able to apply it whatever scripts in your game (such as combat 'attack' )
we need to first store~save this non-equipped alias (for when we unequip it), via, for example:
sword_1.old_alias = sword_1.alias
// sword_1.old_alias = "katana"
and now, we can give the sword, its new equipped alias, via, for example:
sword_1.alias = GetDisplayAlias (sword_1) + " (equipped)"
// CONCEPTUALLY ONLY:
// sword_1.alias = {GetDisplayAlias (sword_1)} + " (equipped)"
// sword_1.alias = {katana} + (equipped)
// sword_1.alias = katana (equipped)
sword_1.equipped = true // boolean's are an easy way to tell quest whether something is switched on or switched off, and we're re-setting it to being 'true' (equipped state), which we can use (via 'if' checking for) this, for doing our various scripts in your game.
and, then when we want to unequip the sword, we simply re-set it's alias back to the stored~saved non-equipped alias:
sword_1.alias = sword_1.old_alias
// sword_1.alias = "katana"
sword_1.equipped = false // we're re-setting it to be 'false' (unequipped state)
----------
as for actually being able to implement~utilize the 'equipped' state, you can use a Boolean Attribute (upon equipping, you set it to 'true', and upon unequipping, you set it back to 'false' ), which you can check for in your various scriptings of actions~events (combat 'attacks'), etc. A more difficult way would be to check what it's alias is, but you might as well just use a Boolean Attribute, instead.
for example, using the Boolean Attribute:
<object name="orc_1">
<attack type="script">
if (player.sword_1.equipped)
{
orc_1.current_life = orc_1.current_life - 50 // you're using your katana (as it is equipped), doing 50 damage
}
else
{
orc_1.current_life = orc_1.current_life - 1 // you're using your fists (as the katana is NOT equipped), doing only 1 damage
}
</attack>
<displayverbs type="simplestringlist">look;attack</attr>
</object>
<verb>
<property>attack</property>
<pattern>attack</pattern>
<defaultexpression>You can't attack that!</defaultexpression>
</verb>
---------
however, this is just the basics, for a simple combat system.
sasha2cool
17 Dec 2015, 03:43HegemonKhan wrote:there's 3 Libraries using equipment (equipment: weapons~armors~jewelry~clothing~etc):
Pixie's Combat Library
Chase's Wearables Library
Pertex' Combat Library
equipment is complex, not easy for noobs (like me), and also there's different ways~designs to implement equipment too, along with whether you want a simple equipment system or a complex equipment system.
--------
if you want to do it with having the inventory displaying: 'equipment_name' vs 'equipment_name (equipped)', the three guides~libraries above do this (well, at least Pixie's and Chase's ~ I've not looked at Pertex' Combat Library for a long long long time, lol).
the basic idea of it is this:
when you equip, you change the alias to display: equipment_name (equipped)
when you unequip, you change the alias to display: equipment_name
which is done via:
http://docs.textadventures.co.uk/quest/ ... alias.html
for example, to equip:
sword_1.alias = "katana" // this is the current 'display alias', the non-equipped alias
sword_1.equipped = false
// our boolean, set to initially being unequiped (sword_1.equipped = false), but for actually applying it's equipped state, we need to reset it to being: sword_1.equipped = true, to be able to apply it whatever scripts in your game (such as combat 'attack' )
we need to first store~save this non-equipped alias (for when we unequip it), via, for example:
sword_1.old_alias = sword_1.alias
// sword_1.old_alias = "katana"
and now, we can give the sword, its new equipped alias, via, for example:
sword_1.alias = GetDisplayAlias (sword_1) + " (equipped)"
// CONCEPTUALLY ONLY:
// sword_1.alias = {GetDisplayAlias (sword_1)} + " (equipped)"
// sword_1.alias = {katana} + (equipped)
// sword_1.alias = katana (equipped)
sword_1.equipped = true // boolean's are an easy way to tell quest whether something is switched on or switched off, and we're re-setting it to being 'true' (equipped state), which we can use (via 'if' checking for) this, for doing our various scripts in your game.
and, then when we want to unequip the sword, we simply re-set it's alias back to the stored~saved non-equipped alias:
sword_1.alias = sword_1.old_alias
// sword_1.alias = "katana"
sword_1.equipped = false // we're re-setting it to be 'false' (unequipped state)
----------
as for actually being able to implement~utilize the 'equipped' state, you can use a Boolean Attribute (upon equipping, you set it to 'true', and upon unequipping, you set it back to 'false' ), which you can check for in your various scriptings of actions~events (combat 'attacks'), etc. A more difficult way would be to check what it's alias is, but you might as well just use a Boolean Attribute, instead.
for example, using the Boolean Attribute:<object name="orc_1">
<attack type="script">
if (player.sword_1.equipped)
{
orc_1.current_life = orc_1.current_life - 50 // you're using your katana (as it is equipped), doing 50 damage
}
else
{
orc_1.current_life = orc_1.current_life - 1 // you're using your fists (as the katana is NOT equipped), doing only 1 damage
}
</attack>
<displayverbs type="simplestringlist">look;attack</attr>
</object>
<verb>
<property>attack</property>
<pattern>attack</pattern>
<defaultexpression>You can't attack that!</defaultexpression>
</verb>
---------
however, this is just the basics, for a simple combat system.
where did this come from... i aint making a combat system... i just wanted to make something wearable like this jacket i made... where in the world did you get combat from?
sorry just saying nothing in there said combat ??
besides if i do make a combat system ill do it the easy way i can probly do it.. that seems harder besides code view isnt on here anymore.... i dont know it just isnt there anymore it disappeared
HegemonKhan
17 Dec 2015, 03:48I still answered the question ~ my post is answering your topic directly, even if I broadened~expanded the scope (generally equipment, including clothing: enchanted clothing ~ such as in TES games, goes with combat) of my response. So, that's where combat came from, combat~equipment are often linked.
this, which is addressing your question, is ~ 95% of my post:
and sorry about the code heavy post, if you need help in doing it through the GUI~Editor, I can try to help, but hopefully others, who know the GUI~Editor better than me, will help you with it.
this, which is addressing your question, is ~ 95% of my post:
there's 3 Libraries using equipment (equipment: weapons~armors~jewelry~clothing~etc):
Pixie's Combat Library
Chase's Wearables Library
Pertex' Combat Library
equipment is complex, not easy for noobs (like me), and also there's different ways~designs to implement equipment too, along with whether you want a simple equipment system or a complex equipment system.
--------
if you want to do it with having the inventory displaying: 'equipment_name' vs 'equipment_name (equipped)', the three guides~libraries above do this (well, at least Pixie's and Chase's ~ I've not looked at Pertex' Combat Library for a long long long time, lol).
the basic idea of it is this:
when you equip, you change the alias to display: equipment_name (equipped)
when you unequip, you change the alias to display: equipment_name
which is done via:
http://docs.textadventures.co.uk/quest/ ... alias.html
for example, to equip:
sword_1.alias = "katana" // this is the current 'display alias', the non-equipped alias
sword_1.equipped = false
// our boolean, set to initially being unequiped (sword_1.equipped = false), but for actually applying it's equipped state, we need to reset it to being: sword_1.equipped = true, to be able to apply it whatever scripts in your game (such as combat 'attack' )
we need to first store~save this non-equipped alias (for when we unequip it), via, for example:
sword_1.old_alias = sword_1.alias
// sword_1.old_alias = "katana"
and now, we can give the sword, its new equipped alias, via, for example:
sword_1.alias = GetDisplayAlias (sword_1) + " (equipped)"
// CONCEPTUALLY ONLY:
// sword_1.alias = {GetDisplayAlias (sword_1)} + " (equipped)"
// sword_1.alias = {katana} + (equipped)
// sword_1.alias = katana (equipped)
sword_1.equipped = true // boolean's are an easy way to tell quest whether something is switched on or switched off, and we're re-setting it to being 'true' (equipped state), which we can use (via 'if' checking for) this, for doing our various scripts in your game.
and, then when we want to unequip the sword, we simply re-set it's alias back to the stored~saved non-equipped alias:
sword_1.alias = sword_1.old_alias
// sword_1.alias = "katana"
sword_1.equipped = false // we're re-setting it to be 'false' (unequipped state)
and sorry about the code heavy post, if you need help in doing it through the GUI~Editor, I can try to help, but hopefully others, who know the GUI~Editor better than me, will help you with it.

XanMag
17 Dec 2015, 03:51If you have a limited number of wearable things in your game, you could do the following:
Once the object is worn... (let's say 'coat')
1. move object coat to a "dead room". That is a room with no entrances or exits - basically a storehouse.
2. create an object 'coat (worn)' and move it to the player inventory. Give it a description as if it is being worn.
3. if the player chooses to 'remove coat', swap the objects again (coat worn to dead room and coat to player inventory)
4. in the player description box, add an 'if' statement. If player is carrying object 'coat (worn)', then print message "You are sasha2cool and you are wearing a coat", and add an 'else' to that which prints a message "You are sasha2cool."
If you want to wear other objects using this methods, simply do the same for each object with a new 'if' script. The player description gets a little tricky though. I would print a message like this if you are wearing multiple things:
"You are sasha2cool.
"You are wearing..."
"A pea coat..."
"Slacks..."
"and some comfy tennis shoes."
Each line below "You are sasha2cool" is a new 'if' statement with a blank 'else' statement. Or, if you wanted, you could put some other description in the else statement like "a tee shirt", "sweatpants", and "socks". I'd only do this if those are items that you'll change out of but cannot really remove. And, yes, it will print a new line for each object you are wearing which isn't the greatest looking response, but I think it is okay as long as you are wearing only a couple objects.
It is NOT nearly as slick as some of those libraries or what HK suggests, but I think it is a little easier to understand.
Once the object is worn... (let's say 'coat')
1. move object coat to a "dead room". That is a room with no entrances or exits - basically a storehouse.
2. create an object 'coat (worn)' and move it to the player inventory. Give it a description as if it is being worn.
3. if the player chooses to 'remove coat', swap the objects again (coat worn to dead room and coat to player inventory)
4. in the player description box, add an 'if' statement. If player is carrying object 'coat (worn)', then print message "You are sasha2cool and you are wearing a coat", and add an 'else' to that which prints a message "You are sasha2cool."
If you want to wear other objects using this methods, simply do the same for each object with a new 'if' script. The player description gets a little tricky though. I would print a message like this if you are wearing multiple things:
"You are sasha2cool.
"You are wearing..."
"A pea coat..."
"Slacks..."
"and some comfy tennis shoes."
Each line below "You are sasha2cool" is a new 'if' statement with a blank 'else' statement. Or, if you wanted, you could put some other description in the else statement like "a tee shirt", "sweatpants", and "socks". I'd only do this if those are items that you'll change out of but cannot really remove. And, yes, it will print a new line for each object you are wearing which isn't the greatest looking response, but I think it is okay as long as you are wearing only a couple objects.
It is NOT nearly as slick as some of those libraries or what HK suggests, but I think it is a little easier to understand.
sasha2cool
17 Dec 2015, 03:56HegemonKhan wrote:I still answered the question ~ my post is answering your topic directly, even if I broadened~expanded the scope (generally equipment, including clothing: enchanted clothing ~ such as in TES games, goes with combat) of my response. So, that's where combat came from, combat~equipment are often linked.
this, which is addressing your question, is ~ 95% of my post:there's 3 Libraries using equipment (equipment: weapons~armors~jewelry~clothing~etc):
Pixie's Combat Library
Chase's Wearables Library
Pertex' Combat Library
equipment is complex, not easy for noobs (like me), and also there's different ways~designs to implement equipment too, along with whether you want a simple equipment system or a complex equipment system.
--------
if you want to do it with having the inventory displaying: 'equipment_name' vs 'equipment_name (equipped)', the three guides~libraries above do this (well, at least Pixie's and Chase's ~ I've not looked at Pertex' Combat Library for a long long long time, lol).
the basic idea of it is this:
when you equip, you change the alias to display: equipment_name (equipped)
when you unequip, you change the alias to display: equipment_name
which is done via:
http://docs.textadventures.co.uk/quest/ ... alias.html
for example, to equip:
sword_1.alias = "katana" // this is the current 'display alias', the non-equipped alias
sword_1.equipped = false
// our boolean, set to initially being unequiped (sword_1.equipped = false), but for actually applying it's equipped state, we need to reset it to being: sword_1.equipped = true, to be able to apply it whatever scripts in your game (such as combat 'attack' )
we need to first store~save this non-equipped alias (for when we unequip it), via, for example:
sword_1.old_alias = sword_1.alias
// sword_1.old_alias = "katana"
and now, we can give the sword, its new equipped alias, via, for example:
sword_1.alias = GetDisplayAlias (sword_1) + " (equipped)"
// CONCEPTUALLY ONLY:
// sword_1.alias = {GetDisplayAlias (sword_1)} + " (equipped)"
// sword_1.alias = {katana} + (equipped)
// sword_1.alias = katana (equipped)
sword_1.equipped = true // boolean's are an easy way to tell quest whether something is switched on or switched off, and we're re-setting it to being 'true' (equipped state), which we can use (via 'if' checking for) this, for doing our various scripts in your game.
and, then when we want to unequip the sword, we simply re-set it's alias back to the stored~saved non-equipped alias:
sword_1.alias = sword_1.old_alias
// sword_1.alias = "katana"
sword_1.equipped = false // we're re-setting it to be 'false' (unequipped state)
and sorry about the code heavy post, if you need help in doing it through the GUI~Editor, I can try to help, but hopefully others, who know the GUI~Editor better than me, will help you with it.
ok thanks ill try to figure it out. once i figure out what happened to code view ill try the code/script

HegemonKhan
17 Dec 2015, 04:00this is quite advanced stuff, and I probably scared you with the code (do you have some coding ability or have you never coded before?), but it takes (me) so much longer to try to write~post through using the GUI~Editor, it's much more work to do so, whereas code is very nice and quick (if you know what to do) to type~write in and~or copy and paste, lol. This was just a brief example repsonse too, not a full detailed step by step guide on how to do it, that'd take awhile, lol.
Maybe XanMag can try helping you through the GUI~Editor, using "my" (it's actually Pixie's and Chase's code design) method, as he can do so much better than I, though if not, I can try to help you with using the GUI~Editor to do it.
sorry for the confusion about adding in the combat-equipment attachment, I'm a guy, and thus combat equipment (weapons and armors) is more familiar for me than working with clothing equipment, laughs.
You can certainly have an entire clothing equipment system, which has nothing to do with combat, such as... I don't know... I guess with attraction~dating~etc stuff, if you were making such a game.
Maybe XanMag can try helping you through the GUI~Editor, using "my" (it's actually Pixie's and Chase's code design) method, as he can do so much better than I, though if not, I can try to help you with using the GUI~Editor to do it.
sorry for the confusion about adding in the combat-equipment attachment, I'm a guy, and thus combat equipment (weapons and armors) is more familiar for me than working with clothing equipment, laughs.
You can certainly have an entire clothing equipment system, which has nothing to do with combat, such as... I don't know... I guess with attraction~dating~etc stuff, if you were making such a game.
The Pixie
17 Dec 2015, 07:50Use Chase's Wearables library:
http://docs.textadventures.co.uk/quest/ ... rary2.html
It will add a new tab to the GUI where you can set up clothing; no coding required.
http://docs.textadventures.co.uk/quest/ ... rary2.html
It will add a new tab to the GUI where you can set up clothing; no coding required.
Marzipan
17 Dec 2015, 15:26The Pixie wrote:Use Chase's Wearables library:
http://docs.textadventures.co.uk/quest/ ... rary2.html
It will add a new tab to the GUI where you can set up clothing; no coding required.
I've yet to use a library, but this looks too useful to pass up. I'd been using flags to alter the player description, but that does get tedious after awhile, and I hadn't tackled what to do you if they decided to just start piling on several layers.
Do either of the combat libraries have clothing/armor slots for realistic coverage?
The Pixie
17 Dec 2015, 15:50Marzipan wrote:Do either of the combat libraries have clothing/armor slots for realistic coverage?
Mine does not (armour is just a number from 0 to 5), and as far as I know Pertex's does not either.
HegemonKhan
18 Dec 2015, 02:19what do you mean by realistic slot coverage? like head, shoulders, neck, arms, face, hands, back, chest, waist, legs, feet, left_hand, right_hand, etc?
Chase's Library has both 'slots' and 'layers', so it's pretty comprehensive, being able to create and use your own body~equipment named slots and as well as x layers for each of those slots.
Chase's Library has both 'slots' and 'layers', so it's pretty comprehensive, being able to create and use your own body~equipment named slots and as well as x layers for each of those slots.