Scripting Additions
Scripting Additions
I am already hard at work breaking your scripting stuff and trying various things out with them. I have a question though...We are able to addItems to various spots in the dungeons...alcoves, altars, and such but I find no way to, at least script wise remove items. Reason for this is the following...I show the party all these wonderful magical goodies only to have them vanish before their eye before they can remove/pickup said items. I have tried variation of removeItem and such but no luck. Is there not a command to remove/destroy items? Thanks in advance. Will be uploading my bug reports a little later.
Re: Scripting Additions
Removing/destroying items is currently not supported by the scripting interface but it's on my todo list.
Re: Scripting Additions
Is there some equivalent to getLeverState for pressure plates, such as getPlateState?
Right now I've rigged a setup where two pressure plates need to be weighted down to open a door:
- each pressure plate activates a script that toggles a lever (in a faraway blue room)
- then I have the combination lock script set up with the levers, so when they are both activated, the door opens
Right now I've rigged a setup where two pressure plates need to be weighted down to open a door:
- each pressure plate activates a script that toggles a lever (in a faraway blue room)
- then I have the combination lock script set up with the levers, so when they are both activated, the door opens
Finished Dungeons - complete mods to play
Re: Scripting Additions
It seems to be missing. I'll add it in the next update. Thanks for letting us know!Komag wrote:Is there some equivalent to getLeverState for pressure plates, such as getPlateState?
It's easy to script a workaround though: just increment/decrement a counter when the pad is activated/deactivated and check the counter's value when needed.
Re: Scripting Additions
Would a terrible kludge work where the party onPickUpItem hook sets the item-to-be-picked's type to something else?I am already hard at work breaking your scripting stuff and trying various things out with them. I have a question though...We are able to addItems to various spots in the dungeons...alcoves, altars, and such but I find no way to, at least script wise remove items. Reason for this is the following...I show the party all these wonderful magical goodies only to have them vanish before their eye before they can remove/pickup said items. I have tried variation of removeItem and such but no luck. Is there not a command to remove/destroy items? Thanks in advance. Will be uploading my bug reports a little later.
Re: Scripting Additions
Hmm, I tested this by linking three plates to a counter set to 3 (with proper activate -> decrememt, and deactivate -> increment)petri wrote: It's easy to script a workaround though: just increment/decrement a counter when the pad is activated/deactivated and check the counter's value when needed.
It works and the door opens (yay!), but then removing a weight from one of the plates doesn't close the door again. The counter only sends a signal on zero, so if the door link is set to toggle, then removing a weight and adding it again will close the door, but that's not what I want
Finished Dungeons - complete mods to play
Re: Scripting Additions
If you just want to setup a puzzle that opens a door when two pads are pressed, the easiest way is to add a single counter that starts from 2. Each pad when activated decrements the counter by 1, and when deactivated increments the counter by 1. When the counter reaches 0 it then triggers and opens the door. No scripts needed.Komag wrote:Is there some equivalent to getLeverState for pressure plates, such as getPlateState?
Right now I've rigged a setup where two pressure plates need to be weighted down to open a door:
- each pressure plate activates a script that toggles a lever (in a faraway blue room)
- then I have the combination lock script set up with the levers, so when they are both activated, the door opens
Re: Scripting Additions
yes, thank you, that's what currently works, but I also want the door to close again if one of the weights is taken off
Finished Dungeons - complete mods to play
Re: Scripting Additions
You can replace the counter with a script entity to get more control, for example:Komag wrote:yes, thank you, that's what currently works, but I also want the door to close again if one of the weights is taken off
Code: Select all
counter = 2
function activate()
counter = counter - 1
checkValue()
end
function deactivate()
counter = counter + 1
checkValue()
end
function checkValue()
if counter == 0 then
door:open()
else
door:close()
end
end
EDIT: oops fixed a couple of bugs
Re: Scripting Additions
It worked (after I switched the + and the - and added an end), thanks a lot!
EDIT - you beat me to it and fixed the code already!
EDIT - you beat me to it and fixed the code already!
Finished Dungeons - complete mods to play