Page 1 of 1

altar not responding to event

Posted: Thu Nov 22, 2012 2:18 am
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.

Re: alter not responding to event

Posted: Thu Nov 22, 2012 3:25 am
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

Re: altar not responding to event

Posted: Thu Nov 22, 2012 3:49 am
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.

Re: altar not responding to event

Posted: Thu Nov 22, 2012 1:10 pm
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

Re: altar not responding to event

Posted: Wed Nov 28, 2012 4:31 pm
by Niven81
thanks, Kormag. I'll try those.