Jump to content

Recommended Posts

I am making a stick man character (because I don't know how to draw) and I am getting some unknown error... here's a picture of the error

post-306905-0-84551800-1391411310_thumb.

 

and here is my smiley.lua 

local MakePlayerCharacter = require "prefabs/player_common"local assets = {        Asset( "ANIM", "anim/player_basic.zip" ),        Asset( "ANIM", "anim/player_idles_shiver.zip" ),        Asset( "ANIM", "anim/player_actions.zip" ),        Asset( "ANIM", "anim/player_actions_axe.zip" ),        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),        Asset( "ANIM", "anim/player_actions_shovel.zip" ),        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),        Asset( "ANIM", "anim/player_actions_eat.zip" ),        Asset( "ANIM", "anim/player_actions_item.zip" ),        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),        Asset( "ANIM", "anim/player_actions_fishing.zip" ),        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),        Asset( "ANIM", "anim/player_bush_hat.zip" ),        Asset( "ANIM", "anim/player_attacks.zip" ),        Asset( "ANIM", "anim/player_idles.zip" ),        Asset( "ANIM", "anim/player_rebirth.zip" ),        Asset( "ANIM", "anim/player_jump.zip" ),        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),        Asset( "ANIM", "anim/player_teleport.zip" ),        Asset( "ANIM", "anim/wilson_fx.zip" ),        Asset( "ANIM", "anim/player_one_man_band.zip" ),        Asset( "ANIM", "anim/shadow_hands.zip" ),        Asset( "SOUND", "sound/sfx.fsb" ),        Asset( "SOUND", "sound/wilson.fsb" ),        Asset( "ANIM", "anim/beard.zip" ),-- Don't forget to include your character's custom assets!        Asset( "ANIM", "anim/smiley.zip" ),}local prefabs = {}local fn = function(inst)-- choose which sounds this character will playinst.soundsname = "willow"-- a minimap icon must be specifiedinst.MiniMapEntity:SetIcon( "wilson.png" )-- todo: Add an example special power here.inst.components.health:SetMaxHealth(120)inst.components.hunger:SetMax(150)inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE * 1)inst.components.sanity:SetMax(170)inst.components.combat.damagemultiplier = 0.9inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1)inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1)inst.components.temperature:SetTemp( 9 )self.inherentinsulation = 4end)local Combat = Class(function(self, inst)inst.components.combat.attackrange = 5.1inst.components.combat.hitrange = 3.1inst.components.combat.min_attack_period = 3end)end-- The character select screen lines-- note: these are lower-case character nameSTRINGS.CHARACTER_TITLES.kta = "The Stick Man"STRINGS.CHARACTER_NAMES.kta = "Smiley"STRINGS.CHARACTER_DESCRIPTIONS.kta = "*Has no meat on his bones...\n*Actually he doesn't have bones either!\n*Do to his lack of a body he is weaker, faster, and gets colder faster!"STRINGS.CHARACTER_QUOTES.kta = "\"How am I alive?\""STRINGS.CHARACTERS.kta= require "speech_smiley"return MakePlayerCharacter("smiley", prefabs, assets, fn)

 

(here is the lua in a zip smiley-lua.zip  )

it is telling me that on line 57 there is an unexpected symbol near ')'

 

line 57 is the first 'end)' under the '-- todo: Add an example special power here.'

 

any help will be greatly appreciated! thx in advanced :grin:

Edited by Fidooop
Link to comment
https://forums.kleientertainment.com/forums/topic/31345-mod-help-unknown-error/
Share on other sites

local MakePlayerCharacter = require "prefabs/player_common"  local assets = {        Asset( "ANIM", "anim/player_basic.zip" ),        Asset( "ANIM", "anim/player_idles_shiver.zip" ),        Asset( "ANIM", "anim/player_actions.zip" ),        Asset( "ANIM", "anim/player_actions_axe.zip" ),        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),        Asset( "ANIM", "anim/player_actions_shovel.zip" ),        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),        Asset( "ANIM", "anim/player_actions_eat.zip" ),        Asset( "ANIM", "anim/player_actions_item.zip" ),        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),        Asset( "ANIM", "anim/player_actions_fishing.zip" ),        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),        Asset( "ANIM", "anim/player_bush_hat.zip" ),        Asset( "ANIM", "anim/player_attacks.zip" ),        Asset( "ANIM", "anim/player_idles.zip" ),        Asset( "ANIM", "anim/player_rebirth.zip" ),        Asset( "ANIM", "anim/player_jump.zip" ),        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),        Asset( "ANIM", "anim/player_teleport.zip" ),        Asset( "ANIM", "anim/wilson_fx.zip" ),        Asset( "ANIM", "anim/player_one_man_band.zip" ),        Asset( "ANIM", "anim/shadow_hands.zip" ),        Asset( "SOUND", "sound/sfx.fsb" ),        Asset( "SOUND", "sound/wilson.fsb" ),        Asset( "ANIM", "anim/beard.zip" ),  -- Don't forget to include your character's custom assets!        Asset( "ANIM", "anim/smiley.zip" ),}local prefabs = {}  local fn = function(inst)	-- choose which sounds this character will play	inst.soundsname = "willow"	 	 	-- a minimap icon must be specified	inst.MiniMapEntity:SetIcon( "wilson.png" )	 	 	-- todo: Add an example special power here.	inst.components.health:SetMaxHealth(120)	inst.components.hunger:SetMax(150)	inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE * 1)	inst.components.sanity:SetMax(170)	inst.components.combat.damagemultiplier = 0.9	inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1)	inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1)	inst.components.temperature:SetTemp( 9 )	self.inherentinsulation = 4 	local Combat = Class(function(self, inst)							inst.components.combat.attackrange = 5.1							inst.components.combat.hitrange = 3.1							inst.components.combat.min_attack_period = 3						end)end-- The character select screen lines-- note: these are lower-case character nameSTRINGS.CHARACTER_TITLES.kta = "The Stick Man"STRINGS.CHARACTER_NAMES.kta = "Smiley"STRINGS.CHARACTER_DESCRIPTIONS.kta = "*Has no meat on his bones...\n*Actually he doesn't have bones either!\n*Do to his lack of a body he is weaker, faster, and gets colder faster!"STRINGS.CHARACTER_QUOTES.kta = "\"How am I alive?\""STRINGS.CHARACTERS.kta= require "speech_smiley"  return MakePlayerCharacter("smiley", prefabs, assets, fn)

try that

ok I figured out that I don't even need an end) at all! but now the game just crashes and closes itself when I select the mod and leave the mod screen.... if anyone knows what may cause this problem I'd greatly appreciate it! if I need to put in some more files let me know so that I can upload them

1: You DO need the end).

2: Change the "kta" to "smiley".

3: Make sure you've changed the build.anim

4: Make sure the xmls for the images have been changed to "smiley" as well.

 

EDIT: Take out the:

local Combat = Class(function(self, inst)inst.components.combat.attackrange = 5.1inst.components.combat.hitrange = 3.1inst.components.combat.min_attack_period = 3end)

and make it:

inst.components.combat.attackrange = 5.1inst.components.combat.hitrange = 3.1inst.components.combat.min_attack_period = 3

That should fix some things.

Edited by Mr. Tiddles

same error... here is what I changed

 

-- todo: Add an example special power here.
inst.components.health:SetMaxHealth(120)
inst.components.hunger:SetMax(150)
inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE * 1)
inst.components.sanity:SetMax(170)
inst.components.combat.damagemultiplier = 0.9
inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1)
inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1)
inst.components.temperature:SetTemp( 9 )
self.inherentinsulation = 4
end)
inst.components.combat.attackrange = 5.1
inst.components.combat.hitrange = 3.1
inst.components.combat.min_attack_period = 3
end
 
edit:
(I also changed kta to smiley)
 
build.anim or build.bin?
Edited by Fidooop

cool! here is the file attachicon.gifsmiley-anim.zip

(It was originally named smiley.zip I only renamed it so you can tell it apart from the first file)

 

and also is this your steam?

http://steamcommunity.com/profiles/76561198025944866

Thank you.

And yes, that's my steam.

GetPlayer = GLOBAL.GetPlayer
 
GLOBAL.STRINGS.NAMES.BASEBALL_CAP_OF_AWESOMENESS = "Baseball Cap of Awesomeness"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.BASEBALL_CAP_OF_AWESOMENESS = "The one and only hat I will ever love!"
GLOBAL.STRINGS.NAMES.BASEBALL_CAP_OF_EPICNESS = "Baseball Cap of Epicness"
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.BASEBALL_CAP_OF_EPICNESS = "I moustache you a question!"
 
PrefabFiles = {
"smiley",
"baseball_cap_of_awesomeness",
"baseball_cap_of_epicness",
}
 
Assets = {
    Asset( "IMAGE", "images/saveslot_portraits/smiley.tex" ),
    Asset( "ATLAS", "images/saveslot_portraits/smiley.xml" ),
 
    Asset( "IMAGE", "images/selectscreen_portraits/smiley.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/smiley.xml" ),
 
    Asset( "IMAGE", "images/selectscreen_portraits/smiley_silho.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/smiley_silho.xml" ),
 
    Asset( "IMAGE", "bigportraits/smiley.tex" ),
    Asset( "ATLAS", "bigportraits/smiley.xml" ),
 
Asset( "IMAGE", "minimap/baseball_cap_of_awesomeness.tex" ),
Asset( "ATLAS", "minimap/baseball_cap_of_awesomeness.xml" ),
 
Asset( "IMAGE", "minimap/baseball_cap_of_epicness.tex" ),
Asset( "ATLAS", "minimap/baseball_cap_of_epicness.xml" ),
}
 
AddMinimapAtlas("minimap/baseball_cap_of_awesomeness.xml")
AddMinimapAtlas("minimap/baseball_cap_of_awesomeness.xml")
 
function SmileyPostInit(smiley)
local baseball_cap_of_awesomeness = Ingredient( "baseball_cap_of_awesomeness", 1)
baseball_cap_of_awesomeness.atlas = "images/inventoryimages/baseball_cap_of_awesomeness.xml"
local baseball_cap_of_epicness = Ingredient ( "baseball_cap_of_epicess", 1)
baseball_cap_of_epicness.atlas = "images/inventoryimages/baseball_cap_of_epicness.xml"
 
 
local baseball_cap_of_epicnessrecipe = GLOBAL.Recipe( ("baseball_cap_of_epicness"), {baseball_cap_of_awesomeness, Ingredient("silk", 8), Ingredient("froglegs", 5), Ingredient("sewing_kit", 1)}, RECIPETABS.DRESSUP,  {SCIENCE = 1} )
       baseball_cap_of_epicnessrecipe.atlas = "images/inventoryimages/baseball_cap_of_epicness.xml"
 
end
 
AddSimPostInit(function(inst)
        if inst.prefab == "smiley" then
                SmileyPostInit(inst)
        end
end)
 
table.insert(GLOBAL.CHARACTER_GENDERS.MALE, "smiley")
 
-------------------------------------------------------------
 
 
AddModCharacter("smiley")

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