Releasing (somewhat) random items from a func_breakable

Dr. KillPatient

L3: Member
May 10, 2009
115
8
I have a map that's Minecraft-themed, I want players to be able to break an ore block (func_breakable) and release one of five items, selected randomly. There will be a lot of these, so what's the best way to go about doing it and staying optimized entity-wise?
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
5 point templates, logic_case, all five items.

Each point template is linked to one item.
Logic case points to each point template with the forceSpawn input.
Breakable object links to the logic case with the pickRandomCase input.

And you'll need to do that for each ore cube. I don't think there's a lighter way to do that.

You may be able to use only the 5 point templates and the 5 items and use the entity teleport...stuff to move it to a location in the world, but I am unclear on how to use those entities. And you'd still need one teleport "exit" per ore cube and a way to know which exit is the active one.
 
Last edited:

Tapp

L10: Glamorous Member
Jan 26, 2009
776
215
5 point templates, logic_case, all five items.

Each point template is linked to one item.
Logic case points to each point template with the forceSpawn input.
Breakable object links to the logic case with the pickRandomCase input.

And you'll need to do that for each ore cube. I don't think there's a lighter way to do that.

You may be able to use only the 5 point templates and the 5 items and use the entity teleport...stuff to move it to a location in the world, but I am unclear on how to use those entities. And you'd still need one teleport "exit" per ore cube and a way to know which exit is the active one.

That's probably the best way, I'll see if I can rig up an "entity conservative" setup for you and post it here.

<watch this space>