Jump to content
  • The forum downloads section will be removed on Jan 1st 2023. Players may still download mods that are currently hosted, but new submissions are no longer being accepted. Mod makers are advised to relocate their mods to alternative hosting solutions.

Creature Mod Tutorial 2 - Spawning a Creature 1.0


1 Screenshot

About This File

This tutorial shows you how to spawn a creature at the player's position!

Instructions on using the tutorial:

1. Download and extract the mod to your mods folder.

2. Open and follow the instructions in 'readme_tutorial_2.txt'.

Happy modding! :-)

  • Like 1

User Feedback

Recommended Comments

When I do local x, y, z = player.Transform:GetWorldPosition()

it says variable player is not declared,

do I need to use my steam name

Link to comment
Share on other sites

  • Developer

In the mod, 'player' can be used in the 'SpawnCreature' function because it's a variable that gets passed into it.  If you're using this function elsewhere, you can use:

 

local x, y, z = GLOBAL.GetPlayer().Transform:GetWorldPosition()

Link to comment
Share on other sites

Big thanks for the mod tutorial, I am new to modding

in the tutorial, the function SpawnCreature is  always called whenever the mod is enabled for all character

but is it possible if i want to make a character mod, or a mod that spawn something for a specific character

what i have try:

if playercharacter == "mycharactername" then

AddSimPostInit(SpawnCreature)

end

at the end of modmain.lua

not work :))

 

Edited by Noath
Link to comment
Share on other sites

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...