Thanks thats really helpful
I've had some puzzles in mind but couldn't get them to work, so this will make it easier to make better puzzles
Script Help
Re: Script Help
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
-
- Posts: 366
- Joined: Tue Jan 15, 2013 3:26 am
- Location: Oregon
Re: Script Help
Getting away from the actual script / puzzle your working on, I just wanted to add something I like to do when creating stuff.
I like to use hudPrint() as a type of debug to keep track of variables at each step of the process.
For example if you have a puzzle where you push a button 3 times to open a door (i.e. counter decrements from 3 to 0 then linked to door). I put a hudPrint() in so I can actually see if the counter is decrementing.
Note, obviously this only works with a script, but if you need you can add a script with the only function on printing the counter, or lever state, or door opened or closed etc. I find it very helpful in seeing what is going on and I have solved many mysteries that way.
Hope it helps.
I like to use hudPrint() as a type of debug to keep track of variables at each step of the process.
For example if you have a puzzle where you push a button 3 times to open a door (i.e. counter decrements from 3 to 0 then linked to door). I put a hudPrint() in so I can actually see if the counter is decrementing.
Note, obviously this only works with a script, but if you need you can add a script with the only function on printing the counter, or lever state, or door opened or closed etc. I find it very helpful in seeing what is going on and I have solved many mysteries that way.
Hope it helps.
Re: Script Help
Actually I had a setup like that with a button that told me what each counter was at, so when I got it working I knew which parts were causing the problem
In the end the puzzle works for the right answer, but even trying all the above scripts it would randomly change the counters value when a wrong answer was given, since the result was different every time I couldn't figure out what was the cause. In the end I went with a reset switch, it works fine once the puzzle is reset, and should help anyone who gets stuck
Might keep playing with it, just to see if I can get it working perfectly
In the end the puzzle works for the right answer, but even trying all the above scripts it would randomly change the counters value when a wrong answer was given, since the result was different every time I couldn't figure out what was the cause. In the end I went with a reset switch, it works fine once the puzzle is reset, and should help anyone who gets stuck
Might keep playing with it, just to see if I can get it working perfectly
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Re: Script Help
Just to make sure -- are all the shield-holders set to "Activate always" ?
you could use print("1: "..s1:isActivated().." 2: "..s2:isActivated().. (etc.) )
to always print what is the status of the holders as seen by the game.
You could also use
print(tostring(counter1:getValue())) to see what is the internal value of each counter -- this way, you will be able to exactly pinpoint what happens when the shields are added/removed, and pinpoint where the bug is in your code.
you could use print("1: "..s1:isActivated().." 2: "..s2:isActivated().. (etc.) )
to always print what is the status of the holders as seen by the game.
You could also use
print(tostring(counter1:getValue())) to see what is the internal value of each counter -- this way, you will be able to exactly pinpoint what happens when the shields are added/removed, and pinpoint where the bug is in your code.
Re: Script Help
I found print much more useful than hudPrint because it sticks around, and you can see a lot more lines
Finished Dungeons - complete mods to play
-
- Posts: 366
- Joined: Tue Jan 15, 2013 3:26 am
- Location: Oregon
Re: Script Help
I haven't figured that out yet. I think I read somewhere about changing a config file but I get a bit skittish about changing the actual game files.Komag wrote:I found print much more useful than hudPrint because it sticks around, and you can see a lot more lines
Re: Script Help
Nice scripting going on around here. Love your shields and other bits and pieces LocalFire!
Re: Script Help
It's extremely failsafe to do it, no risk at all really, and very beneficial, there's no way I could have made my mods without it.
Finished Dungeons - complete mods to play
Re: Script Help
Thanks guys i'm using (tostring(counter1:getValue())) to check the counters, the master counter works and the individual counters work for the right answer, the problem happens when a wrong answer is given
As expected a wrong shield won't activate the script and the counter resets to 2, but when the right answer is put in after the decrease is 1 most of the time (as opposed to 2) and sometimes 3, all without changing anything, same setup, same conditions, different result. I put in a reset button that fixes the problem, after a reset everything seems fine.
And Grimfan thanks I made them just as an experiment to see if I could, I'm quite happy with how they turned out
As expected a wrong shield won't activate the script and the counter resets to 2, but when the right answer is put in after the decrease is 1 most of the time (as opposed to 2) and sometimes 3, all without changing anything, same setup, same conditions, different result. I put in a reset button that fixes the problem, after a reset everything seems fine.
And Grimfan thanks I made them just as an experiment to see if I could, I'm quite happy with how they turned out
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443