altar not responding to event

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Niven81
Posts: 2
Joined: Thu Nov 22, 2012 2:14 am

altar not responding to event

Post by Niven81 »

Hello everyone! I am a first time modder and I'm having a bit of a problem with a counter. What I'm trying to do is that when the player puts in two torches (still haven't figured out anything else) a sword and helmet appear on a nearby altar (as well as an undead warrior). Problem is the editor tells me that the altar isn't responding to the event and the items will either be on the altar from the get go or won't appear at all.

Please help.

Edit: another question that may require a script (I stink at those). I'm trying to make another room full of hidden pressure plates that basically has fireballs going off from many directions whenever the player moves. However, once the player grabs a key at the end of the room the room is supposed to stop throwing the fireballs. I'm trying to do this with a counter but it isn't working.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: alter not responding to event

Post by Komag »

Those are both a little tricky. for the Altar, you'll need to script it, and spawn the new item, not move it.

like this:
tombAltar:addItem(spawn("power_weapon"))

you put it in a function like:

Code: Select all

function addWeapon()
  tombAltar:addItem(spawn("power_weapon"))
end
put that in a script entity and trigger that function with whatever you want
Finished Dungeons - complete mods to play
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: altar not responding to event

Post by Komag »

there are numerous ways you could approach the second one. One idea would be to nerf the pressure plates by making them no longer respond to anything. Have removing the key trigger a script function that lists all the plates and changes their setting. You'll want to review the scripting reference on the Modding page of the main site for the exact coding. I'll post more details tomorrow if I can.
Finished Dungeons - complete mods to play
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: altar not responding to event

Post by Komag »

For nerfing the plates, you would use something like:
firePlate1:setTriggeredByParty(false)
and repeat that for each plate.

If you have a lot of them, like 10 or more, all with IDs "firePlate1" through "firePlate10", you could set it up like this:

Code: Select all

function nerfFirePlates()
  for i=1,10 do
    local thePlate = findEntity("firePlate"..i)
    if thePlate then
      thePlate:setTriggeredByParty(false)
    end
  end
end
Finished Dungeons - complete mods to play
Niven81
Posts: 2
Joined: Thu Nov 22, 2012 2:14 am

Re: altar not responding to event

Post by Niven81 »

thanks, Kormag. I'll try those.
Post Reply