[Archived] Original Mod Collaboration Thread


Recommended Posts

@simplex

Do you want me to move the rest of the prefabs into upandaway/prefabs, like you did with sheep and the others?

Well, so far I've been moving them as I felt the need to use a few wicker tools. But putting everything in there would make things more uniform.

Just one note: when redirecting the loading to upandaway/prefabs using require(), note that require only takes the first return value of the file. So in case there's more than one you'd return it as a table and then call unpack. For example, if moving sky_chest.lua to upandaway/prefabs/sky_chest.lua, you'd end it with

return {Prefab("common/sky_chest", chest("treasure_chest"), assets),	   MakePlacer("common/treasurechest_placer", "chest", "treasure_chest", "closed")}
and then, in prefabs/sky_chest.lua, its single line would be

return unpack(require "upandaway.prefabs.sky_chest")

p.s.: Sorry about the commit spam about the ghostly README.md. Since the README.md <-> index.md syncing is done as a commit hook, I had to commit to test if the issue was fixed or not (and it seems it finally is).

Link to comment
Share on other sites

I've been needing to practice with my tablet, so I figured it would be a good excuse to come up with concept art for potential additions. Here is a rough sketch (and color, because I like color) of a flying lemur type mob:

 

 

Edit: One moment.

 

hNG8dMq.png?1

 

I like him too, he looks sadistic, and you can't go wrong with green!

 

@ArcticFox789 Maybe he's that certain rainbow-based raccoon's demented cousin that nobody talks about at the family reunion.

Edited by thelefthelix
  • Like 3
Link to comment
Share on other sites

@debugman18

One immediate advantage of putting things in upandaway/prefabs, upandaway/components, etc. is that you don't need to necessarily make functions local so they won't pollute/conflict with the global environment. Provided these files have the wicker header, each will run in its own environment, so you can define non-local functions and not have to worry about order or declaration (like in the previous issue with sheep.lua).

  • Like 1
Link to comment
Share on other sites

What if there were a couple different color variations of them and they lived in tribes, and occasionally at night they would creep into your camp and steal/rearrange things just to screw with you?

 

Edit: And they could carry spears because that's exactly what they don't need.

Edited by thelefthelix
  • Like 4
Link to comment
Share on other sites

@simplex

 

Err. I moved all the prefabs (and doing it a tiny few changes to cloudrealm. notably, adding cloud waves) but the game spits this error at me.

 

scripts/mods.lua(17,1) error calling LoadPrefabFile in mod UpAndAway (Up and Away):...mods/UpAndAway/scripts/upandaway/wicker/api/core.lua:134: variable 'is_a' is not declaredLUA ERROR stack traceback:        =[C] in function 'error'        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/strict.lua(23,1)        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/../mods/UpAndAway/scripts/upandaway/wicker/api/core.lua(134,1)        =(tail call) ?        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/mainfunctions.lua(42,1)        =(tail call) ?        =[C] in function 'xpcall'        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/mods.lua(15,1)        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/mods.lua(262,1) in function 'RegisterPrefabs'        scripts/main.lua(216,1) in function 'ModSafeStartup'        scripts/main.lua(250,1)        =[C] in function 'SetPersistentString'        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/modindex.lua(58,1)        =[C] in function 'GetPersistentString'        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/modindex.lua(45,1) in function 'BeginStartupSequence'        scripts/main.lua(249,1) in function 'callback'        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/modindex.lua(281,1)        =[C] in function 'GetPersistentString'        C:/Program Files (x86)/Steam/SteamApps/common/dont_starve/data/scripts/modindex.lua(261,1) in function 'Load'        scripts/main.lua(248,1) in main chunk    scripts/mods.lua(212,1) Disabling UpAndAway (Up and Away) because it had an error.
Link to comment
Share on other sites

@debugman18

It really looks like you forgot a return statement in one of the prefab files.

In a Lua module, when you don't explicitly return something the module environment is returned. So when LoadPrefabFile at mainfunctions.lua is trying to index the return value with "is_a", it's really indexing the module environment. However, when using the global environment bootup, if something doesn't exist in the wicker environment it will attempt to grab that from the global environment. Since the global environment runs in strict mode (raising an error if an undeclared variable is accessed), the game crashes (instead of just giving back nil).

Link to comment
Share on other sites

@debugman18

It really looks like you forgot a return statement in one of the prefab files.

In a Lua module, when you don't explicitly return something the module environment is returned. So when LoadPrefabFile at mainfunctions.lua is trying to index the return value with "is_a", it's really indexing the module environment. However, when using the global environment bootup, if something doesn't exist in the wicker environment it will attempt to grab that from the global environment. Since the global environment runs in strict mode (raising an error if an undeclared variable is accessed), the game crashes (instead of just giving back nil).

I'll go double check everything. I don't think I missed one, but... I'll check.

Link to comment
Share on other sites

@debugman18

It really looks like you forgot a return statement in one of the prefab files.

In a Lua module, when you don't explicitly return something the module environment is returned. So when LoadPrefabFile at mainfunctions.lua is trying to index the return value with "is_a", it's really indexing the module environment. However, when using the global environment bootup, if something doesn't exist in the wicker environment it will attempt to grab that from the global environment. Since the global environment runs in strict mode (raising an error if an undeclared variable is accessed), the game crashes (instead of just giving back nil).

There aren't any missing return statements. I also made sure that prefabs that should be unpacked are done so with the snippet you told me to use.

 

Edit: I pushed to Git if you're willing to have a look, but I'll continue to check things out. I don't know how Wicker works at the moment (it's over my head, mostly).

Edited by debugman18
Link to comment
Share on other sites

I finnaly have intended , i have to edit the Wee tusk files...

 

Here is the basic of the basic of the snow guy.

 

 

local assets=
{
Asset("ANIM", "anim/ds_pig_basic.zip"),
Asset("ANIM", "anim/ds_pig_actions.zip"),
Asset("ANIM", "anim/ds_pig_attacks.zip"),
Asset("ANIM", "anim/pig_build.zip"),
    Asset("ANIM", "anim/pigspotted.zip") ,
Asset("SOUND", "sound/beefalo.fsb"),
}
 
local sounds = 
{
    walk = "dontstarve/beefalo/walk",
    grunt = "dontstarve/beefalo/grunt",
    curious = "dontstarve/beefalo/curious",
 
local prefabs =
{
    "meat",
    "greengem",
    "bluegem",
}
 
local loot = 
{
    "meat",
}
 
local function OnAttacked(inst, data)
    --print(inst, "OnAttacked")
    local attacker = data.attacker
 
    inst.components.combat:SetTarget(attacker)
 
local builds = {"pig_build", "pigspotted_build"}
 
 
local function create()
local inst = CreateEntity()
local trans = inst.entity:AddTransform()
local anim = inst.entity:AddAnimState()
local sound = inst.entity:AddSoundEmitter()
local shadow = inst.entity:AddDynamicShadow()
shadow:SetSize(2.5)
    inst.Transform:SetFourFaced()
    inst.Transform:SetScale(2.5)
 
    MakeCharacterPhysics(inst, 50, .5)    
     
    anim:SetBank("?")
    anim:SetBuild("pig_build")
    
    inst:AddComponent("locomotor")
    inst.components.locomotor.runspeed = 10
    inst.components.locomotor.walkspeed = 1.5
    
    inst:SetStateGraph("SGwalrus")
    inst.soundgroup = "mctusk"
 
    --anim:Hide("hat")
 
    inst:AddTag("character")
    inst:AddTag("walrus")
    inst:AddTag("houndfriend")
 
    local brain = require "brains/beefalobrain"
    inst:SetBrain(brain)
 
    inst.components.eater:SetHerbivore()
    
    inst:AddComponent("combat")
    inst.components.combat.hiteffectsymbol = "pig_torso"
    inst.components.combat:SetDefaultDamage(TUNING.BEEFALO_DAMAGE)
    inst.components.combat:SetRetargetFunction(1, Retarget)
    inst.components.combat:SetKeepTargetFunction(KeepTarget)
    
    inst:AddComponent("health")
    inst.components.health:SetMaxHealth(TUNING.WALRUS_HEALTH)
 
    inst:AddComponent("lootdropper")
    inst.components.lootdropper:SetLoot(loot)
    inst.components.lootdropper:AddChanceLoot("greengem", 0.50)
    inst.components.lootdropper:AddChanceLoot("bluegem", 0.50)
    
    inst:AddComponent("inspectable")
    
    MakeLargeBurnableCharacter(inst, "beefalo_body")
 
   
    inst:AddComponent("leader")
    
    inst:ListenForEvent("attacked", OnAttacked)
 
 
    return inst
end
 
 
return Prefab( "forest/animals/snow_guy", create, assets, prefabs), 
 
 
I don't have more exp to make the rest...  :frown:
Edited by 1Nicolino
Link to comment
Share on other sites

Balloon-Hounds are the greatest thing.

 

I absolutely love the idea that they would just kinda float helplessly - wiggling about, unable to control their own direction.

"Oh, I'm fearsome as heck! Come over here, and I'll show you who's boss!!"

"... No."

"Aww..."

 

Exactly! Aw, then when they died their balloon could pop and they'd drop back down. Poor little guys.

  • Like 1
Link to comment
Share on other sites

I'd say unless we made them 1-hit kill there'd have to be quite the distinct limit on the amount that may rain down.

 

Well, if we went with the idea that on death the balloons pop and they drop back down, then it could make sense for them to be a one shot kill, and the player would then just be popping the balloon rather than actually killing the hound itself.

 

As for it being a hound mechanic, I think it would be a good alternative to a standard hound attack, or removing them completely. Though it would be hilarious to see them floating around helplessly like Dana mentioned, you're right that they wouldn't pose much of a threat if they aren't moving around. In that case, what if the hounds would spawn at the time that you would first begin hearing the growls and snarls normally. For the duration of the warning they could float around acting tough, and when the warning was up the balloons would pop and they would land on the clouds where they could attack the player as a normal hound would.

 

It really just depends on whether or not they would need to be a threat, or just something to point and laugh at.

 

Edit: Misread your initial post and didn't see that it had been quoted from an earlier one. Ignore that first part!

Edited by thelefthelix
Link to comment
Share on other sites

I think there should be a unique threat - something that provides the same function as the surface-world Hounds, but is more at home in the cloud realm.

The balloon-hounds strike me as something to just point and laugh at - they used to be deadly, but in the cloud world, they're helpless. x3

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share