Jump to content

Recommended Posts

I was following the Creature Mod tutorials made by Cheerio to create a new creature in the game, but when I was using the Tall Bird Brain as a reference for its brain I ran into an issue. These two functions conflict:

 

From the Brain:

function Brain:OnInitializationComplete()    self.inst.components.knownlocations:RememberLocation("home", Point(player.Transform:GetWorldPosition()))end

From the Modmain:

function SpawnCreature(player)--Get player's current position.local x, y, z = player.Transform:GetWorldPosition()--Spawn creature at the world origin.local creature = GLOBAL.SpawnPrefab("anthropophagi")--Move creature to the player's position.creature.Transform:SetPosition( x, y, z ) endAddSimPostInit(SpawnCreature)

 

What I think is going on:

  1. The first one asigns a "home" location to the creature after game initialization.
  2. The second one spawns the creature at the world origin after player initialization. 

Does anyone know a solution for asigning it a "home" location on the origin after the player initializes?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...