game.pov.weapon_number = 0
weaponlist = NewStringList()
foreach (object, ScopeInventory()) {
if (DoesInherit(object, "weapon") and object.location = "single") {
game.pov.weapon_number = game.pov.weapon_number + 1
msg (object + " is a single handed weapon")
list add (weaponlist, object.name)
}
else if (DoesInherit(object, "weapon") and object.location = "dhand") {
game.pov.weapon_number = game.pov.weapon_number + 1
msg (object + " is a two handed weapon")
list add (weaponlist, object.name)
}
}
if (game.pov.weapon_number > 0) {
show menu ("Which weapon do you want to equip:", weaponlist, true) {
if (result <> null) {
object_x = GetObject(result)
if (object_x<>null and object_x.location="dhand") {
msg ("You have chosen to equip your " + result)
do (object_x, "equip")
}
else if (object_x<>null and object_x.location="single") {
show menu ("In which hand do you want to equip " + result + "?", split("Left hand;Right hand", ";"), false) {
switch (result) {
case ("Left hand") {
do (object_x, "equipl")
}
case ("Right hand") {
do (object_x, "equipr")
}
}
}
}
}
else {
msg ("You have chosen to press cancel")
}
}
}
else {
msg ("You do not have any weapon in your inventory to equip!")
}
options = NewStringDictionary()
dictionary add(options, "male", "I am male")
dictionary add(options, "female", "I am female")
showmenu ("Are you male or female", options, false) {
msg("result = " result)
}
I am male
I am female
weaponlist = NewStringList()
weaponlist = NewStringDictionary()
list add (weaponlist, object.name)
dictionary add (weaponlist, object.name, GetDisplayAlias(object))
<function name="FindByAlias" parameters="value" type="object">
foreach (o, ScopeInventory ()) {
if (HasString(o, "alias")) {
if (o.alias = value) {
return (o)
}
}
}
return (null)
</function>
Avantar wrote:@jaynabonne: You know my questions are usually easy.
I do not think that I have seen a full blown game from you yet. With your knowledge it should be promising....Working on something?