hello dudes,
is anyone knows if it is possible :
- a pressure plate can start a script with variables ? If yes, how to ?
- a script can get the X and the Y of the pressure plate which started it ?
thanks
pressure plates and variables...
Re: pressure plates and variables...
in general any activator (plate, button, lever etc.) passes itself as a variable to the script it calls...
So if you add a variable to your script you can access all the properties of the entity that called the function:
So if you add a variable to your script you can access all the properties of the entity that called the function:
Code: Select all
function checkPlate(trigger)
hudPrint("pressure plate with id " .. trigger.id .. " located at " .. trigger.level .. "," .. trigger.x .. "," .. trigger.y .. " was activated")
end
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: pressure plates and variables...
Yes ! it works !Grimwold wrote:in general any activator (plate, button, lever etc.) passes itself as a variable to the script it calls...
So if you add a variable to your script you can access all the properties of the entity that called the function:
Code: Select all
function checkPlate(trigger) hudPrint("pressure plate with id " .. trigger.id .. " located at " .. trigger.level .. "," .. trigger.x .. "," .. trigger.y .. " was activated") end
Thanks a lot, you are great !!
Re: pressure plates and variables...
wow, I missed this before, very handy, thanks!
Finished Dungeons - complete mods to play