Hi, I have a basic question about table in lua.
Below code is from recezib's "More DST characters" mod (workshop-343762271) - shadowpuppeteer component. I copied it and renamed "ShadowPuppeteer" to "BarbSummoner" for my char. I then added a function to get the count of barbs. However, this function does not work.
The issue is after the component calls RemoveAll() function, the count of the table does not get reset to 0.
Let's say I have summoned 6 barbs and then I called RemoveAll(). I expect the count to reset back to 0 but instead I get 6 again.
How do I do this?
New issue at hand! I've pushed off the follower mechanic for a bit while I try and test out a dodge mechanic, and I've been stumbling over the implementation. I want it so that below "x" amount of health, it randomly generates a number and dodges if it's greater than "y". Here's the code I have going so far, and I've used print("test") to try and get it to work once I can launch it. Buuut I haven't been able to launch it.
local function CombatPostInit(self)
self._DoAttack = self.DoAttackfunction self:DoAttack(target_override, weapon, projectile)
local targ = target_override or self.target
if targ.prefab == "pryce" then
if self.inst.components.health > 20 and math.random > 50 then
self:_DoAttack(target_override, weapon, projectile)
Hi, I am the main creator of the chester family.
ANYHOW, Afetogbo and I are hot on the trail to making the new highly anticipated Chester family member named Cavester. NO we have not figured out a way for him to enter into caves (yet) but it is a WIP.
Afetogbo helped put together the normal stuff, Im the one getting my hands wet and sticky to make him glow in the dark starting at dusk and ending at daytime. BUT there's another thing I want him to do. I want him to change from his grey normal animation to the bright green animation I made for him as well. That way he works like a glowstick! If someone could just point me in the right direction that would be really helpful! I've been disecting the pigmens codes hoping that would lead me somewhere but they only morph into a werepig during a fullmoon and I'm not sure what controls all of that.