Value of a counter
Value of a counter
Hi all,
What is the new method to return the value of a counter ? old one was for example : counter1:getvalue()
I would like , to test a script , to print the value of counter1
Faerghail
What is the new method to return the value of a counter ? old one was for example : counter1:getvalue()
I would like , to test a script , to print the value of counter1
Faerghail
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Value of a counter
Code: Select all
function firetrappuzzle1()
local count1 = firecounter_1.counter:getValue()
local count2 = firecounter_2.counter:getValue()
local count3 = firecounter_3.counter:getValue()
if firecounter_1.counter:getValue() == 0 and
firecounter_2.counter:getValue() == 1 and
firecounter_3.counter:getValue() == 0 then
hudPrint("firecounter_1 has "..count1.." in value")
hudPrint("firecounter_2 has "..count2.." in value")
hudPrint("firecounter_3 has "..count3.." in value")
mine_door_spear_1.door:open()
else
mine_door_spear_1.door:close()
hudPrint("firecounter_1 has "..count1.." in value")
hudPrint("firecounter_2 has "..count2.." in value")
hudPrint("firecounter_3 has "..count3.." in value")
end
end
Re: Value of a counter
Great ,thank you for your quick answer 

- Mysterious
- Posts: 226
- Joined: Wed Nov 06, 2013 8:31 am
Re: Value of a counter
Hi. Hey Skuggs I like the coding. How would I use it with plates or levers etc.., if you don't mind thxs 

Re: Value of a counter
Skuggasveinn, I seen your part 7 of your tuto, and ... wow ^^
However , in case of a countdown ( never thinked to use the " Boss bar " to give a visual indication of the time , good tip), except by the hudprint ( Given only on the left -down screen corner ) , is there any solution to display something like a stopwatch ?
For example, entering in part of the dungeon, doing some puzzles, accessing to THE object ... but ... when taking it, begins a global CD with an alert message ... before all the dungeon parts will close/explose/disrupt/etc.
Love to stress players
However , in case of a countdown ( never thinked to use the " Boss bar " to give a visual indication of the time , good tip), except by the hudprint ( Given only on the left -down screen corner ) , is there any solution to display something like a stopwatch ?
For example, entering in part of the dungeon, doing some puzzles, accessing to THE object ... but ... when taking it, begins a global CD with an alert message ... before all the dungeon parts will close/explose/disrupt/etc.
Love to stress players

- SnowyOwl47
- Posts: 148
- Joined: Fri Sep 12, 2014 10:41 pm
Re: Value of a counter
@Doridion and @Mysterious You guys have some more questions but skuggs is not here right now he might be offline any way.
first thing:
@Mysterious What you want to do is the below:
Now I could be wrong but that should do it!
But just remember to replace lever.lever with your levers name.lever so lever_name.lever and so on.
Second thing:
@Doridion There is nothing you can use like a stopwatch the players will see you can use hudPrints though:
Now that is kinda a blob and would need to be worked on a lot but its still something!
first thing:
@Mysterious What you want to do is the below:
Code: Select all
lever.lever:getValue()
Code: Select all
plate.floortigger:getValue()
But just remember to replace lever.lever with your levers name.lever so lever_name.lever and so on.
Second thing:
@Doridion There is nothing you can use like a stopwatch the players will see you can use hudPrints though:
Code: Select all
function time(time)
while time == false do
hudPrint(time)
end
end
function timer()
script_entity.script.time(10)
end
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Value of a counter
Assuming there is a method like the old "onDrawGui" available for the party component (or another, new, component) then having a count down timer in the corner of the screen will be trivial.
.

My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: Value of a counter
Thanks for your answer SnowyOwl47 ^^ I thinked about a script like that, just sad that we've not yet more informations about script and assets references :p I'll certainly script light modifications for torchs ( pulsing red for example ) and the boss count. For the message, he'll come after.
@John : Not sure ; spawning a CD centered up of the screen and seeing seconds/milliseconds growing down is stress-up, and stress is good for a quality game
( I completly assume to be a torturer )
@John : Not sure ; spawning a CD centered up of the screen and seeing seconds/milliseconds growing down is stress-up, and stress is good for a quality game

- Mysterious
- Posts: 226
- Joined: Wed Nov 06, 2013 8:31 am
Re: Value of a counter
As Doridion said thxs again for the help SnowyOwl47
It's really good to have some help. Looking forward to more of your Scripts and other things.

- Halluinoid
- Posts: 165
- Joined: Tue Apr 02, 2013 7:08 pm
- Contact:
Re: Value of a counter
do you have to use coding to get the counter to work?
I placed a counter with a value of 3 next to a passageway
in the passageway is a floor trigger
I connected the floor trigger to the counter
I then connected the counter with a value of 3 to the corridor door
I expected the counter to open the door after the floor trigger had sent 3 counts to the counter but no, the door remains closed
I placed a counter with a value of 3 next to a passageway
in the passageway is a floor trigger
I connected the floor trigger to the counter
I then connected the counter with a value of 3 to the corridor door
I expected the counter to open the door after the floor trigger had sent 3 counts to the counter but no, the door remains closed

Beleagured Castle LOGII complete