Text output
-
- Posts: 15
- Joined: Fri Dec 28, 2012 11:59 pm
Text output
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
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
Re: Text output
in your script you'd use something like
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
Code: Select all
function notworking()
hudPrint("It didn't work!")
end
*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.
-
- Posts: 15
- Joined: Fri Dec 28, 2012 11:59 pm
Re: Text output
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 

-
- Posts: 15
- Joined: Fri Dec 28, 2012 11:59 pm
Re: Text output
--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?
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?
Re: Text output
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
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Re: Text output
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?
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
-
- Posts: 15
- Joined: Fri Dec 28, 2012 11:59 pm
Re: Text output
He keeps saying "it is stuck" if I just keep removing and adding the torch 

-
- Posts: 15
- Joined: Fri Dec 28, 2012 11:59 pm
Re: Text output
Else I should make the torch activate LUA script if it is activated itself - and deactivate Lua script if it is deactivated (removed)
-
- Posts: 15
- Joined: Fri Dec 28, 2012 11:59 pm
Re: Text output
NEVERMIND... couldn't do that :'(
-
- Posts: 15
- Joined: Fri Dec 28, 2012 11:59 pm
Re: Text output
The problem was that my torch was "activating" the Lua script ... It now works -.-