Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Does anyone know why this is happening? Why do I get the black tiles behind my object? .. not from all sides when I walk around it.
Re: Ask a simple question, get a simple answer
I don't see it in the image you've posted.
EDIT:
**Aha... The image you've posted gets the right half cut off in the forums. You might post it again at half size.
Just looking at it, my guess is that you've modified an existing object to make your new one, but without changing its original occlusion mesh to match the new appearance. Occlusion meshes (more or less) tell the engine to not bother rendering anything behind the contour of the foreground
model.
EDIT:
**Aha... The image you've posted gets the right half cut off in the forums. You might post it again at half size.
Just looking at it, my guess is that you've modified an existing object to make your new one, but without changing its original occlusion mesh to match the new appearance. Occlusion meshes (more or less) tell the engine to not bother rendering anything behind the contour of the foreground
model.
Re: Ask a simple question, get a simple answer
Hey lostsol,lostsol wrote: Here is what I'm working with:Also, I did not mention this in my original post. Focusing on Energy, with a Willpower attribute score of 10, this function works perfectly. Below 10 and the champion actually slowly loses energy. Beyond 10 and regeneration starts happening again, although at a very slow rate, like 1 point every 1-2 minutes. I really, really hope I'm doing something boneheaded here..SpoilerShowCode: Select all
defineTrait{ name = "no_regen", uiName = "", icon = 0, description = "", hidden = true, onRecomputeStats = function(champion, level) if level > 0 then champion:addStatModifier("energy_regeneration_rate", -100) champion:addStatModifier("health_regeneration_rate", -100) end end, }
Im half way through writing (and now testing) my reply but wont be able to finish everything up in time (vacation time )
I will PM you what I have done so far though
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: Ask a simple question, get a simple answer
I have a script in the works and have a question regarding variables.
Have a look:
My concern is with serialization. I have read all I could find on these forums regarding serialization but it's still a little unclear. From my understanding, what I've got going on here is some up values to variables. I'm not sure if doing this is "safe".
With my mod exported, I have tested this script as much as I could stomach. Trying different combinations of firing off rounds, reloading the firearm, saving the game, loading the game. I have yet to produce an error, however, I am not 100% convinced that the potential for error does not exist, and I do not want to implement the script if that is the case.
Thanks !
Have a look:
SpoilerShow
Code: Select all
onAttack = function(self, champion, slot)
local clip = self.go.firearmattack:getClipSize()
local load = self.go.firearmattack:getLoadedCount()
local count = (self.go.firearmattack:getClipSize() - self.go.firearmattack:getLoadedCount())
local item
local stack
for i=1,ItemSlot.MaxSlots do
item = champion:getItem(i)
if item and item:hasTrait("arc") then
stack = item.go.item:getStackSize()
break
end
end
if stack and stack > count then
self.go.firearmattack:setLoadedCount(clip)
item.go.item:setStackSize(stack - count) elseif
stack and stack <= count then
self.go.firearmattack:setLoadedCount(load + stack)
item.go.item:setStackSize(0)
end
playSound("firearm_jammed")
end,
With my mod exported, I have tested this script as much as I could stomach. Trying different combinations of firing off rounds, reloading the firearm, saving the game, loading the game. I have yet to produce an error, however, I am not 100% convinced that the potential for error does not exist, and I do not want to implement the script if that is the case.
Thanks !
Re: Ask a simple question, get a simple answer
The code you posted does not contain any functions with upvalues. An upvalue is a local variable that is declared outside of a function that references it.
Code: Select all
function a() -- Function does not have upvalues
local x = "cat"
print(x)
end
y = "dog"
function b() -- Function does not have upvalues
print(y)
end
local z = "goat"
function c() -- Function has an upvalue!
print(z)
end
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- Mysterious
- Posts: 226
- Joined: Wed Nov 06, 2013 8:31 am
Re: Ask a simple question, get a simple answer
Hi all
Ok im trying to create and candle that acts like a torch. With the below script I have the candle model thxs (THOM) and the 2d icon. The problem im having is when you pick up the candle it goes invisible there is no candle 2d icon on the mouse. If I place the candle on the handle icon there is no candle icon and the hand picture disappears. I'm not sure what's going wrong please help ty
I think it has something to do with:
{
class = "TorchItem",
fuel = 1100,
},
Candle Script:
Ok im trying to create and candle that acts like a torch. With the below script I have the candle model thxs (THOM) and the 2d icon. The problem im having is when you pick up the candle it goes invisible there is no candle 2d icon on the mouse. If I place the candle on the handle icon there is no candle icon and the hand picture disappears. I'm not sure what's going wrong please help ty
I think it has something to do with:
{
class = "TorchItem",
fuel = 1100,
},
Candle Script:
Code: Select all
defineObject{
name = "candle",
baseObject = "base_item",
components = {
{
class = "Model",
model = "mod_assets/objects/models/candle.fbx",
staticShadow = true,
},
{
class = "Item",
uiName = "Candle",
description ="Candle.",
gfxAtlas = "mod_assets/textures/other_items_atlas/custom_icon_atlas.tga",
gfxIndex = 25,
weight = 3.0,
fitContainer = false,
},
{
class = "TorchItem",
fuel = 1100,
},
{
class = "Light",
range = 3.5,
color = vec(1.1, 0.68, 0.35),
brightness = 7,
castShadow = true,
staticShadows = true,
staticShadowDistance = 0,
shadowMapSize = 256,
fillLight = true,
--offset = vec(0, 0.46, 0),
onUpdate = function(self)
local noise = math.noise(Time.currentTime()*3 + 123) * 0.5 + 0.9
self:setBrightness(noise * 10)
end,
},
{
class = "Particle",
particleSystem = "single_candle",
},
},
}
Re: Ask a simple question, get a simple answer
Ahh I see now, my thinking was way off. I thought that "local stack", and then later "stack = ..." was an upvalue. Anyway, thanks for the explanation and examples.minmay wrote:The code you posted does not contain any functions with upvalues. An upvalue is a local variable that is declared outside of a function that references it.
I would guess that your gfxAtlas and / or gfxIndex is pointing to the wrong place.Mysterious wrote:Hi all
Ok im trying to create and candle that acts like a torch. With the below script I have the candle model thxs (THOM) and the 2d icon. The problem im having is when you pick up the candle it goes invisible there is no candle 2d icon on the mouse. If I place the candle on the handle icon there is no candle icon and the hand picture disappears. I'm not sure what's going wrong please help ty
Re: Ask a simple question, get a simple answer
Hello
I'm looking for a way to not make the health bar appear during a boss fight (so the fight would be more stressful...). Does anyone know how to do it? Until now, I didn't find out
Thanks
Khollik
I'm looking for a way to not make the health bar appear during a boss fight (so the fight would be more stressful...). Does anyone know how to do it? Until now, I didn't find out
Thanks
Khollik
Re: Ask a simple question, get a simple answer
Hello guys... another texture /blender question. Why am I seeing these lines (black lines) on top of my billboard bushes..
and how to get rid of them
and how to get rid of them
Re: Ask a simple question, get a simple answer
Do you have doubled vertices in those models?