Awesome (and dirty!!!)Sutekh wrote:The summon stone's wake-up animation takes about 5 seconds by my reckoning, so here's one quick and dirty solution:
1: Place an invisible wall object on the same tile as the summon stone to 'shield' it.
2: Place a timer (with timer unchecked and disableSelf checked) set to 5 seconds and connect it to a script that destroys the invisible wall.
3: Use the same trigger that activates the summon stone's controller to also start the timer, which will destroy the invisible wall at about the same time the summon stone is fully awake.
Ask a simple question, get a simple answer
- TheLastOrder
- Posts: 104
- Joined: Wed Oct 17, 2012 1:56 am
Re: Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
What you're supposed to do is place a summon_stone_pile entity on the same square as the dormant summon stone. It works like the invisible wall you described, except it will play the correct animation and is completely automatic.
You also could have learned this by looking at the main campaign or the asset pack.
You also could have learned this by looking at the main campaign or the asset pack.
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.
- TheLastOrder
- Posts: 104
- Joined: Wed Oct 17, 2012 1:56 am
Re: Ask a simple question, get a simple answer
Woah... great job!minmay wrote:What you're supposed to do is place a summon_stone_pile entity on the same square as the dormant summon stone. It works like the invisible wall you described, except it will play the correct animation and is completely automatic.
You also could have learned this by looking at the main campaign or the asset pack.
How could I take a look at the main campaign? I remember to have read something about this, and I searched the forum... but nothing has been released about the original one besides the lua contents
Thanks a lot!
Re: Ask a simple question, get a simple answer
Okay. I want to check if all the monsters in a level are dead so I can open a door. Will this work?
Or is there more to it than that?
Code: Select all
for e in self.go.map:allEntities() do
if e.monster == 0 then
door_1.door:open()
Re: Ask a simple question, get a simple answer
Hey all, I was wondering if there was a method to spawn a beacon holding it's particular element? I know that in LoG1 to make some assets act like an alcove it required a little dirty work, but since the beacons can already hold particular objects, I believe all that would be needed is to spawn it over the beacon and then do xy and z to get it to trigger properly; unfortunately, I'm more of an artistically driven person so figuring this out through lua scripting is akin to me driving into a brick wall. I'll appreciate any and all help that you all can give.
Last edited by Davenfal on Mon Dec 22, 2014 7:28 am, edited 1 time in total.
Re: Ask a simple question, get a simple answer
This won't work for a couple reasons: first, "e.monster" cannot possibly be 0, it will either be nil or a component. Presumably you wanted nil there instead of 0. Second, your logic is inverted: you have it opening the door if ANY entity on the level does not have a MonsterComponent. Also, it's entirely possible to have a MonsterComponent not named "monster", but this is probably not a concern. Here's the code you probably wanted:Grimfan wrote:Okay. I want to check if all the monsters in a level are dead so I can open a door. Will this work?
Code: Select all
for e in self.go.map:allEntities() do if e.monster == 0 then door_1.door:open()
Code: Select all
for e in self.go.map:allEntities() do
if e.monster then
return
end
end
door_1.door:open()
http://www.grimrock.net/modding/scripti ... tComponentGrimfan wrote:Hell all, I was wondering if there was a method to spawn a beacon holding it's particular element? I know that in LoG1 to make some assets act like an alcove it required a little dirty work, but since the beacons can already hold particular objects, I believe all that would be needed is to spawn it over the beacon and then do xy and z to get it to trigger properly; unfortunately, I'm more of an artistically driven person so figuring this out through lua scripting is akin to me driving into a brick wall. I'll appreciate any and all help that you all can give.
Just use:
Code: Select all
beacon_air_1.socket:addItem(spawn("essence_air").item)
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
Boy, I knew it was riddled with errors.
By the way, when I wrote e.monster == 0 Is it the fact that I was referring to a component the reason it can't be 0 or something else? If I wrote say turtle_1.monster == 0 would it still not work?
And thanks for the help minmay. I know us lua newbs test your patience at times, but it's a credit to your character that you persist in helping us nonetheless.
By the way, when I wrote e.monster == 0 Is it the fact that I was referring to a component the reason it can't be 0 or something else? If I wrote say turtle_1.monster == 0 would it still not work?
And thanks for the help minmay. I know us lua newbs test your patience at times, but it's a credit to your character that you persist in helping us nonetheless.
Re: Ask a simple question, get a simple answer
That worked perfectly, thanks for the help! I do have another question:minmay wrote:http://www.grimrock.net/modding/scripti ... tComponentDavenfal wrote:Hell all, I was wondering if there was a method to spawn a beacon holding it's particular element? I know that in LoG1 to make some assets act like an alcove it required a little dirty work, but since the beacons can already hold particular objects, I believe all that would be needed is to spawn it over the beacon and then do xy and z to get it to trigger properly; unfortunately, I'm more of an artistically driven person so figuring this out through lua scripting is akin to me driving into a brick wall. I'll appreciate any and all help that you all can give.
Just use:Code: Select all
beacon_air_1.socket:addItem(spawn("essence_air").item)
Code: Select all
function openNorthGates()
if NorthGate.onInsertItem(NorthGate, "essence_balance_1") then
north_gate1.door:open();
north_gate2.door:open();
else
north_gate1.door:close();
north_gate2.door:close();
end
end
Re: Ask a simple question, get a simple answer
To show that I have been learning something about lua along the way. If NorthGate is your beacon then:
Sockets normally only take a single item like a torch (they are not like altars and alcoves). Each of the beacons only accepts a single essence as far as I know.
As always I defer to people like minmay, Thorham, Prozail or Isaac. In other words people who know what they're talking about.
Code: Select all
function openNorthGate()
if NorthGate.socket:getItem() then
northgate1.door:open()
northgate2.door:open()
end
end
As always I defer to people like minmay, Thorham, Prozail or Isaac. In other words people who know what they're talking about.
Re: Ask a simple question, get a simple answer
While this does work, it'll also accept any other essence placed onto it, which is unfortunate since I want each essence to only open up certain doors. I feel like onInsertItem should work but it doesn't want to.Grimfan wrote:To show that I have been learning something about lua along the way. If NorthGate is your beacon then:
Sockets normally only take a single item like a torch (they are not like altars and alcoves). Each of the beacons only accepts a single essence as far as I know.Code: Select all
function openNorthGate() if NorthGate.socket:getItem() then northgate1.door:open() northgate2.door:open() end end
As always I defer to people like minmay, Thorham, Prozail or Isaac. In other words people who know what they're talking about.