Graphics

 View Only
  • 1.  SCRIPT FOR TRIGGERING ADDED TIME

    Posted 02-05-2025 18:40

    Hello, I need help, I'm stuck with scritpting, I have thre clocks, FirstHalfClock which stops at 45:00, SecondHalfClock which starts at 45:00 and stops at 90:00, and lastly AddedTimeClock which only becomes visible and starts counting from 0.00 when the FirstHalfClock or SecondHalfClock stops at their set times, it is triggered when one of these two clocks reaches the set stop time. So I need help with scripting for that. Thank you



    ------------------------------
    LOETO
    ------------------------------


  • 2.  RE: SCRIPT FOR TRIGGERING ADDED TIME

    Posted 02-06-2025 07:03

    This method uses a widget 

    Start clock

    dim main as xpClocktimerwidget

    Engine.GetWidgetByName("Game Timer", main)

     main.start


    Stop Clock

    dim main as xpClocktimerwidget

    dim extra as xpclocktimerwidget

    Engine.GetWidgetByName("Game Timer", main)

    Engine.GetWidgetByName("Extra Timer", extra)

    main.stop

    extra.stop

    set clock to 0 to 45

    dim main as xpClocktimerwidget

    dim extra as xpclocktimerwidget

    Engine.GetWidgetByName("Extra Timer", extra)

    Engine.GetWidgetByName("Game Timer", main)

    main.startat="00:00:00.000"

    main.stopat="00:45:00.000"

    extra.startat="00:00:00.000"

    main.reset

    extra.reset

    set clock to 45 to 90

    dim main as xpClocktimerwidget

    dim extra as xpclocktimerwidget

    Engine.GetWidgetByName("Extra Timer", extra)

    Engine.GetWidgetByName("Game Timer", main)

    main.startat="00:45:00.000"

    main.stopat="01:30:00.000"

    extra.startat="00:00:00.000"

    main.reset

    extra.reset

    setting extra time / custom time

    dim scene1 as xpscene

    dim clockval as xptextobject

    dim extra as xpclocktimerwidget

    Engine.GetWidgetByName("Extra Timer", extra)

    engine.getscenebyname("BUG", scene1)

    scene1.getobjectbyname("clock value", clockval)

    dim main as xpClocktimerwidget

    dim str as string

    str = clockval.text & ".000"

    Engine.GetWidgetByName("Game Timer", main)

    main.startat= str

    if clockval.text <= "00:45:00" then

    main.stopat = "00:45:00.000"

    else

    main.stopat = "01:30:00.000"

    end if

    extra.startat="00:00:00.000"

    main.reset

    extra.reset



  • 3.  RE: SCRIPT FOR TRIGGERING ADDED TIME

    Posted 02-06-2025 10:00

    Thank Simon, I will test the script and provide the feedback on it



    ------------------------------
    LOETO
    ------------------------------



  • 4.  RE: SCRIPT FOR TRIGGERING ADDED TIME

    Posted 02-06-2025 08:08
      |   view attached

    Hi.

    In the attached project I did it the way you want, if I understood you correctly.



    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------

    Attachment(s)

    xpf
    TimeCounter.xpf   9 KB 1 version


  • 5.  RE: SCRIPT FOR TRIGGERING ADDED TIME

    Posted 02-06-2025 10:02

    Thank you too Roman, I will open the project and see if you did it the way I want it, I'll also give feeback on this



    ------------------------------
    LOETO
    ------------------------------