Recommended Posts

Jjmarco    54

@ELEMENTALCRAFTER009, now that's weird, because I tested it, and it works just fine.

I have access to the magic tab and all tier 1 magic recipes are unlocked.

 

Did you put that line in master_postinit? Or maybe that's not the effect you want?

Share this post


Link to post
Share on other sites

@ELEMENTALCRAFTER009, now that's weird, because I tested it, and it works just fine.

I have access to the magic tab and all tier 1 magic recipes are unlocked.

 

Did you put that line in master_postinit? Or maybe that's not the effect you want?

 

here's my character.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" ),        Asset( "ANIM", "anim/trent.zip" ),        Asset( "ANIM", "anim/ghost_trent_build.zip" ),        Asset( "ANIM", "anim/trent_form.zip" ),}local prefabs = {}local start_inv = {	"multitool_axe_pickaxe",	"goldenshovel",	"nightsword",	} local function becometrent_form(inst)		inst:AddTag("insomniac")		inst:AddTag("monster")		inst.trentform = true		inst.AnimState:SetBuild("trent_form")				inst.Transform:SetScale(1.4, 1.4, 1.4)				inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE * 1.5) 		inst.components.health:SetMaxHealth(250) 		inst.components.combat.damagemultiplier = 2.75				inst.components.sanity.dapperness = TUNING.DAPPERNESS_HUGE				inst.components.sanity.night_drain_mult = 2.2		inst.components.sanity.neg_aura_mult = 0.5			inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.2)			inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.2)		inst.components.builder.magic_bonus = 1endlocal function becometrent(inst)		inst:AddTag("insomniac")		inst.trentform = false		inst.AnimState:SetBuild("trent")				inst.Transform:SetScale(1, 1, 1) 		inst.components.health:SetMaxHealth(150)		inst.components.hunger:SetMax(200)		inst.components.sanity:SetMax(80)				inst.components.sanity.dapperness = (TUNING.DAPPERNESS_HUGE * 0.7)				inst.components.sanity.night_drain_mult = 2		inst.components.sanity.neg_aura_mult = 1.2			inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.07)			inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.07)		inst.components.builder.magic_bonus = 1end local becomeformtreshold = 33local unbecomeformtreshold = 45local function sanity_event_listener(inst, data)if inst.components.sanity.current <= becomeformtreshold and not inst.trentform then        becometrent_form(inst)elseif inst.components.sanity.current >= unbecomeformtreshold and inst.trentform then        becometrent(inst)				endendlocal function sanityfn(inst)	local x,y,z = inst.Transform:GetWorldPosition()   	local delta = 0	local rad = 10	local rad_sq = rad*rad	for k,v in pairs(AllPlayers) do	if v ~= inst then	local distsq = inst:GetDistanceSqToInst(v)	if distsq < rad_sq then	local sz = TUNING.SANITYAURA_TINY * 0.75	delta = delta + sz/math.max(1, distsq)		end	endend 	return delta	end	-- Map Iconlocal common_postinit = function(inst) 	inst.MiniMapEntity:SetIcon( "trent.tex" )end-- This initializes for the host onlylocal master_postinit = function(inst)	-- choose which sounds this character will play	inst.soundsname = "trent"	-- Stats	inst:AddTag("insomniac")	inst.components.health:SetMaxHealth(150)		inst.components.hunger:SetMax(200)		inst.components.sanity:SetMax(80)		inst.components.sanity.dapperness = (TUNING.DAPPERNESS_HUGE * 0.7)		inst.components.sanity.night_drain_mult = 2		inst.components.sanity.neg_aura_mult = 2		inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.06)		inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.06)	inst.components.builder.magic_bonus = 1	inst.components.sanity.custom_rate_fn = sanityfn		inst:ListenForEvent("sanitydelta", sanity_event_listener)endreturn MakePlayerCharacter("trent", prefabs, assets, common_postinit, master_postinit, start_inv)
Edited by ELEMENTALCRAFTER009

Share this post


Link to post
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
Sign in to follow this