Jump to content

[Character] The Batter - Off


StormyRange

Recommended Posts

Introducing;

screen1.jpg

The Batter, from the awesome free RPG Maker game, "OFF" by Mortis Ghost!

 

The Batter has:
180 HP

100 Hunger (Depletes slowly)

80 Sanity

-Hits harder than average.
-Comes with a bat to purify the world:
 - Has sanity gain when equipped.
 - Does slightly more damage than a spear.
 - Doesn't break.

-Craftable Addons Alpha, Omega and Epsilon, you can then craft them together for Addon armour. (Refine tab)
-Loses less sanity to darkness but more to impure adversaries.
-Is slightly insulated. (30 inherent insulation)
-Custom sound and 8 tracks of music.

-Every single line of dialogue customized (suggestions and improvements welcome from fans of OFF).

 

Known bugs:
-Custom music doesn't stop on death and doesn't fade in/out.
-The music will replace the original music if you play as The Batter then as another character without quitting the game, disable the mod or quit the game before playing as a different character to fix this for now.
-Epicfight music doesn't play during bossfights.

 

Screenshots:

screen2.jpg

screen3.jpg

screen4.jpg

screen5.jpg

screen6.jpg

 

 

Download

Now on Steam Workshop! (Thanks Cheerio)

Link to comment
Share on other sites

Hehe nice work ^^

 

Known bugs:
-The music will replace the original music even when not playing as The Batter, disable the mod to fix this for now.

About that, I would suggest to check the charcters prefab in a PostSimInit and only remap the sound accordingly, I don't know though if that actually works.

Link to comment
Share on other sites

That sounds like it should be possible - though I've not yet been able to work with sound, due to the lack of Mac-compatible tools.

 

Here's how Link calls the SimPostInit, as long as the player is Link:

AddSimPostInit(function(inst)        if inst.prefab == "link" then                LinkPostInit(inst)        endend)

 

And of course, before that, you need to give it the code to use in the PostInit with

function LinkPostInit(link)<CODE HERE>end
Link to comment
Share on other sites

Thanks for the positive reception people :3

Also thanks for the code there, I tried it and it half works for me; testing it I found if I play Wilson first, the music is normal, but if I play The Batter, then change save file without quitting to Wilson then the music is still replaced =o

Here's the full music code I'm using, I'm probably using an excessive amount but I wanted to be sure it'd cut out and come in like Danger music and wouldn't continuously play (although it doesn't fade in/out or off at the map screen yet)

function LinkPostInit(batter)
---Music replacements
RemapSoundEvent( "dontstarve/music/music_danger", "batter/music/danger" )
----Music dynamics
local DynamicMusic = Class(function(self, inst)
    self.enabled = true

    self.is_busy = false
    self.busy_timeout = 0
    
    self.playing_danger = false
end)

function DynamicMusic:OnStartDanger()

    if not self.enabled then return end
    
    self.danger_timeout = 10
    if not self.playing_danger then
        local epic = GetClosestInstWithTag("epic", self.inst, 30)
        local soundpath = nil
        
        if epic then
            soundpath = "dontstarve/music/music_epicfight"
        elseif GetWorld():IsCave() then
            soundpath = "dontstarve/music/music_danger_cave"
        else
            soundpath = "dontstarve/music/music_danger"
        end

        self.inst.SoundEmitter:PlaySound(soundpath, "danger")
        self:StopPlayingBusy()
        self.playing_danger = true
    end
end


        function DynamicMusic:StopPlayingDanger()
    self.inst.SoundEmitter:KillSound("danger")
    self.playing_danger = false
end
        
        function DynamicMusic:OnUpdate(dt)

    if self.danger_timeout and self.danger_timeout > 0 then
        self.danger_timeout = self.danger_timeout - dt
        if self.danger_timeout <= 0 then
            self:StopPlayingDanger()
        end
    end

    if self.busy_timeout and self.busy_timeout > 0 then
        self.busy_timeout = self.busy_timeout - dt
        if self.busy_timeout <= 0 then
            self:StopPlayingBusy()
            self.is_busy = false
        end
    end
end
end

AddSimPostInit(function(inst)
        if inst.prefab == "batter" then
                LinkPostInit(inst)
        end
end)

I wasn't sure if the LinkPostInit was from Link's name or was part of the code so I left it to be safe... I only started looking at Lua like 3 days ago and my only coded experience is using Multimedia Fusion 2 to make games and HTML :,U

Link to comment
Share on other sites

My code experience prior to Don't Starve was a bit of MEL scripting. |D

 

The LinkPostInit could be any name - so feel free to change it to BatterPostInit. =)

 

My guess would be that sound is a bit more fussy... I would try doing something like:

        if inst.prefab == "batter" then                BatterPostInit(inst)        else                NotBatterPostInit(inst)        end

 

So you'd have to make a NotBatterPostInit that resets everything to what it was before BatterPostInit.

 

I'm not 100% on this - but that's what I would try, if I were doing it. =)

Link to comment
Share on other sites

My code experience prior to Don't Starve was a bit of MEL scripting. |D

 

The LinkPostInit could be any name - so feel free to change it to BatterPostInit. =)

 

My guess would be that sound is a bit more fussy... I would try doing something like:

        if inst.prefab == "batter" then                BatterPostInit(inst)        else                NotBatterPostInit(inst)        end

So you'd have to make a NotBatterPostInit that resets everything to what it was before BatterPostInit.

 

I'm not 100% on this - but that's what I would try, if I were doing it. =)

Thanks a lot but hm I tried it but I'm still getting the same thing =o

RemapSoundEvent( "dontstarve/characters/batter/death_voice", "batter/characters/batter/death_voice" )

RemapSoundEvent( "dontstarve/characters/batter/hurt", "batter/characters/batter/hurt" )

RemapSoundEvent( "dontstarve/characters/batter/talk_LP", "batter/characters/batter/talk_LP" )

function BatterPostInit(batter)

---Music replacements

RemapSoundEvent( "dontstarve/music/music_danger", "batter/music/danger" )

----Music dynamics

local DynamicMusic = Class(function(self, inst)

    self.enabled = true

    self.is_busy = false

    self.busy_timeout = 0

    

    self.playing_danger = false

end)

function DynamicMusic:OnStartDanger()

    if not self.enabled then return end

    

    self.danger_timeout = 10

    if not self.playing_danger then

        local epic = GetClosestInstWithTag("epic", self.inst, 30)

        local soundpath = nil

        

        if epic then

            soundpath = "dontstarve/music/music_epicfight"

        elseif GetWorld():IsCave() then

            soundpath = "dontstarve/music/music_danger_cave"

        else

            soundpath = "dontstarve/music/music_danger"

        end

        self.inst.SoundEmitter:PlaySound(soundpath, "danger")

        self:StopPlayingBusy()

        self.playing_danger = true

    end

end

        function DynamicMusic:StopPlayingDanger()

    self.inst.SoundEmitter:KillSound("danger")

    self.playing_danger = false

end

        

        function DynamicMusic:OnUpdate(dt)

    if self.danger_timeout and self.danger_timeout > 0 then

        self.danger_timeout = self.danger_timeout - dt

        if self.danger_timeout <= 0 then

            self:StopPlayingDanger()

        end

    end

    if self.busy_timeout and self.busy_timeout > 0 then

        self.busy_timeout = self.busy_timeout - dt

        if self.busy_timeout <= 0 then

            self:StopPlayingBusy()

            self.is_busy = false

        end

    end

end

end

------------------------------------------------------------------------If not playing as The Batter

function NotBatterPostInit(batter)

---Music replacements

RemapSoundEvent( "dontstarve/music/music_danger", "dontstarve/music/music_danger" )

----Music dynamics

local DynamicMusic = Class(function(self, inst)

    self.enabled = true

    self.is_busy = false

    self.busy_timeout = 0

    

    self.playing_danger = false

end)

function DynamicMusic:OnStartDanger()

    if not self.enabled then return end

    

    self.danger_timeout = 10

    if not self.playing_danger then

        local epic = GetClosestInstWithTag("epic", self.inst, 30)

        local soundpath = nil

        

        if epic then

            soundpath = "dontstarve/music/music_epicfight"

        elseif GetWorld():IsCave() then

            soundpath = "dontstarve/music/music_danger_cave"

        else

            soundpath = "dontstarve/music/music_danger"

        end

        self.inst.SoundEmitter:PlaySound(soundpath, "danger")

        self:StopPlayingBusy()

        self.playing_danger = true

    end

end

        function DynamicMusic:StopPlayingDanger()

    self.inst.SoundEmitter:KillSound("danger")

    self.playing_danger = false

end

        

        function DynamicMusic:OnUpdate(dt)

    if self.danger_timeout and self.danger_timeout > 0 then

        self.danger_timeout = self.danger_timeout - dt

        if self.danger_timeout <= 0 then

            self:StopPlayingDanger()

        end

    end

    if self.busy_timeout and self.busy_timeout > 0 then

        self.busy_timeout = self.busy_timeout - dt

        if self.busy_timeout <= 0 then

            self:StopPlayingBusy()

            self.is_busy = false

        end

    end

end

end

AddSimPostInit(function(inst)

        if inst.prefab == "batter" then

                BatterPostInit(inst)

                        else

                NotBatterPostInit(inst)

        end

end)

GetPlayer = GLOBAL.GetPlayer

table.insert(GLOBAL.CHARACTER_GENDERS.MALE, "batter")

AddModCharacter("batter")

It's not too big of a deal but it'd be nice to have it work properly.

 

Same with the not-being-able-to-submit-to-Steam-Workshop but I'm hoping someone'll think of something D:

It's just weird because really my mod should be maybe 1.5mb but the fsb file is huge for no reason... It's bothering me because I can't get it on Workshop or upload it to the downloads here :c

Size problem fixed thanks to Cheerio! :3

Link to comment
Share on other sites

Reviving because there's an upcoming update for this mod but there's something I can't seem to fix.

Basically the circles behind The Batter in the portrait art are companions called Add-ons, they are Alpha, Omega and Epsilon. I've made it so you can craft each of them then combine them with 2 other items to make them a equipable item (all 3 at once).

I used some of DanaAddams coding for this (I hope that's okay, will add a link to your Link mod in the readme).

Problem is that the armor/addons don't show up on the Batter when equiped, I used a combination of coding from one of the tunics (Link) and the armour_wood (a default armour)

local assets=
{
    Asset("ANIM", "anim/addons.zip"),
  Asset("ATLAS", "images/inventoryimages/addons.xml")
}

local function OnBlocked(owner)
    owner.SoundEmitter:PlaySound("dontstarve/wilson/hit_armour")
end

local function onequip(inst, owner)
    owner.AnimState:OverrideSymbol("swap_body", "addons", "swap_body")
    inst:ListenForEvent("blocked", OnBlocked, owner)
end

local function onunequip(inst, owner)
    owner.AnimState:ClearOverrideSymbol("swap_body")
    inst:RemoveEventCallback("blocked", OnBlocked, owner)
end

local function onequip(inst, owner)
        if owner.components.hunger then
        owner.components.hunger.burnrate = TUNING.WILSON_HUNGER_RATE * 1.5
end
end
    
local function fn(Sim)
    local inst = CreateEntity()
    
    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    MakeInventoryPhysics(inst)
    
    inst.AnimState:SetBank("armor_grass")
    inst.AnimState:SetBuild("addons")
    inst.AnimState:PlayAnimation("anim")

    inst:AddComponent("inspectable")
    
    inst:AddTag("irreplaceable")
    
    inst:AddComponent("inventoryitem")
      inst.components.inventoryitem.atlasname = "images/inventoryimages/addons.xml"
    
    inst:AddComponent("equippable")
    inst.components.equippable.equipslot = EQUIPSLOTS.BODY
    
    inst:AddComponent("armor")
    inst.components.armor:InitCondition(TUNING.ARMORWOOD * 1.5, TUNING.ARMORWOOD_ABSORPTION )
    
    inst:AddComponent("dapperness")
    inst.components.dapperness.dapperness = (TUNING.DAPPERNESS_MED * 1)

    inst.components.equippable:SetOnEquip( onequip )
    inst.components.equippable:SetOnUnequip( onunequip )
    
    return inst
end

return Prefab( "common/inventory/addons", fn, assets )

So yeah I'm fairly new to armor so I don't know what I've done wrong... Any suggestions are welcome =o

Link to comment
Share on other sites

It's the line

owner:AnimState:OverrideSymbol("swap_body", ....)

I'm not sure but I think the last two should be the bank and build of your armor. For best results you should compare it to the existing armours and take a look at the armorwood.zip. Hope that helps.

Link to comment
Share on other sites

No, that's not the problem... the code looks fine, to me... except for the fact that you don't have an anim.zip and a swap_anim.zip.

 

Equippables require two art files. swap_anim being the one that shows up when equipped, and anim being the one that shows on the ground.

I'm guessing you see it on the ground, when you drop it - you need to do another texture for the equipped state, and add that. At least, that's what I think the problem is.

 

And really, it's okay to snip bits of code from other mods and files. That's 90% of how you do this stuff, unless you're a professional programmer, and know exactly what you're doing. xD

This is how I write code for my mods:

tumblr_mt2mdoVTA11rjqddwo1_500.png

Link to comment
Share on other sites

I'm stupid and should really stop making posts from my mobile phone. Those always end up being not enough elaborated. Of course TheDanaAddams (is it okay if I call you Dana from now on?) is right, but the line

owner.AnimState:OverrideSymbol("swap_body", "addons", "swap_body")

is important. Override symbol needs to have the right input. If one of those so happens to be "addons" then it's fine of course, it just struck me as strange to call an armor-equip bank/build like that.

Link to comment
Share on other sites

I'm stupid and should really stop making posts from my mobile phone. Those always end up being not enough elaborated. Of course TheDanaAddams (is it okay if I call you Dana from now on?) is right, but the line

owner.AnimState:OverrideSymbol("swap_body", "addons", "swap_body")

is important. Override symbol needs to have the right input. If one of those so happens to be "addons" then it's fine of course, it just struck me as strange to call an armor-equip bank/build like that.

Dana is fine, really. =)

 

That line is fine - it's like that in all the armour files. I don't know exactly what it's specifying, but it works that way. =)

Link to comment
Share on other sites

That line is fine - it's like that in all the armour files. I don't know exactly what it's specifying, but it works that way. =)

As I said, the line is fine, just the naming confused me to thinking it was wrong.

owner.AnimState:OverrideSymbol("swap_body", "armor_grass", "swap_body")

"armor_grass" seems a lot more fitting than "addons", see what I mean  ; )

 

Dana is fine, really. =)

Now I'll just need to remember you told me that  ^^

Link to comment
Share on other sites

Hello @StormyRange!

 

The game crashes when you look at the portrait of your character.

 

Log:

scripts/mods.lua(141,1) Loading mod: batter (The Batter)scripts/mods.lua(165,1) Mod: batter (The Batter)	Loading modworldgenmain.lua	scripts/mods.lua(173,1) Mod: batter (The Batter)	  Mod had no modworldgenmain.lua. Skipping.	scripts/mods.lua(165,1) Mod: batter (The Batter)	Loading modmain.luascripts/mods.lua(255,1) Mod: batter (The Batter)	Registering prefabs	scripts/mods.lua(261,1) Mod: batter (The Batter)	  Registering prefab file: prefabs/batter	scripts/mods.lua(265,1) Mod: batter (The Batter)	    batter	scripts/mods.lua(261,1) Mod: batter (The Batter)	  Registering prefab file: prefabs/ofbat	scripts/mods.lua(265,1) Mod: batter (The Batter)	    ofbat	scripts/mods.lua(261,1) Mod: batter (The Batter)	  Registering prefab file: prefabs/alpha	scripts/mods.lua(265,1) Mod: batter (The Batter)	    alpha	scripts/mods.lua(261,1) Mod: batter (The Batter)	  Registering prefab file: prefabs/omega	scripts/mods.lua(265,1) Mod: batter (The Batter)	    omega	scripts/mods.lua(261,1) Mod: batter (The Batter)	  Registering prefab file: prefabs/epsilon	scripts/mods.lua(265,1) Mod: batter (The Batter)	    epsilon	scripts/mods.lua(261,1) Mod: batter (The Batter)	  Registering prefab file: prefabs/addons	scripts/mods.lua(265,1) Mod: batter (The Batter)	    addons	scripts/mods.lua(278,1) Mod: batter (The Batter)	  Registering default mod prefab	../mods/batter/images/saveslot_portraits/batter.tex is 120x104 but compressed textures must have power of 2 dimensions.../mods/batter/images/selectscreen_portraits/batter.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/batter/images/selectscreen_portraits/batter_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/batter/bigportraits/batter.tex is 560x720 but compressed textures must have power of 2 dimensions.

Thanks in advance :-)!

Link to comment
Share on other sites

The issue arises because you created those files with the DXT5 format, which - despite being the default format used by Klei - is known to be particularly buggy when using a converter, like TEXTool/Creator. If you are using that converter, make sure you choose ARGB as the format in the drop-down menu.

 

post-262695-0-87807600-1380345195.png

Link to comment
Share on other sites

The issue arises because you created those files with the DXT5 format, which - despite being the default format used by Klei - is known to be particularly buggy when using a converter, like TEXTool/Creator. If you are using that converter, make sure you choose ARGB as the format in the drop-down menu.

 

post-262695-0-87807600-1380345195.png

Oh I see, I'll do that now and update all the mods I've made, thank you =3

EDIT: Okay done that now, I hope it works n stuff =o

Link to comment
Share on other sites

Nice mod you did there! I'd like to see the batter transforming into his monster form, kind of like how Woody transform into a were beaver.

 

Would be great if he could at low/zero sanity or by beating up too many mobs.

Link to comment
Share on other sites

It'd be nice if with every boss purified, it's related element (slowly) ceases to exist, like killing a giant would mean that it's respective/related season will either be nonexistent, or just monochrome and silent. Killing a Spider Queen might kill off every single spider, killing a treeguard will cause a whole bunch of plants to disappear, and killing an Ancient Guardian would result in the Ruins it inhabited to be empty... sorry, sounds like a hard work, but still a cool idea right?

Link to comment
Share on other sites

I take this [TERRIBLE, AS NECROING IS BAD] to ask any modder able to do fulfil this request of mine: update this mod.

 

I mean, just look at it, it's The Batter!

And since the original poster hasn't showed us any interests on reviving this, maybe someone of you could do this?

Please?

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