Text output

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Text output

Post by stochastic »

Since, as far as I can understand, you cannot use any "wait" function in your scripting, I have decided to do something else.

Is it possible to show wall text to the player in a script?

for instance, he/she touches a lever, it doesn't work (message pops up, saying: "bla bla")?

Thanks,
-Stochastic
Hariolor
Posts: 42
Joined: Sun Apr 15, 2012 5:59 am

Re: Text output

Post by Hariolor »

in your script you'd use something like

Code: Select all

function notworking()
hudPrint("It didn't work!")
end
To create literal wall script when the lever's pulled, you'd have to spawn a wall_text entity which gets a little more involved.

*edit: made it a separate function to be more explicit - could also be buried in an existing function...not sure how you wanted to use it
Last edited by Hariolor on Sat Dec 29, 2012 10:13 pm, edited 1 time in total.
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Text output

Post by stochastic »

Yeah it is nice enough, and I am using that atm. - however I was wondering if you could get the same output as when you read/click a wall-txt :)
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Text output

Post by stochastic »

--Resets lever if riddle is not complete
function resetlever1()
if tsl1:getLeverState() == "activated" and
tst1:hasTorch() == true then
tsl1:setLeverState("deactivated")
hudPrint("It seems stuck! ...")
else
tsl1:setLeverState("activated")
end
end

The problem with this script is, that if I remove the torch and place back in... the lever will automaticly drop down (activate) - how do I make it work only when players interact with it?
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Text output

Post by msyblade »

I would try seeing how it acts without the "tsl1:setLeverState("activated")" line.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Hariolor
Posts: 42
Joined: Sun Apr 15, 2012 5:59 am

Re: Text output

Post by Hariolor »

it looks like what you're trying to do is make the lever only work if the torch is removed first...

consider something like this - have the lever trigger it only when activated?

Code: Select all


function resetlever1()
  if tst1:hasTorch() == true 
    then
    hudPrint("It seems stuck! ...")
    tsl1:setLeverState("deactivated")
    else
    [do whatever you want it to do- door:open() etc]
  end
end

stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Text output

Post by stochastic »

He keeps saying "it is stuck" if I just keep removing and adding the torch :(
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Text output

Post by stochastic »

Else I should make the torch activate LUA script if it is activated itself - and deactivate Lua script if it is deactivated (removed)
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Text output

Post by stochastic »

NEVERMIND... couldn't do that :'(
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Text output

Post by stochastic »

The problem was that my torch was "activating" the Lua script ... It now works -.-
Post Reply

Return to “Modding”