Various mods such as Zombieland spawn weapons or other items on the ground where the creature was eliminated. How are they accomplishing this?
To be clear, I’m not talking about putting items directly into a players inventory.
Is there any way to get reference to the eliminated creature (or just its location) from MatchingCreatureTypeEliminatedEvent from a creature_manager_device?
Alternatively, are creatures a child of Agent? Can I pass in a creature into the GrantItem(Agent) function of an item_granter_device? If so, How would I go about getting the reference to the creature agents?
I’d reckon Zombieland uses one or more Elimination Manager devices. If you’re building a drop loot table for existing creature types (fiends, guards, etc.) that’s probably your best bet.
Sorry I can’t answer the Verse questions, but I’m interested to know myself.
Ah perfect, elimination_manager_device does indeed allow items to be dropped from creatures. Thank you
Edit: So Following up on the verse side of this question; Looking at Fortnite.digest.verse, a positional interface is declared. I think I’m casting to this interface correctly, but unsure. Both the eliminated and eliminator events on the elimination manger return an agent/?agent. So this returns me again to one of my original questions, are creatures an agent?
Below is the current iteration of code; currently planning on just moving an item placer around once I’m able to get the creatures location.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }
using { /Fortnite.com/Game }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Characters }
# A Verse-authored creative device that drops items at the location of a killed enemy creature whenever a specified(in elim_mgr) creature is eliminated
creature_item_spawner_device := class(creative_device):
@editable EliminationManager:elimination_manager_device=elimination_manager_device{}
@editable ItemGranter:item_granter_device=item_granter_device{}
@editable ItemPlacer:item_placer_device=item_placer_device{}
OnBegin<override>()<suspends>:void=
EliminationManager.EliminationEvent.Subscribe(OnMaybeCreatureElimination)
OnMaybeCreatureElimination(Agent:?agent):void={
if (TargetedPlayer := player[Agent?]):
if(FortCharacter := TargetedPlayer.GetFortCharacter[]):
Transform := FortCharacter.GetTransform()
Print("Player Elimination Xform: "+ToString(Transform.Translation))
#This works to drop items where the player (that killed a creature) is located
ItemGranter.GrantItem(TargetedPlayer)
else:
if( Transform := positional[Agent?].GetTransform()):
#This doesn't work, I assume because we aren't casting to fort character first
Print("Elimination Xform: "+ToString(Transform.Translation))
}