Jump to content

A bit of trouble with writing a spawn function?


Recommended Posts

So I just got started on number 2 of making a creatue mod. Problem is, I am confused by this entry:

 
 
* Step 1 - Writing a spawn function.
We need to write ourselves a function which will spawn our creature.  I've chosen to spawn a 'Beefalo' but feel free to pick your own creature.  To see how this is done, check out the function 'SpawnCreature' found in 'modmain.lua'.
 
* Step 2 - Triggering our function.
Writing our spawn function isn't enough.  We need some way of telling the game to run our function.  Luckily for us, 'Don't Starve' let's us do that by calling 'AddSimPostInit'.  This function tells the game to run our function once the game has started and the player has spawned in the world.  By adding this call at the end of modmain.lua, we're telling the game to call 'SpawnCreature' once we've entered the game.
 
 
If any modder could help me understand exactly what to do, that would be great. Thanks in advance!
Link to comment
Share on other sites

Could you perhaps tell us where this entry is from? Usually that's a good place to ask for help.

 

Also, what are you trying to do?

 

 

Yes sure. So in the how to make a mod, it basicly tell you to subscribe to an item, And in the mod folder it explains how to do stuff. The mod folder is in the file attachment.

 

Also, I am trying to make a simple mod, that adds a Domo Creature into the game. Any help is much appreciated. Thanks!

readme_tutorial_2.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...