Quest expressions question
wolfgang343
03 Mar 2019, 17:10How 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.
wolfgang343
03 Mar 2019, 18:10I also need to get a list of objects in the player inventory.
The Pixie
03 Mar 2019, 18:42For 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)
wolfgang343
03 Mar 2019, 18:47thank you!