Trigger an event at a certain location

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Exophesis
Posts: 2
Joined: Sat Sep 22, 2012 7:33 pm

Trigger an event at a certain location

Post by Exophesis »

Hi.

How can you make a script trigger an event if the player is located at a certain x and y position?

i.e: Display Hud Text when the player is standing at x=2 and y=8

Thanks ;)
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Trigger an event at a certain location

Post by Neikun »

This would be very easy. A matter of choosing your pressure plate (hidden, or tileset) and putting a connection to you lua script function.
Put the pressure plate at the desired x,y
When the party steps on it, the hudPrint will activate.
Helpful reading:
http://www.grimrock.net/modding/introdu ... scripting/

Code: Select all

function positionsay
hudPrint ("Stepping here has made these words appear!")
end
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Exophesis
Posts: 2
Joined: Sat Sep 22, 2012 7:33 pm

Re: Trigger an event at a certain location

Post by Exophesis »

Neikun wrote:This would be very easy. A matter of choosing your pressure plate (hidden, or tileset) and putting a connection to you lua script function.
Put the pressure plate at the desired x,y
When the party steps on it, the hudPrint will activate.
Helpful reading:
http://www.grimrock.net/modding/introdu ... scripting/

Code: Select all

function positionsay
hudPrint ("Stepping here has made these words appear!")
end
Thanks so much. Never saw the Hidden Pressure Plate.
Post Reply