Page 1 of 1

How to discover secret and play sound etc?

Posted: Mon Nov 05, 2012 10:33 pm
by DrMadolite
I got a simple question, but it seems like there's no answer to it found anywhere. Maybe I'm just blind, but here it is:

How do you script a simple event of finding a secret, adding it to the game map, getting the message "Secret Found" and having the "secret" sound play? I understand the algorithm, but I'm not too familiar with Lua. Could someone please give an example script of how to do it?

Thanks in advance. Also, is there any way of opening the official LoG dungeon in the editor, in order to see how the devs have done things? It'd help a lot.

Re: How to discover secret and play sound etc?

Posted: Mon Nov 05, 2012 10:35 pm
by Grimwold
the easiest thing to do is place a Secret entity using the editor, and in the same space (or nearby) place a hidden pressure plate.
Create a connection from the plate to the secret with the activate action and it should work.

Re: How to discover secret and play sound etc?

Posted: Mon Nov 05, 2012 10:54 pm
by HaunterV
i read somewhere you have to put another secret symbol somewhere else otherwise you end up with a 1/0 secrets found.

Re: How to discover secret and play sound etc?

Posted: Mon Nov 05, 2012 11:50 pm
by DrMadolite
Grimwold wrote:the easiest thing to do is place a Secret entity using the editor, and in the same space (or nearby) place a hidden pressure plate.
Create a connection from the plate to the secret with the activate action and it should work.
I tried this and it worked perfectly. Thanks for the input. I do want to find out more though, but I'll check out the Lua scripting and look around some more. Specifically, I'd like to add "X experience gained" to the text that appears, and similar.
HaunterV wrote:i read somewhere you have to put another secret symbol somewhere else otherwise you end up with a 1/0 secrets found.
I'm not familiar with this problem, but I'll try your solution if it pops up. Thanks.

Re: How to discover secret and play sound etc?

Posted: Tue Nov 06, 2012 1:09 am
by msyblade
place a "Secret" entity, then a script entity and put this into it:

Code: Select all

function exp()   
hudPrint ("Gained 250 exp.")
 for i=1,4 do  party:getChampion(i):gainExp(250)


    end
end
Then connect a pad to both :) Your connector must be activate once or players will have an unlimited exp. cheat

Re: How to discover secret and play sound etc?

Posted: Tue Nov 06, 2012 10:36 am
by antti
DrMadolite wrote:Thanks in advance. Also, is there any way of opening the official LoG dungeon in the editor, in order to see how the devs have done things? It'd help a lot.
The main dungeon was made in the days before the dungeon editor existed so it's not compatible with dungeon editor.

Re: How to discover secret and play sound etc?

Posted: Tue Nov 06, 2012 12:23 pm
by Komag
...But soon you may be able to see how someone else has done things

Re: How to discover secret and play sound etc?

Posted: Thu Nov 08, 2012 2:53 am
by DrMadolite
Some nice feedback here, and I'll try out that script as well (msyblade). Thanks again, peeps. :)