How do you use an expression to get a list of objects in game.pov.parent ?
I'm making a combat system for my game my game is going to use a random mob generator so I need an expression to retrieve a list of objects in the room.
For the inventory, use the ScopeInventory
function. For the room, ScopeVisibleNotHeld
. You may find FilterByAttribute
and FilterByType
useful too, so you get just get the objects you want from the list (just weapons or just monsters). Then there is PickOneObject
to randomly pick one object from the list.
// get all objects in room
l = ScopeVisibleNotHeld()
// filter out anything not of the monster type
l = FilterByType(l, "monster")
// pick one at random
foe = PickOneObject (l)