Let's say I have several boxes of ammo named "ammo", "ammo1", "ammo2" etc.
They all share the same alias... guess what it is? Indeed, it's "ammo".
Is it possible to script an alias check?
Something like if (Got(object.alias = ammo)) ?
I know that doesn't work. I tried it, and lots of variations of it. But.. is it possible, somehow?
To clarify: I want to check if the player is carrying ammo.
I don't want it to matter if the name of the object is ammo or ammo1 etc.
You would need to go through the inventory and check each item.
gotammo = false
foreach (o, ScopeInventory()) {
if (object.alias = ammo) {
gotammo = true
}
}
quick fix on Pixie's code (he just forgot to put the double quotes on 'ammo'):
gotammo = false
foreach (o, ScopeInventory()) {
if (object.alias = "ammo") {
gotammo = true
}
}
In many cases, it might be more efficient to do:
myammo = FilterByAttribute (ScopeInventory(), "alias", "ammo")
if (ListCount (myammo) > 0) {
// whatever...
If you later want to find the ammo object, for example so you can remove it, you can use PickOneObject(myammo).