<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>HegemonKhan 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.
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)HegemonKhan 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.
The 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.