Checking the ID of a trigger

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
jcqrd
Posts: 2
Joined: Sat Oct 25, 2014 3:38 am

Checking the ID of a trigger

Post by jcqrd » Sat Oct 25, 2014 4:04 am

Hi, I have multiple buttons linked to a single script, and I'm trying to have the script determine which button triggered it. I added a variable to the script and it gives me a hexadecimal table, but I cannot manage to turn that into an id or anything. Any property I add returns nil.

Code: Select all

function checkTrigger(trigger)
print(trigger)
print(trigger.id)
end
table: 0x46edd46
nil

Any insight?

User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: Checking the ID of a trigger

Post by AdrTru » Sat Oct 25, 2014 8:30 am

print(trigger.go.id)
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,

jcqrd
Posts: 2
Joined: Sat Oct 25, 2014 3:38 am

Re: Checking the ID of a trigger

Post by jcqrd » Sat Oct 25, 2014 10:05 am

Thank you. :D

Post Reply