Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Remember that you can select groups of objects (hold the Shift key to add to the current selection) and move the entire group up or down with the < and > keys.
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.
Re: Ask a simple question, get a simple answer
Thanks, guys! I do know I can drag-select and shift-add then group-shift / re-elevate objects. I guess I'll just cut down on the water areas, other decoration is not giving me that much trouble.
[Edit] I may have underestimated the amount of time it would take to complete this... I've been mapping for around 6-7 hours today and am up to 760 objects and about 75% done with the first overland map... [/Edit]
[Edit] I may have underestimated the amount of time it would take to complete this... I've been mapping for around 6-7 hours today and am up to 760 objects and about 75% done with the first overland map... [/Edit]
Re: Ask a simple question, get a simple answer
Is there a way to fix the shadows here?
https://i.imgur.com/CHolQNp.jpg
Asset that causes the problem is "beach_rock_outside_wall_high". It lacks the "occluder" component most other rocks have. Is that the reason? Can I add the component to all those assets via script?
[Edit] Just searched the forum and found this from minmay, in the ORRRobin 3 thread: "Added shadow caster models to the backs of beach rock outside walls so that they are no longer missing shadows when lit from behind."
Is this something I could do as well? [/Edit]
=======
[Edit 2] Did more digging around and found this, again from minmay: "Adding doubleSided = true to its material definition will cause the triangles to block light from both directions (still only the front sides will be lit correctly, but both sides will cast shadows)"
Aaaaaand FIXED! Added the changed forest_wall material definition to the mod's materials.lua and now it works just great! Thanks, minmay! <3
https://i.imgur.com/VFrN566.jpg
[/Edit2]
https://i.imgur.com/CHolQNp.jpg
Asset that causes the problem is "beach_rock_outside_wall_high". It lacks the "occluder" component most other rocks have. Is that the reason? Can I add the component to all those assets via script?
[Edit] Just searched the forum and found this from minmay, in the ORRRobin 3 thread: "Added shadow caster models to the backs of beach rock outside walls so that they are no longer missing shadows when lit from behind."
Is this something I could do as well? [/Edit]
=======
[Edit 2] Did more digging around and found this, again from minmay: "Adding doubleSided = true to its material definition will cause the triangles to block light from both directions (still only the front sides will be lit correctly, but both sides will cast shadows)"
Aaaaaand FIXED! Added the changed forest_wall material definition to the mod's materials.lua and now it works just great! Thanks, minmay! <3
https://i.imgur.com/VFrN566.jpg
[/Edit2]
Re: Ask a simple question, get a simple answer
Is there a way to track party self-inflicted damage as from a fireburst or shockburst or poison cloud spell cast when standing next to an object, and having this instance of damage trigger a function or event?
Re: Ask a simple question, get a simple answer
Please tell me how to make magicians read only those spells that they have in their inventory?
Re: Ask a simple question, get a simple answer
Not my code and / or implementation, found the script on these forums, originally posted by user JKos:Badgert wrote:Please tell me how to make magicians read only those spells that they have in their inventory?
Code: Select all
--FORCE SPELL SCROLL IN INVENTORY
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onCastSpell =
function(party,champion,spellName)
local itemName = "scroll_"..spellName
for i = 1, 32, 1 do
if champion:getItem(i) ~= nil and champion:getItem(i).go.name == itemName then
return true
end
end
hudPrint(champion:getName().." needs to have the spell scroll on him to be able to cast it")
return false
end
}
}
- Zo Kath Ra
- Posts: 940
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
You could redefine everything that the party uses to do damage (spells, weapons) to haveCurunir wrote:Is there a way to track party self-inflicted damage as from a fireburst or shockburst or poison cloud spell cast when standing next to an object, and having this instance of damage trigger a function or event?
damageType = "party",
Then check for this damage type in PartyComponent.onDamage(self, champion, damage, damageType)
But then you couldn't use the other damage types anymore.
Maybe use party_poison, party_fire, etc. and re-define everything that checks for damage types?
I think the fire effect for fire damage is hardcoded, so this wouldn't work (attack a monster with a fire sword, and it starts burning).
Someone posted a better solution on this forum, but I can't find it anymore.
Re: Ask a simple question, get a simple answer
Sounds like too much of a hassle for a minor puzzle, I will change it for something else. Thanks for looking anyway! 
Here's another one while we're at it - I already know you can check what item the mouse cursor is currently carrying, but can you also check for the position of the mouse on the screen?
I want to be able to check whether an item is "held up" against an object, such as a wall face spawner or a spell receptor, etc. Is there a way to do this? Can make for a nice change of pace from all the alcove puzzles, even though it's essentially the same idea.

Here's another one while we're at it - I already know you can check what item the mouse cursor is currently carrying, but can you also check for the position of the mouse on the screen?
I want to be able to check whether an item is "held up" against an object, such as a wall face spawner or a spell receptor, etc. Is there a way to do this? Can make for a nice change of pace from all the alcove puzzles, even though it's essentially the same idea.
Re: Ask a simple question, get a simple answer
Why does this crash on execution?
I get "attempt to call global 'openSesame' (a nil value). It worked two minutes ago, I swear to god, I changed NOTHING and it ran fine and did everything in the openSesame function just a while ago.
Also, can you enable/disable multiple components of an entity with a single line?
And is there a way to place items in an alcove and NOT have them appear inside each other?
Code: Select all
function coldDoor()
if counter_1.counter:getValue() < 1 and counter_2.counter:getValue() < 1 then
do openSesame()
end
end
function openSesame()
dungeon_door_wooden_3.door:open()
dungeon_secret_door_8.door:open()
dungeon_secret_door_7.door:open()
torch_holder_14.controller:enable()
torch_holder_14.light:enable()
torch_holder_14.particle:enable()
torch_holder_14.sound:enable()
end
end
Also, can you enable/disable multiple components of an entity with a single line?
And is there a way to place items in an alcove and NOT have them appear inside each other?
Re: Ask a simple question, get a simple answer
I think you've confused yourself with your indentation. This is how it looks when indented based on the actual blocks:
Your definition of the openSesame function is inside the coldDoor function - and after the attempt to call it, so of course it's nil when you attempt to call it.
Code: Select all
function coldDoor()
if counter_1.counter:getValue() < 1 and counter_2.counter:getValue() < 1 then
do
openSesame()
end
end
function openSesame()
dungeon_door_wooden_3.door:open()
dungeon_secret_door_8.door:open()
dungeon_secret_door_7.door:open()
torch_holder_14.controller:enable()
torch_holder_14.light:enable()
torch_holder_14.particle:enable()
torch_holder_14.sound:enable()
end
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.