Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Does anyone have some custum particles that look like foam from a waterfall.. of fog around a waterfall ?
And are they willing to share the code?
And are they willing to share the code?
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Ask a simple question, get a simple answer
Have you checked this out ?
https://www.nexusmods.com/legendofgrimrock2/mods/111
It's just the smoke particle reused where the waterfalls hits the river.
Perhaps you had something more specific in mind ?
kind regards.
Skuggasveinn.
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
What values am I allowed to pass as parameters to delayedCall(receiver, delay, msg) ?
Script entity:
When "test" is called for the first time, it correctly prints:
true true true true
When "test" is called for the second time, it should print:
nil nil nil true
But it prints:
nil nil nil nil
Script entity:
Code: Select all
function test(a, b, c, d)
print(a, b, c, d)
delayedCall(self.go.id, 1, "test", nil, nil, nil, true)
end
delayedCall(self.go.id, 1, "test", true, true, true, true)
true true true true
When "test" is called for the second time, it should print:
nil nil nil true
But it prints:
nil nil nil nil
Re: Ask a simple question, get a simple answer
AFAIK it should just be strings, booleans and numbers; no vectors, or tables—no objects.
Code: Select all
function test(...)
print(...)
delayedCall(self.go.id, 1, "test", ...)
end
test(1,2,3,true, false,'six', 'seven', tostring(8) + tonumber("8"), 0xff12e4, 3.1415926535, starting_location_1.id)
Re: Ask a simple question, get a simple answer
Is there a limit to how big your mod is
Like the size of the world or number of entitys and tiles
Like the size of the world or number of entitys and tiles
Re: Ask a simple question, get a simple answer
I think [? —read this somewhere here, a couple of days ago] that it might have a maximum of 65536 objects on a map.
As far as size goes... many hundred megabyte maps will work fine, but in practice... any Grimrock mod intended to be released on Steam needs to be around 98 MB at the most.
As far as size goes... many hundred megabyte maps will work fine, but in practice... any Grimrock mod intended to be released on Steam needs to be around 98 MB at the most.
Re: Ask a simple question, get a simple answer
You could have more than 65536 objects on a map, although the performance would be horrible. What you can't have is more than 65536 constants in a Lua function, including the main function of your dungeon.lua. This does effectively limit the number of objects you can place in the editor, since each object has a unique id, though in practice this limit is going to be somewhat lower than 65536 since ids aren't the only unique strings and numbers in the dungeon.lua.
However, this does not limit the number of objects you can create by other means; if you run into this issue you can just move some spawn() calls from your dungeon.lua to another file and use it as an external ScriptComponent script. You could even manually split your dungeon.lua into multiple functions, but that is not very practical since the dungeon editor will just overwrite it.
However, this does not limit the number of objects you can create by other means; if you run into this issue you can just move some spawn() calls from your dungeon.lua to another file and use it as an external ScriptComponent script. You could even manually split your dungeon.lua into multiple functions, but that is not very practical since the dungeon editor will just overwrite it.
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.
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
Code: Select all
defineObject{
name = "seeking_fireball",
baseObject = "fireball_large",
components = {
{
class = "Projectile",
spawnOffsetY = 1.5,
velocity = 5,
radius = 0.1,
collisionMask = bit.bor(2^4, 2^0), -- Collide with seeking_fireball_spinner (bit 4) and everything else (bit 0)
destroyOnImpact = false,
onProjectileHit = function(self, what, entity)
seeking_fireball_script.script.onProjectileHit(self, what, entity)
end,
},
},
}
When I remove onProjectileHit from the definition and use this code to create the seeking_fireball, it always works:
Code: Select all
local seeking_fireball = spawn("seeking_fireball", casterEntity.level, casterEntity.x, casterEntity.y, casterEntity.facing, casterEntity.elevation, "seeking_fireball")
seeking_fireball.projectile:addConnector("onProjectileHit", self.go.id, "onProjectileHit")
Re: Ask a simple question, get a simple answer
is that possible to play the same animation for 2 same model in this object?
SpoilerShow
Code: Select all
defineObject{
name = "forest_spruce_sapling_pillar_2x1",
-- baseObject = "base_pillar",
components = {
{
class = "Model",
model = "assets/models/env/forest_spruce_sapling_02.fbx",
staticShadow = true,
},
{
class = "Animation",
animations = {
sway = "assets/animations/env/forest_spruce_sapling_02_idle.fbx",
},
playOnInit = "sway",
loop = true,
},
{
class = "Model",
name = "pil2",
model = "assets/models/env/forest_spruce_sapling_02.fbx",
offset = vec(0, 0, -3),
staticShadow = true,
},
},
placement = "pillar",
editorIcon = 108,
minimalSaveState = true,
}
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Ask a simple question, get a simple answer
yes but, offsetting a model doesn't offset the animation, so when the animation plays on the second model it will "jump" into the original position.
What you want is to offset the animation in blender and save it out for the second model.
kind regards.
Skuggasveinn.