Kiosk / Demo mode ?
Post Reply
Quote
Re: Kiosk / Demo mode ?
Posted by rainbow_lazer on Sat Jan 7th at 8:34pm 2006


yes, i can get the logic_timer to fire on an interval, but i'm having some trouble resetting it. the input that seems closest to what i want is RefireTimer, but i don't think that adtually resets it, just changes the interval time.

are there any other timer options?

the only other idea i had was a pretty convoluted setup of a logic_timer, a math-counter, and a logic_compare, where the game_ui would add to the counter every time the X and YAxis changed. then when the timer fired, the logic_compare would compare the math_counter value to 0, and everything would be reset.
...i couldnt get that to work either. <img src=" SRC="images/smiles/sad.gif">

any ideas? thanks!




Quote
Re: Kiosk / Demo mode ?
Posted by wil5on on Sat Jan 7th at 10:10pm 2006


I think what youd have to do for that is use the timer to reset the math_counter to 0 after comparing. In what youve described, the math_counter is only 0 when the map loads. So the outputs would be something like:

game_ui: Add 1 to math_counter on XAxis, YAxis

logic_timer: On timer:
Compare logic_compare
(Delay 1s) Set math_counter to 0




&quot;If you talk at all during this lesson, you have detention. Do you understand?&quot;
- My yr11 Economics teacher



Quote
Re: Kiosk / Demo mode ?
Posted by rainbow_lazer on Sun Jan 8th at 6:46am 2006


well, it's funny... i had a reset function from the logic_timer, only it was output to the logic_compare, to change the SetValue back to 0. i tried outputting to math_counter to reset it to zero, but for some reason neither reset works.

i've been using the console command ent_messages to view the inputs & outputs for these entities, and for some reason, the math-counter is not being reset . i cant really see why that would be.

the counter itself works fine -- every time any of the direction buttons are pushed, the count increases. when i had the logic_timer set to output 0 to math_counter OnTimer, it seemed to be actually increasing the count by the timer interval instead of resetting it to zero.

anyhow, i'm gone for the weekend so maybe it'll fix itself before i'm back <img src=" SRC="images/smiles/icon_smile.gif">

any ideas are greatly appreciated. thanks!





Quote
Re: Kiosk / Demo mode ?
Posted by rainbow_lazer on Mon Mar 20th at 4:09am 2006


ok, here's how i did it:


Pt. 1: Create your timer system
____________________________________________________

create a trigger_once that covers most of the floor/ground in your level.

then create the following point entities anywhere:e

game_ui
logic_branch
logic_timer
a second logic_timer*
point_clientcommand

now for the settings:

trigger_once:

OnTrigger > game_ui > Activate

game_ui:

XAxis > logic_branch > SetValue with a parameter override of 1
YAxis > logic_branch > SetValue with a parameter override of 1

logic_timer #1

Refire Interval: 600
OnTimer > logic_branch > Test

logic_timer #2

Refire Interval: 300
OnTimer > logic_branch > SetValue with a prameter override of 0,
and a delay of 1 second

logic_branch

OnFalse > point_clientcommand > Command with a prameter override
of 'playdemo demo' [without those quotes, of course]


PT 2: Record your looping demo
___________________________________________________________

compile your map, then run it.
bring up the console and type 'record demo', [without those quotes]
this will record a demo with the title 'demo'

now run around and play your level, or do whatever you want to.
once you want to stop recording, bring the console back and type 'stop'.

to play your demo, type 'playdemo demo'
once your demo is playing, hit Shift + F2. this will bring up the demo playback controls.

hit the Pause button in the middle.

look to the lower left of the editor panel. you will see a line that reads:
'Tick: ###/###'
the ticks are sort of like frame numbers for your demo. the first group is the frame you're on, and the second is the total number in your demo.
Note the second number.

Now click the Edit button on the bottom of the panel. this brings up the demo editor.

click New... then select PlayCommands

name it 'restart'

set StartOn to TimeUseTicks, then set the number next to it to about 50 less than your total number of ticks.

then set Commands to 'playdemo demo' [no quotes]

this will restart the demo and make it loop forever.

(you can also do an edit to display a message which prompts the user to hit 'esc' to start a new game. i'll let you figure it out)


that's pretty much it. now if a player is inactive for more than 10 minutes, the game will run the demo loop forever until someone walks up and hits escape.

you can adjust the interval by changing the logic_timer refires.

have fun smiley





*note: you could probably do this with one logic_timer, but i just find it simpler this way.




Quote
Re: Kiosk / Demo mode ?
Posted by ReNo on Mon Mar 20th at 5:06am 2006


Thanks a lot for posting the final solution. You may want to consider posting this up as a tutorial - granted, it is a fairly specific use thing, but it's not something I've seen done before. Glad you got it working anyway <img src=" SRC="images/smiles/icon_smile.gif">






Post Reply