Walltext, custom sound onClick [solved]

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
User avatar
Aisuu
Posts: 61
Joined: Fri Oct 31, 2014 2:07 pm

Walltext, custom sound onClick [solved]

Post by Aisuu »

Hi, Iam trying to do something like this guy from LOG1.

viewtopic.php?f=14&t=3851

Simply, I need to play custom sound when player click on wall text.
Is it possible now in LOG2 please? I tryed everything, but Iam not very good in LUA.
Last edited by Aisuu on Fri Oct 31, 2014 8:37 pm, edited 1 time in total.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Walltext, custom sound onClick

Post by Doridion »

User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: Walltext, custom sound onClick

Post by Prozail »

make a script_entity and put in the following (replacing "dungeon_wall_text_1" with the id of your text-object)

Code: Select all

dungeon_wall_text_1.clickable:addConnector("onClick",self.go.id,"iclickedthewall")
function iclickedthewall(sender)
	playSound("secret")
end
User avatar
Aisuu
Posts: 61
Joined: Fri Oct 31, 2014 2:07 pm

Re: Walltext, custom sound onClick

Post by Aisuu »

Great, that work perfectly. Thx Prozail, you are my hero :)
Post Reply