Jump to content

I need help programming bombs


Recommended Posts

Hi i'm working on yet another custom character mod of silly ol' Tiny Tina from Borderlands 2

 

2013-10-30_00001_zps9661e789.jpg

 

 

I've gotten just about every aspect of her done, such as the picky eater thing like wickerbottom, her speech, and lower max sanity.

 

One thing I can't seem to get done is her special perk, The Ordinance Crafting Tab.

 

I've only got it about 60% complete per say, and I've hit a snag due to my noobiness at lua programming

 

I've managed to get the tab itself working, but the name doesn't show up when hovered over nor does the sticky bomb icon that it's supposed to have is there

 

Basically these are the items she can make

 

Bunny Bomb

It will basically be "cheap gunpowder" because all you need to make it is 2 nitre, 1 bunny, and 1 rope. It will function just like gunpowder, but only does half as much damage

 

2013-10-30_00002_zps9bd04390.jpg

 

Bombshell

This will basically be like gunpowder as well, but does 300 damage instead of 200. It is basically like harnessing the power of setting a slurtle on fire

 

2013-10-30_00005_zps100ab8f0.jpg

 

Badonkadonk

Again, same function as gunpowder, it will be the strongest bomb she can make, doing 500 damage

2013-10-30_00006_zps2df4c416.jpg

 

Mann Co. Sticky Bomb

She stole it from Tavish DeGroot didn't she? anyways this one will be a mine, just like the beemine cept it explodes instead of releasing bees. It also can't be stacked

 

2013-10-30_00003_zpsd77402a6.jpg

 

George

Another easter egg item, while I do think my Peacock mod deserves this item more, this one will basically be a bomb that auto lights when placed, similar to the Link mod by TheDanaAddams.

 

2013-10-30_00004_zpsaab165d4.jpg

 

Anyways, if you wanna take a closer look at what may be causing them to not be fully functional. here is tina's code

 

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/tina.zip" ),}local prefabs = { "bunnybomb", "badonkadonk", "stickybomb", "george", "snailbomb" }local start_inv = {"gunpowder", "gunpowder", "gunpowder", "gunpowder", "gunpowder", "gunpowder" }local fn = function(inst)	-- choose which sounds this character will play	inst.soundsname = "winnie"	-- a minimap icon must be specified	inst.MiniMapEntity:SetIcon( "winnie.png" )	inst.components.sanity:SetMax(TUNING.WILSON_SANITY * 0.8)    inst.components.eater.stale_hunger = TUNING.WICKERBOTTOM_STALE_FOOD_HUNGER    inst.components.eater.stale_health = TUNING.WICKERBOTTOM_STALE_FOOD_HEALTH    inst.components.eater.spoiled_hunger = TUNING.WICKERBOTTOM_SPOILED_FOOD_HUNGER    inst.components.eater.spoiled_health = TUNING.WICKERBOTTOM_SPOILED_FOOD_HEALTH	local ordinancetab = {str = "Ordinance", sort=999, icon = "ordinance.tex"}	inst.components.builder:AddRecipeTab(ordinancetab)	local s01Recipe = Recipe("bunnybomb", {Ingredient("rabbit", 1), Ingredient("rope", 1), Ingredient("nitre", 2)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s01Recipe.atlas = "images/inventoryimages/bunnybomb.xml"		local s02Recipe = Recipe("stickybomb", {Ingredient("flint", 6), Ingredient("gunpowder", 1), Ingredient("boards", 1)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s02Recipe.atlas = "images/inventoryimages/stickybomb.xml"		local s03Recipe = Recipe("george", {Ingredient("gears", 1), Ingredient("gunpowder", 1)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s03Recipe.atlas = "images/inventoryimages/george.xml"		local s04Recipe = Recipe("snailbomb", {Ingredient("slurtle_shellpieces", 4), Ingredient("slurtleslime", 2)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s04Recipe.atlas = "images/inventoryimages/snailbomb.xml"		local s05Recipe = Recipe("badonkadonk", {Ingredient("bunnybomb", 1), Ingredient("manrabbit_tail", 1), Ingredient("gunpowder", 2)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s05Recipe.atlas = "images/inventoryimages/badonkadonk.xml"	end	-- todo: Add an example special power here.STRINGS.CHARACTER_TITLES.tina = "The World's Deadliest 13-Year Old"STRINGS.CHARACTER_NAMES.tina = "Tiny Tina"STRINGS.CHARACTER_DESCRIPTIONS.tina ="*Is a prodigy at Ordinance\n*Doesn't like spoiled food\n*Is a little screwy in the head..."STRINGS.CHARACTER_QUOTES.tina = "\"Shorty, you da best!\""-- You can also add any kind of custom dialogue that you would like. Don't forget to make-- categores that don't exist yet using = {}-- note: these are UPPER-CASE charcacter nameSTRINGS.CHARACTERS.TINA = require "speech_tina"return MakePlayerCharacter("tina", prefabs, assets, fn, start_inv)

 

I'm not entirely sure why the icon and mouseover for the ordinance tab isn't showing up

 

also here's the code for the badonkadonk, bunny bomb, and bombshell, just replace badonkadonk with the respective bunnybomb and snailbomb and the damage set for the others. for some reason these are invisible when I put them on the ground, and can't be lit....

 

local assets ={	Asset("ANIM", "anim/badonkadonk.zip"),    Asset("ATLAS", "images/inventoryimages/badonkadonk.xml"),    Asset("ANIM", "anim/explode.zip"),}local prefabs ={    "explode_small"}local function OnIgniteFn(inst)    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_fuse_LP", "hiss")endlocal function OnExplodeFn(inst)    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()    inst.entity:AddSoundEmitter()    MakeInventoryPhysics(inst)    inst.AnimState:SetBank("slurtleslime")    inst.AnimState:SetBuild("badonkadonk")    inst.AnimState:PlayAnimation("idle")        inst:AddComponent("stackable")	inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM    inst:AddComponent("inspectable")    	MakeSmallBurnable(inst, 3+math.random()*3)    MakeSmallPropagator(inst)    inst:AddComponent("explosive")    inst.components.explosive:SetOnExplodeFn(OnExplodeFn)    inst.components.explosive:SetOnIgniteFn(OnIgniteFn)    inst.components.explosive.explosivedamage = TUNING.SLURTLESLIME_EXPLODE_DAMAGE*10        inst:AddComponent("inventoryitem")    inst.components.inventoryitem.atlasname = "images/inventoryimages/badonkadonk.xml"    return instendreturn Prefab( "common/inventory/badonkadonk", fn, assets, prefabs) 

 

Here's the code for George, I basically copied it from the bombs in the Link mod, and I was even able to get him to work earlier, but for some reason he crashes the game now....

 

local assets={	Asset("ANIM", "anim/george.zip"),	Asset("ANIM", "anim/explode.zip"),	Asset("ATLAS", "images/inventoryimages/george.xml")}local prefabs ={    "explode_small"}local function OnExplodeFn(inst)    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()	inst.entity:AddSoundEmitter()		    MakeInventoryPhysics(inst)        inst.AnimState:SetBank("heat_rock")    inst.AnimState:SetBuild("george")    inst.AnimState:PlayAnimation(3)    inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )        inst:AddComponent("inspectable")    inst:AddComponent("stackable")	inst.components.stackable.maxsize = 40MakeSmallBurnable(inst, 0.1)--    MakeSmallPropagator(inst)    inst:AddComponent("explosive")    inst.components.explosive:SetOnExplodeFn(OnExplodeFn)--    inst.components.explosive:SetOnIgniteFn(OnIgniteFn)    inst.components.explosive.explosivedamage = (TUNING.GUNPOWDER_DAMAGE * 1.5)        inst:AddComponent("inventoryitem")  	 inst.components.inventoryitem.atlasname = "images/inventoryimages/george.xml"		inst:AddComponent("singledroppable")-- inst:AddComponent("burnable")	--	  inst:ListenForEvent("ondropped", function(inst)	  	  inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_fuse_LP", "hiss")--	  inst.components.burnable.burning = true--	  inst:AddTag("fire")--	  inst:PushEvent("onignite")--	  inst.components.explosive:OnIgnite()	            ------------------------------          inst:DoTaskInTime(0.8, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)          ------------------------------          inst:DoTaskInTime(1.6, function(inst)--            print "Animation state 5"                inst.AnimState:PlayAnimation(5)	         end, inst)          ------------------------------          inst:DoTaskInTime(2.4, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)          ------------------------------          inst:DoTaskInTime(3.2, function(inst)--            print "Animation state 5"                inst.AnimState:PlayAnimation(5)	         end, inst)          ------------------------------          inst:DoTaskInTime(3.5, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)          ------------------------------          inst:DoTaskInTime(3.8, function(inst)--            print "Animation state 5"                inst.AnimState:PlayAnimation(5)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.1, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)                    ------------------------------          inst:DoTaskInTime(4.2, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.3, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.4, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.5, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.6, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.7, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.8, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.9, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)	                   ------------------------------          inst:DoTaskInTime(5, function(inst)--          print "Animation state 1"                inst.AnimState:PlayAnimation(1)--            print "I am lighter!"--                inst:AddComponent("lighter")        if not inst.components.burnable:IsBurning() then                inst.components.burnable:Ignite()        end--                inst.components.explosive:OnIgnite()--            inst.components.explosive:OnExplodeFn(inst)-----------------------------------------------------------------------------    local pos = Vector3(inst.Transform:GetWorldPosition())--    inst.SoundEmitter:KillSound("hiss")--    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")--    local explode = SpawnPrefab("explode_small")--    local pos = inst:GetPosition()--    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")--    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )--    explode.AnimState:SetLightOverride(1)    --    inst.PushEvent("explosion", {explosive = inst.george})--    inst:remove---------------------------------------------------------------------------	         end, inst)          --------------------------------          inst:DoTaskInTime(5.1, function(inst)--            print "no more lighter"--                inst:RemoveComponent("lighter")--	         end, inst)end) -- 		return instendreturn Prefab( "common/inventory/george", fn, assets, prefabs) 

 

Right now the sticky bomb is just using "dummied" coding that's the same as the badonkadonk so I could get that pic, I've tried taking the code from both the beemine and the gunpower to make this, but I don't think i'm doing it right because the game will crash when it tires to run

 

local assets={	Asset("ANIM", "anim/stickybomb.zip"),    Asset("SOUND", "sound/bee.fsb"),}local prefabs = {    "bee",	"mosquito",    "explode_small",}local function SpawnBees(inst)    inst.SoundEmitter:PlaySound("dontstarve/bee/beemine_explo")    local target = inst.components.mine and inst.components.mine:GetTarget()    if target and target:IsValid() then        for i = 1, TUNING.BEEMINE_BEES do            local bee = SpawnPrefab(inst.beeprefab)            if bee then                local pos = Vector3(inst.Transform:GetWorldPosition() )                local dist = math.random()                local angle = math.random()*2*PI                pos.x = pos.x + dist*math.cos(angle)                pos.z = pos.z + dist*math.sin(angle)                bee.Physics:Teleport(pos:Get() )                if bee.components.combat then                    bee.components.combat:SetTarget(target)                end            end        end        target:PushEvent("coveredinbees")    end    inst:RemoveComponent("mine")endlocal function OnExplode(inst)    inst.AnimState:PlayAnimation("explode")    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function onhammered(inst, worker)	if inst.components.mine then	    inst.components.mine:Explode(worker)	endendlocal function MineRattle(inst)    inst.AnimState:PlayAnimation("hit")    inst.AnimState:PushAnimation("idle")    inst.SoundEmitter:PlaySound("dontstarve/bee/beemine_rattle")    inst.rattletask = inst:DoTaskInTime(4 + math.random(), MineRattle)endlocal function StartRattling(inst)    inst.rattletask = inst:DoTaskInTime(1, MineRattle)endlocal function StopRattling(inst)    if inst.rattletask then        inst.rattletask:Cancel()        inst.rattletask = nil    endendlocal function ondeploy(inst, pt, deployer)	inst.components.mine:Reset()	inst.Physics:Teleport(pt:Get())	StartRattling(inst)endlocal function SetInactive(inst)	inst.AnimState:PlayAnimation("inactive")	StopRattling(inst)endlocal function OnDropped(inst)	inst.components.mine:Deactivate()endlocal function MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory)	local function fn()		local inst = CreateEntity()		local trans = inst.entity:AddTransform()		local anim = inst.entity:AddAnimState()		inst.entity:AddSoundEmitter()		MakeInventoryPhysics(inst)				local minimap = inst.entity:AddMiniMapEntity()		minimap:SetIcon( "beemine.png" )	   		anim:SetBank(skin)		anim:SetBuild(skin)		anim:PlayAnimation("idle")				inst:AddTag("mine")		inst:AddComponent("mine")		inst.components.mine:SetOnExplodeFn(OnExplode)		inst.components.mine:SetAlignment(alignment)		inst.components.mine:SetRadius(TUNING.BEEMINE_RADIUS)		inst.components.mine:SetOnDeactivateFn(SetInactive)				inst.components.mine:StartTesting()		inst.beeprefab = spawnprefab				inst:AddComponent("inspectable")		inst:AddComponent("lootdropper")		inst:AddComponent("workable")		inst.components.workable:SetWorkAction(ACTIONS.HAMMER)		inst.components.workable:SetWorkLeft(1)		inst.components.workable:SetOnFinishCallback(onhammered)    inst:AddComponent("explosive")    inst.components.explosive:SetOnExplodeFn(OnExplodeFn)    inst.components.explosive:SetOnIgniteFn(OnIgniteFn)    inst.components.explosive.explosivedamage = TUNING.GUNPOWDER_DAMAGE    inst.components.explosive.buildingdamage = 1    inst.components.explosive.lightonexplode = false    --[[local light = inst.entity:AddLight()    light:SetFalloff(0.7)    light:SetIntensity(.1)    light:SetRadius(0.1)    light:SetColour(237/255, 237/255, 209/255)    light:Enable(true)    --]]				if inventory then			inst:AddComponent("inventoryitem")			inst.components.inventoryitem.nobounce = true			inst.components.inventoryitem:SetOnPutInInventoryFn(StopRattling)			inst.components.inventoryitem:SetOnDroppedFn(OnDropped)						inst:AddComponent("deployable")			inst.components.deployable.ondeploy = ondeploy			inst.components.deployable.min_spacing = .75		else			StartRattling(inst)		end				--inst:AddComponent("trap")				return inst	end	return fnendlocal function BeeMine(name, alignment, skin, spawnprefab, inventory)	return Prefab( "common/inventory/"..name, MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory), assets, prefabs)endreturn BeeMine("beemine", "player", "bee_mine", "bee", true),		MakePlacer("common/beemine_placer", "stickybomb", "stickybomb", "idle"),

 

and just if I need to change something and you can point it out, here is here modmain

 

local STRINGS = GLOBAL.STRINGSlocal Ingredient = GLOBAL.Ingredientlocal RECIPETABS = GLOBAL.RECIPETABSPrefabFiles = {	"tina",	"badonkadonk",	"bunnybomb",	"george",	"snailbomb",	"stickybomb",}Assets = {    Asset( "IMAGE", "images/saveslot_portraits/tina.tex" ),    Asset( "ATLAS", "images/saveslot_portraits/tina.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/tina.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/tina.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/tina_silho.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/tina_silho.xml" ),    Asset( "IMAGE", "bigportraits/tina.tex" ),    Asset( "ATLAS", "bigportraits/tina.xml" ),}GLOBAL.STRINGS.TABS.ORDINANCETAB = "Ordinance"GLOBAL.STRINGS.NAMES.BUNNYBOMB = "Bunny Bomb"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.BUNNYBOMB = "He in fo' some fun."GLOBAL.STRINGS.RECIPE_DESC.BUNNYBOMB = "There's gonna be bunny guts everywhere!"GLOBAL.STRINGS.NAMES.BADONKADONK = "Badonkadonk"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.BADONKADONK = "Mushy Snugglebites got a gut full of dynamite and a booty like POW!"GLOBAL.STRINGS.RECIPE_DESC.BADONKADONK = "Who the hell is Mushy Snugglebites?!"GLOBAL.STRINGS.NAMES.STICKYBOMB = "Mann Co. Sticky Bomb"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.STICKYBOMB = "This'll put up quite the Scottish Resistance."GLOBAL.STRINGS.RECIPE_DESC.STICKYBOMB = "You appear to have trodden on a mine!"GLOBAL.STRINGS.NAMES.GEORGE = "George"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.GEORGE = "Hey pal! Where's Lenny and the rest of the gang?"GLOBAL.STRINGS.RECIPE_DESC.GEORGE = "The explodey pal of a certain Canopy Kingdom girl."GLOBAL.STRINGS.NAMES.SNAILBOMB = "Bombshell"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SNAILBOMB = "Dis how we blow up houses in the hood!"GLOBAL.STRINGS.RECIPE_DESC.SNAILBOMB = "A slurtle's house is in for property damage!"-- strings! Any "tina" below would have to be replaced by the prefab name of your character.-- The character select screen lines-- note: these are lower-case character nameGLOBAL.STRINGS.CHARACTER_TITLES.tina = "The World's Deadliest 13-Year Old"GLOBAL.STRINGS.CHARACTER_NAMES.tina = "Tina"  -- Note! This line is especially important as some parts of the game require                                            -- the character to have a valid name.GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.tina = "*Is a prodigy at Ordinance\n*Doesn't like spoiled food\n*Is a little screwy in the head..."GLOBAL.STRINGS.CHARACTER_QUOTES.tina = "\"Shorty, you da best!\""--STRINGS.CHARACTERS.tina=require "speech_tina"-- Let the game know sniper is a male, for proper pronouns during the end-game sequence.-- Possible genders here are MALE, FEMALE, or ROBOTtable.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "tina")AddModCharacter("tina")AddPrefabPostInit('bunnybomb')AddPrefabPostInit('badonkadonk')AddPrefabPostInit('george')AddPrefabPostInit('stickybomb')AddPrefabPostInit('snailbomb')AddSimPostInit(bunnybomb)AddSimPostInit(badonkadonk)AddSimPostInit(george)AddSimPostInit(stickybomb)AddSimPostInit(snailbomb)

 

 

 

 

Please let me know if you are willing to help me get this mod done, and help me point out what's wrong with the lua coding in them so I can fix the bugs. I've gone far enough to get as much as I can drawn and working, and I gotta get her done, but I need le help. It's costed me some sanity to get as much as I can done, so hopefully I can get it done before dem crawling horrors and terrorbeaks start chasing me....

Link to comment
Share on other sites

  • Developer

Hi i'm working on yet another custom character mod of silly ol' Tiny Tina from Borderlands 2

 

2013-10-30_00001_zps9661e789.jpg

 

 

I've gotten just about every aspect of her done, such as the picky eater thing like wickerbottom, her speech, and lower max sanity.

 

One thing I can't seem to get done is her special perk, The Ordinance Crafting Tab.

 

I've only got it about 60% complete per say, and I've hit a snag due to my noobiness at lua programming

 

I've managed to get the tab itself working, but the name doesn't show up when hovered over nor does the sticky bomb icon that it's supposed to have is there

 

Basically these are the items she can make

 

Bunny Bomb

It will basically be "cheap gunpowder" because all you need to make it is 2 nitre, 1 bunny, and 1 rope. It will function just like gunpowder, but only does half as much damage

 

2013-10-30_00002_zps9bd04390.jpg

 

Bombshell

This will basically be like gunpowder as well, but does 300 damage instead of 200. It is basically like harnessing the power of setting a slurtle on fire

 

2013-10-30_00005_zps100ab8f0.jpg

 

Badonkadonk

Again, same function as gunpowder, it will be the strongest bomb she can make, doing 500 damage

2013-10-30_00006_zps2df4c416.jpg

 

Mann Co. Sticky Bomb

She stole it from Tavish DeGroot didn't she? anyways this one will be a mine, just like the beemine cept it explodes instead of releasing bees. It also can't be stacked

 

2013-10-30_00003_zpsd77402a6.jpg

 

George

Another easter egg item, while I do think my Peacock mod deserves this item more, this one will basically be a bomb that auto lights when placed, similar to the Link mod by TheDanaAddams.

 

2013-10-30_00004_zpsaab165d4.jpg

 

Anyways, if you wanna take a closer look at what may be causing them to not be fully functional. here is tina's code

 

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/tina.zip" ),}local prefabs = { "bunnybomb", "badonkadonk", "stickybomb", "george", "snailbomb" }local start_inv = {"gunpowder", "gunpowder", "gunpowder", "gunpowder", "gunpowder", "gunpowder" }local fn = function(inst)	-- choose which sounds this character will play	inst.soundsname = "winnie"	-- a minimap icon must be specified	inst.MiniMapEntity:SetIcon( "winnie.png" )	inst.components.sanity:SetMax(TUNING.WILSON_SANITY * 0.8)    inst.components.eater.stale_hunger = TUNING.WICKERBOTTOM_STALE_FOOD_HUNGER    inst.components.eater.stale_health = TUNING.WICKERBOTTOM_STALE_FOOD_HEALTH    inst.components.eater.spoiled_hunger = TUNING.WICKERBOTTOM_SPOILED_FOOD_HUNGER    inst.components.eater.spoiled_health = TUNING.WICKERBOTTOM_SPOILED_FOOD_HEALTH	local ordinancetab = {str = "Ordinance", sort=999, icon = "ordinance.tex"}	inst.components.builder:AddRecipeTab(ordinancetab)	local s01Recipe = Recipe("bunnybomb", {Ingredient("rabbit", 1), Ingredient("rope", 1), Ingredient("nitre", 2)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s01Recipe.atlas = "images/inventoryimages/bunnybomb.xml"		local s02Recipe = Recipe("stickybomb", {Ingredient("flint", 6), Ingredient("gunpowder", 1), Ingredient("boards", 1)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s02Recipe.atlas = "images/inventoryimages/stickybomb.xml"		local s03Recipe = Recipe("george", {Ingredient("gears", 1), Ingredient("gunpowder", 1)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s03Recipe.atlas = "images/inventoryimages/george.xml"		local s04Recipe = Recipe("snailbomb", {Ingredient("slurtle_shellpieces", 4), Ingredient("slurtleslime", 2)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s04Recipe.atlas = "images/inventoryimages/snailbomb.xml"		local s05Recipe = Recipe("badonkadonk", {Ingredient("bunnybomb", 1), Ingredient("manrabbit_tail", 1), Ingredient("gunpowder", 2)}, ordinancetab, {SCIENCE = 0, MAGIC = 0, ANCIENT = 0})	s05Recipe.atlas = "images/inventoryimages/badonkadonk.xml"	end	-- todo: Add an example special power here.STRINGS.CHARACTER_TITLES.tina = "The World's Deadliest 13-Year Old"STRINGS.CHARACTER_NAMES.tina = "Tiny Tina"STRINGS.CHARACTER_DESCRIPTIONS.tina ="*Is a prodigy at Ordinance\n*Doesn't like spoiled food\n*Is a little screwy in the head..."STRINGS.CHARACTER_QUOTES.tina = "\"Shorty, you da best!\""-- You can also add any kind of custom dialogue that you would like. Don't forget to make-- categores that don't exist yet using = {}-- note: these are UPPER-CASE charcacter nameSTRINGS.CHARACTERS.TINA = require "speech_tina"return MakePlayerCharacter("tina", prefabs, assets, fn, start_inv)

 

I'm not entirely sure why the icon and mouseover for the ordinance tab isn't showing up

 

also here's the code for the badonkadonk, bunny bomb, and bombshell, just replace badonkadonk with the respective bunnybomb and snailbomb and the damage set for the others. for some reason these are invisible when I put them on the ground, and can't be lit....

 

local assets ={	Asset("ANIM", "anim/badonkadonk.zip"),    Asset("ATLAS", "images/inventoryimages/badonkadonk.xml"),    Asset("ANIM", "anim/explode.zip"),}local prefabs ={    "explode_small"}local function OnIgniteFn(inst)    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_fuse_LP", "hiss")endlocal function OnExplodeFn(inst)    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()    inst.entity:AddSoundEmitter()    MakeInventoryPhysics(inst)    inst.AnimState:SetBank("slurtleslime")    inst.AnimState:SetBuild("badonkadonk")    inst.AnimState:PlayAnimation("idle")        inst:AddComponent("stackable")	inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM    inst:AddComponent("inspectable")    	MakeSmallBurnable(inst, 3+math.random()*3)    MakeSmallPropagator(inst)    inst:AddComponent("explosive")    inst.components.explosive:SetOnExplodeFn(OnExplodeFn)    inst.components.explosive:SetOnIgniteFn(OnIgniteFn)    inst.components.explosive.explosivedamage = TUNING.SLURTLESLIME_EXPLODE_DAMAGE*10        inst:AddComponent("inventoryitem")    inst.components.inventoryitem.atlasname = "images/inventoryimages/badonkadonk.xml"    return instendreturn Prefab( "common/inventory/badonkadonk", fn, assets, prefabs) 

 

Here's the code for George, I basically copied it from the bombs in the Link mod, and I was even able to get him to work earlier, but for some reason he crashes the game now....

 

local assets={	Asset("ANIM", "anim/george.zip"),	Asset("ANIM", "anim/explode.zip"),	Asset("ATLAS", "images/inventoryimages/george.xml")}local prefabs ={    "explode_small"}local function OnExplodeFn(inst)    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()	inst.entity:AddSoundEmitter()		    MakeInventoryPhysics(inst)        inst.AnimState:SetBank("heat_rock")    inst.AnimState:SetBuild("george")    inst.AnimState:PlayAnimation(3)    inst.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )        inst:AddComponent("inspectable")    inst:AddComponent("stackable")	inst.components.stackable.maxsize = 40MakeSmallBurnable(inst, 0.1)--    MakeSmallPropagator(inst)    inst:AddComponent("explosive")    inst.components.explosive:SetOnExplodeFn(OnExplodeFn)--    inst.components.explosive:SetOnIgniteFn(OnIgniteFn)    inst.components.explosive.explosivedamage = (TUNING.GUNPOWDER_DAMAGE * 1.5)        inst:AddComponent("inventoryitem")  	 inst.components.inventoryitem.atlasname = "images/inventoryimages/george.xml"		inst:AddComponent("singledroppable")-- inst:AddComponent("burnable")	--	  inst:ListenForEvent("ondropped", function(inst)	  	  inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_fuse_LP", "hiss")--	  inst.components.burnable.burning = true--	  inst:AddTag("fire")--	  inst:PushEvent("onignite")--	  inst.components.explosive:OnIgnite()	            ------------------------------          inst:DoTaskInTime(0.8, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)          ------------------------------          inst:DoTaskInTime(1.6, function(inst)--            print "Animation state 5"                inst.AnimState:PlayAnimation(5)	         end, inst)          ------------------------------          inst:DoTaskInTime(2.4, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)          ------------------------------          inst:DoTaskInTime(3.2, function(inst)--            print "Animation state 5"                inst.AnimState:PlayAnimation(5)	         end, inst)          ------------------------------          inst:DoTaskInTime(3.5, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)          ------------------------------          inst:DoTaskInTime(3.8, function(inst)--            print "Animation state 5"                inst.AnimState:PlayAnimation(5)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.1, function(inst)--            print "Animation state 3"                inst.AnimState:PlayAnimation(3)	         end, inst)                    ------------------------------          inst:DoTaskInTime(4.2, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.3, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.4, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.5, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.6, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.7, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.8, function(inst)--            print "Animation state 4"                inst.AnimState:PlayAnimation(4)	         end, inst)          ------------------------------          inst:DoTaskInTime(4.9, function(inst)--            print "Animation state 2"                inst.AnimState:PlayAnimation(2)	         end, inst)	                   ------------------------------          inst:DoTaskInTime(5, function(inst)--          print "Animation state 1"                inst.AnimState:PlayAnimation(1)--            print "I am lighter!"--                inst:AddComponent("lighter")        if not inst.components.burnable:IsBurning() then                inst.components.burnable:Ignite()        end--                inst.components.explosive:OnIgnite()--            inst.components.explosive:OnExplodeFn(inst)-----------------------------------------------------------------------------    local pos = Vector3(inst.Transform:GetWorldPosition())--    inst.SoundEmitter:KillSound("hiss")--    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")--    local explode = SpawnPrefab("explode_small")--    local pos = inst:GetPosition()--    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")--    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )--    explode.AnimState:SetLightOverride(1)    --    inst.PushEvent("explosion", {explosive = inst.george})--    inst:remove---------------------------------------------------------------------------	         end, inst)          --------------------------------          inst:DoTaskInTime(5.1, function(inst)--            print "no more lighter"--                inst:RemoveComponent("lighter")--	         end, inst)end) -- 		return instendreturn Prefab( "common/inventory/george", fn, assets, prefabs) 

 

Right now the sticky bomb is just using "dummied" coding that's the same as the badonkadonk so I could get that pic, I've tried taking the code from both the beemine and the gunpower to make this, but I don't think i'm doing it right because the game will crash when it tires to run

 

local assets={	Asset("ANIM", "anim/stickybomb.zip"),    Asset("SOUND", "sound/bee.fsb"),}local prefabs = {    "bee",	"mosquito",    "explode_small",}local function SpawnBees(inst)    inst.SoundEmitter:PlaySound("dontstarve/bee/beemine_explo")    local target = inst.components.mine and inst.components.mine:GetTarget()    if target and target:IsValid() then        for i = 1, TUNING.BEEMINE_BEES do            local bee = SpawnPrefab(inst.beeprefab)            if bee then                local pos = Vector3(inst.Transform:GetWorldPosition() )                local dist = math.random()                local angle = math.random()*2*PI                pos.x = pos.x + dist*math.cos(angle)                pos.z = pos.z + dist*math.sin(angle)                bee.Physics:Teleport(pos:Get() )                if bee.components.combat then                    bee.components.combat:SetTarget(target)                end            end        end        target:PushEvent("coveredinbees")    end    inst:RemoveComponent("mine")endlocal function OnExplode(inst)    inst.AnimState:PlayAnimation("explode")    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function onhammered(inst, worker)	if inst.components.mine then	    inst.components.mine:Explode(worker)	endendlocal function MineRattle(inst)    inst.AnimState:PlayAnimation("hit")    inst.AnimState:PushAnimation("idle")    inst.SoundEmitter:PlaySound("dontstarve/bee/beemine_rattle")    inst.rattletask = inst:DoTaskInTime(4 + math.random(), MineRattle)endlocal function StartRattling(inst)    inst.rattletask = inst:DoTaskInTime(1, MineRattle)endlocal function StopRattling(inst)    if inst.rattletask then        inst.rattletask:Cancel()        inst.rattletask = nil    endendlocal function ondeploy(inst, pt, deployer)	inst.components.mine:Reset()	inst.Physics:Teleport(pt:Get())	StartRattling(inst)endlocal function SetInactive(inst)	inst.AnimState:PlayAnimation("inactive")	StopRattling(inst)endlocal function OnDropped(inst)	inst.components.mine:Deactivate()endlocal function MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory)	local function fn()		local inst = CreateEntity()		local trans = inst.entity:AddTransform()		local anim = inst.entity:AddAnimState()		inst.entity:AddSoundEmitter()		MakeInventoryPhysics(inst)				local minimap = inst.entity:AddMiniMapEntity()		minimap:SetIcon( "beemine.png" )	   		anim:SetBank(skin)		anim:SetBuild(skin)		anim:PlayAnimation("idle")				inst:AddTag("mine")		inst:AddComponent("mine")		inst.components.mine:SetOnExplodeFn(OnExplode)		inst.components.mine:SetAlignment(alignment)		inst.components.mine:SetRadius(TUNING.BEEMINE_RADIUS)		inst.components.mine:SetOnDeactivateFn(SetInactive)				inst.components.mine:StartTesting()		inst.beeprefab = spawnprefab				inst:AddComponent("inspectable")		inst:AddComponent("lootdropper")		inst:AddComponent("workable")		inst.components.workable:SetWorkAction(ACTIONS.HAMMER)		inst.components.workable:SetWorkLeft(1)		inst.components.workable:SetOnFinishCallback(onhammered)    inst:AddComponent("explosive")    inst.components.explosive:SetOnExplodeFn(OnExplodeFn)    inst.components.explosive:SetOnIgniteFn(OnIgniteFn)    inst.components.explosive.explosivedamage = TUNING.GUNPOWDER_DAMAGE    inst.components.explosive.buildingdamage = 1    inst.components.explosive.lightonexplode = false    --[[local light = inst.entity:AddLight()    light:SetFalloff(0.7)    light:SetIntensity(.1)    light:SetRadius(0.1)    light:SetColour(237/255, 237/255, 209/255)    light:Enable(true)    --]]				if inventory then			inst:AddComponent("inventoryitem")			inst.components.inventoryitem.nobounce = true			inst.components.inventoryitem:SetOnPutInInventoryFn(StopRattling)			inst.components.inventoryitem:SetOnDroppedFn(OnDropped)						inst:AddComponent("deployable")			inst.components.deployable.ondeploy = ondeploy			inst.components.deployable.min_spacing = .75		else			StartRattling(inst)		end				--inst:AddComponent("trap")				return inst	end	return fnendlocal function BeeMine(name, alignment, skin, spawnprefab, inventory)	return Prefab( "common/inventory/"..name, MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory), assets, prefabs)endreturn BeeMine("beemine", "player", "bee_mine", "bee", true),		MakePlacer("common/beemine_placer", "stickybomb", "stickybomb", "idle"),

 

and just if I need to change something and you can point it out, here is here modmain

 

local STRINGS = GLOBAL.STRINGSlocal Ingredient = GLOBAL.Ingredientlocal RECIPETABS = GLOBAL.RECIPETABSPrefabFiles = {	"tina",	"badonkadonk",	"bunnybomb",	"george",	"snailbomb",	"stickybomb",}Assets = {    Asset( "IMAGE", "images/saveslot_portraits/tina.tex" ),    Asset( "ATLAS", "images/saveslot_portraits/tina.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/tina.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/tina.xml" ),    Asset( "IMAGE", "images/selectscreen_portraits/tina_silho.tex" ),    Asset( "ATLAS", "images/selectscreen_portraits/tina_silho.xml" ),    Asset( "IMAGE", "bigportraits/tina.tex" ),    Asset( "ATLAS", "bigportraits/tina.xml" ),}GLOBAL.STRINGS.TABS.ORDINANCETAB = "Ordinance"GLOBAL.STRINGS.NAMES.BUNNYBOMB = "Bunny Bomb"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.BUNNYBOMB = "He in fo' some fun."GLOBAL.STRINGS.RECIPE_DESC.BUNNYBOMB = "There's gonna be bunny guts everywhere!"GLOBAL.STRINGS.NAMES.BADONKADONK = "Badonkadonk"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.BADONKADONK = "Mushy Snugglebites got a gut full of dynamite and a booty like POW!"GLOBAL.STRINGS.RECIPE_DESC.BADONKADONK = "Who the hell is Mushy Snugglebites?!"GLOBAL.STRINGS.NAMES.STICKYBOMB = "Mann Co. Sticky Bomb"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.STICKYBOMB = "This'll put up quite the Scottish Resistance."GLOBAL.STRINGS.RECIPE_DESC.STICKYBOMB = "You appear to have trodden on a mine!"GLOBAL.STRINGS.NAMES.GEORGE = "George"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.GEORGE = "Hey pal! Where's Lenny and the rest of the gang?"GLOBAL.STRINGS.RECIPE_DESC.GEORGE = "The explodey pal of a certain Canopy Kingdom girl."GLOBAL.STRINGS.NAMES.SNAILBOMB = "Bombshell"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SNAILBOMB = "Dis how we blow up houses in the hood!"GLOBAL.STRINGS.RECIPE_DESC.SNAILBOMB = "A slurtle's house is in for property damage!"-- strings! Any "tina" below would have to be replaced by the prefab name of your character.-- The character select screen lines-- note: these are lower-case character nameGLOBAL.STRINGS.CHARACTER_TITLES.tina = "The World's Deadliest 13-Year Old"GLOBAL.STRINGS.CHARACTER_NAMES.tina = "Tina"  -- Note! This line is especially important as some parts of the game require                                            -- the character to have a valid name.GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.tina = "*Is a prodigy at Ordinance\n*Doesn't like spoiled food\n*Is a little screwy in the head..."GLOBAL.STRINGS.CHARACTER_QUOTES.tina = "\"Shorty, you da best!\""--STRINGS.CHARACTERS.tina=require "speech_tina"-- Let the game know sniper is a male, for proper pronouns during the end-game sequence.-- Possible genders here are MALE, FEMALE, or ROBOTtable.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "tina")AddModCharacter("tina")AddPrefabPostInit('bunnybomb')AddPrefabPostInit('badonkadonk')AddPrefabPostInit('george')AddPrefabPostInit('stickybomb')AddPrefabPostInit('snailbomb')AddSimPostInit(bunnybomb)AddSimPostInit(badonkadonk)AddSimPostInit(george)AddSimPostInit(stickybomb)AddSimPostInit(snailbomb)

 

 

 

 

Please let me know if you are willing to help me get this mod done, and help me point out what's wrong with the lua coding in them so I can fix the bugs. I've gone far enough to get as much as I can drawn and working, and I gotta get her done, but I need le help. It's costed me some sanity to get as much as I can done, so hopefully I can get it done before dem crawling horrors and terrorbeaks start chasing me....

If you upload what you have so far, I can take a look.

 

Ashley Burch is the best!

Link to comment
Share on other sites

  • Developer

http://www.mediafire.com/?frw4trd0l5rgydz

 

here ye go, I included some of the psds on the bombs if any sort of tex needed to be changed and the folder bombs2 contains the lua for some older attempts, as well as the one on the stickybomb being a mine

There's four small changes I had to do to make to 'tina.lua' the icon and the name appear.  I added the atlas and texture to the list of assets.  I added the name of the tab to the list of string tabs and I specified the atlas in the list of properties for the tab.

 

Here's the new 'tina.lua' along with a screenshot :-).

 

tina.zip

 

post-283016-0-14670200-1383200499_thumb.

Link to comment
Share on other sites

I'm already trying to copy some of the coding for link's bombs to get George to function the same way, but for some reason he crashes the game. The other bombs won't work that way and need to be lit. And the sticky bomb will be an explosive mine.

whats the log.txt saying?

Link to comment
Share on other sites

I'll keep that in mind. but what about the other ones? they seem to be invisible, even though they should function like gunpowder, I can only pick them up by pressing the spacebar. also what kind of script would I make to make the stickybomb functional?

Link to comment
Share on other sites

Welp, thanks so Cheerio and CollenMcCLeod I was able to get her other bombs to be fully functional. The one last hurdle before she's ready is, The damn sticky bomb. I'm using some modded coding from the beemine to get it to work, so far it does explode instantly when lit (which i'm planning) but when stepped on, it sorta explodes. It just booms, but it does no damage, nor does the bomb get turned into ashes like it should be. I can tell from the coding that it essentially needs to light itself to get the proper explosion effect, but even though i'm putting a listen for event statement, it doesn't seem to work...

 

 

local assets={	Asset("ANIM", "anim/stickybomb.zip"),    Asset("ATLAS", "images/inventoryimages/stickybomb.xml"),    Asset("ANIM", "anim/explode.zip"),    Asset("SOUND", "sound/bee.fsb"),}local prefabs = {    "bee",	"explode_small",}local function OnIgniteFn(inst)    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_fuse_LP", "hiss")endlocal function OnExplode(inst)--        if not inst.components.burnable:IsBurning() then  --              inst.components.burnable:Ignite()	--		         end, inst)    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function onhammered(inst, worker)	if inst.components.mine then	    inst.components.mine:Explode(worker)	endendlocal function MineRattle(inst)    inst.AnimState:PlayAnimation("hit")    inst.AnimState:PushAnimation("idle")    inst.SoundEmitter:PlaySound("dontstarve/bee/beemine_rattle")    inst.rattletask = inst:DoTaskInTime(4 + math.random(), MineRattle)endlocal function StartRattling(inst)    inst.rattletask = inst:DoTaskInTime(1, MineRattle)endlocal function StopRattling(inst)    if inst.rattletask then        inst.rattletask:Cancel()        inst.rattletask = nil    endendlocal function ondeploy(inst, pt, deployer)	inst.components.mine:Reset()	inst.Physics:Teleport(pt:Get())	StartRattling(inst)endlocal function SetInactive(inst)	inst.AnimState:PlayAnimation("inactive")	StopRattling(inst)endlocal function OnDropped(inst)	inst.components.mine:Deactivate()endlocal function MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory)	local function fn()		local inst = CreateEntity()		local trans = inst.entity:AddTransform()		local anim = inst.entity:AddAnimState()		inst.entity:AddSoundEmitter()		MakeInventoryPhysics(inst)				local minimap = inst.entity:AddMiniMapEntity()		minimap:SetIcon( "beemine.png" )	   		anim:SetBank("bee_mine")		anim:SetBuild("stickybomb")		anim:PlayAnimation("idle")			MakeSmallBurnable(inst, 0.1)    MakeSmallPropagator(inst)		inst:AddTag("mine")		inst:AddComponent("mine")	        inst:AddComponent("explosive")		inst.components.mine:SetOnExplodeFn(OnExplode)	        inst.components.explosive:SetOnIgniteFn(OnIgniteFn)   		inst.components.explosive.explosivedamage = TUNING.GUNPOWDER_DAMAGE		inst.components.mine:SetAlignment(alignment)		inst.components.mine:SetRadius(TUNING.BEEMINE_RADIUS)			inst.components.mine:SetOnDeactivateFn(SetInactive)				inst.components.mine:StartTesting()		inst.beeprefab = spawnprefab				inst:AddComponent("inspectable")		inst:AddComponent("lootdropper")		inst:AddComponent("workable")		inst.components.workable:SetWorkAction(ACTIONS.HAMMER)		inst.components.workable:SetWorkLeft(1)		inst.components.workable:SetOnFinishCallback(onhammered)				if inventory then			inst:AddComponent("inventoryitem")    			inst.components.inventoryitem.atlasname = "images/inventoryimages/stickybomb.xml"			inst.components.inventoryitem.nobounce = true			inst.components.inventoryitem:SetOnPutInInventoryFn(StopRattling)			inst.components.inventoryitem:SetOnDroppedFn(OnDropped)						inst:AddComponent("deployable")			inst.components.deployable.ondeploy = ondeploy			inst.components.deployable.min_spacing = .75		else			StartRattling(inst)		end				--inst:AddComponent("trap")	  inst:ListenForEvent("onexplode", function(inst)        if not inst.components.burnable:IsBurning() then                inst.components.burnable:Ignite()        end			         end, inst)				return inst	end		return fnend	local function BeeMine(name, alignment, skin, spawnprefab, inventory)return Prefab( "common/inventory/stickybomb", MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory), assets, prefabs)end return BeeMine("stickybomb", "player", "stickybomb", "bee", true)

 

Right now too, it needs some of that beemine code to run properly, It kinda garbages the console with some can't find stickybomb_placer error though... but it doesn't ruin anything else.

 

Get her files here if you need to take an even closer look http://www.mediafire.com/download/frw4trd0l5rgydz/tina.zip

Link to comment
Share on other sites

By setting the mine component's OnExplodeFn to your local OnExplode, you're bypassing the explosive component entirely and just playing the explosion effects. Instead, you should do something like this:

 

local function OnMineExplode( inst )	if inst.components.burnable and not inst.components.burnable:IsBurning() then		inst.components.burnable:Ignite()	endend-- in the fn functioninst.components.mine:SetOnExplodeFn(OnMineExplode)inst.components.explosive:SetOnExplodeFn(OnExplode)
Link to comment
Share on other sites

That seems to make it explode the moment it's placed on the ground....

Works fine on my end.

local assets={	Asset("ANIM", "anim/stickybomb.zip"),    Asset("ATLAS", "images/inventoryimages/stickybomb.xml"),    Asset("ANIM", "anim/explode.zip"),    Asset("SOUND", "sound/bee.fsb"),}local prefabs = {    "bee",	"explode_small",}local function OnIgniteFn(inst)    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_fuse_LP", "hiss")endlocal function OnMineExplode( inst )    if inst.components.burnable and not inst.components.burnable:IsBurning() then        inst.components.burnable:Ignite()    endendlocal function OnExplode(inst)    local pos = Vector3(inst.Transform:GetWorldPosition())    inst.SoundEmitter:KillSound("hiss")    inst.SoundEmitter:PlaySound("dontstarve/common/blackpowder_explo")    local explode = SpawnPrefab("explode_small")    local pos = inst:GetPosition()    explode.Transform:SetPosition(pos.x, pos.y, pos.z)    --local explode = PlayFX(pos,"explode", "explode", "small")    explode.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )    explode.AnimState:SetLightOverride(1)endlocal function onhammered(inst, worker)	if inst.components.mine then	    inst.components.mine:Explode(worker)	endendlocal function MineRattle(inst)    inst.AnimState:PlayAnimation("hit")    inst.AnimState:PushAnimation("idle")    inst.SoundEmitter:PlaySound("dontstarve/bee/beemine_rattle")    inst.rattletask = inst:DoTaskInTime(4 + math.random(), MineRattle)endlocal function StartRattling(inst)    inst.rattletask = inst:DoTaskInTime(1, MineRattle)endlocal function StopRattling(inst)    if inst.rattletask then        inst.rattletask:Cancel()        inst.rattletask = nil    endendlocal function ondeploy(inst, pt, deployer)	inst.components.mine:Reset()	inst.Physics:Teleport(pt:Get())	StartRattling(inst)endlocal function SetInactive(inst)	inst.AnimState:PlayAnimation("inactive")	StopRattling(inst)endlocal function OnDropped(inst)	inst.components.mine:Deactivate()endlocal function MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory)	local function fn()		local inst = CreateEntity()		local trans = inst.entity:AddTransform()		local anim = inst.entity:AddAnimState()		inst.entity:AddSoundEmitter()		MakeInventoryPhysics(inst)				local minimap = inst.entity:AddMiniMapEntity()		minimap:SetIcon( "beemine.png" )	   		anim:SetBank("bee_mine")		anim:SetBuild("stickybomb")		anim:PlayAnimation("idle")				MakeSmallBurnable(inst, 0.1)		MakeSmallPropagator(inst)		inst:AddComponent("explosive")		inst.components.explosive:SetOnIgniteFn(OnIgniteFn)		inst.components.explosive:SetOnExplodeFn(OnExplode)   		inst.components.explosive.explosivedamage = TUNING.GUNPOWDER_DAMAGE		inst:AddTag("mine")		inst:AddComponent("mine")		inst.components.mine:SetOnExplodeFn(OnMineExplode)		inst.components.mine:SetAlignment(alignment)		inst.components.mine:SetRadius(TUNING.BEEMINE_RADIUS)			inst.components.mine:SetOnDeactivateFn(SetInactive)				inst.components.mine:StartTesting()		inst.beeprefab = spawnprefab				inst:AddComponent("inspectable")		inst:AddComponent("lootdropper")		inst:AddComponent("workable")		inst.components.workable:SetWorkAction(ACTIONS.HAMMER)		inst.components.workable:SetWorkLeft(1)		inst.components.workable:SetOnFinishCallback(onhammered)				if inventory then			inst:AddComponent("inventoryitem")    			inst.components.inventoryitem.atlasname = "images/inventoryimages/stickybomb.xml"			inst.components.inventoryitem.nobounce = true			inst.components.inventoryitem:SetOnPutInInventoryFn(StopRattling)			inst.components.inventoryitem:SetOnDroppedFn(OnDropped)						inst:AddComponent("deployable")			inst.components.deployable.ondeploy = ondeploy			inst.components.deployable.min_spacing = .75		else			StartRattling(inst)		end				--inst:AddComponent("trap")		inst:ListenForEvent("onexplode", function(inst)	        if not inst.components.burnable:IsBurning() then	            inst.components.burnable:Ignite()	        end		end, inst)				return inst	end		return fnend	local function BeeMine(name, alignment, skin, spawnprefab, inventory)return Prefab( "common/inventory/stickybomb", MakeBeeMineFn(name, alignment, skin, spawnprefab, inventory), assets, prefabs)end return BeeMine("stickybomb", "player", "stickybomb", "bee", true)
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...