Preparing a Vis. project... (Catyph)

  • #40, by Simon_ASAWednesday, 22. January 2014, 19:13 11 years ago
    Can't wait to discover the new wiki then !
    Thanks for the details.

    By the way, I just released the short film introducing the world of my game Catyph :
    http://vimeo.com/84080449
    Hope some people like it here !
    A shame that I didn't find a german person to translate the subtitles razz

    Great Poster

    321 Posts


  • #41, by afrlmeWednesday, 22. January 2014, 19:48 11 years ago
    new wiki is here but it's nowhere near done - still has some useful info on it though.

    will check the film out later wink

    Imperator

    7278 Posts

  • #42, by denis-Wednesday, 22. January 2014, 21:09 11 years ago
    Woa! Very impressive! seems to see a mix of "The Dig" and "Mission to Mars" (not the chocolate! grin)
    Which program you have used for the graphics? Max? Maya or...what?!? Hope to see more about your project! Looks like very interesting)

    Newbie

    74 Posts

  • #43, by Simon_ASAWednesday, 22. January 2014, 22:38 11 years ago
    Hey thanks Denis, this is Max yep ! With After Effects + various plugins that I purchased last year. I'm glad you liked the film. If you want you can have a look at my older works : http://vimeo.com/simonsayswatchplay
    The film 2011: A Space Adventure is quite similar to Catyph and had inspired my previous game ASA !

    new wiki is here

    oh ! Yes indeed, you gave it once already ! I don't know why I didn't keep the link somewhere for a quick access. This one is much better

    Great Poster

    321 Posts

  • #44, by Simon_ASATuesday, 28. January 2014, 22:59 11 years ago
    How can I display a timer in a menu, at a specific place on the screen ?
    Example : when the player opens the game menu, he can see the time he has been playing the game since the beginning.
    The timer would need to be saved everytime the game is quit, and restart at the same time when the game is loaded.

    Great Poster

    321 Posts

  • #45, by afrlmeWednesday, 29. January 2014, 00:59 11 years ago
    you need to use values in the editor... you could use a single value & then use lua to convert the value into hours, minutes & seconds etc or you could use multiple values. 2 for hours, 2 for minutes & 2 for seconds (if you want to show seconds, that is) - then you allow value of 0 to 6 for each of the initial values & 0 to 9 for secondary values... then you increment the values accordingly & use if queries to check & reset certain values when they reach a certain amount.

    'ack it's a bit hard to explain in a quick reply so here, check out a timer script I made a while ago. https://www.visionaire-studio.net/forum/thread/animated-24-h...

    Imperator

    7278 Posts

  • #46, by Simon_ASAWednesday, 29. January 2014, 15:44 11 years ago
    check out a timer script I made a while ago. https://www.visionaire-studio.net/forum/thread/animated-24-h...


    Thanks, this is a great template !
    I have copied the script/conditions/actions/etc... to my scene. The timer displays correctly but it runs very very fast. So fast that I can't read the numbers ! And I think they turn in loop, without doing anything at zero.
    Do you have an idea on what I could have done wrong ? I have cheked everything several time but I don't find the mistake.
    I didn't use a pause button, so maybe there's something I must modify ?

    hopefully some of you ungrateful bugrits will appreciate this!

    I do appreciate and I am very grateful smile

    Great Poster

    321 Posts

  • #47, by afrlmeWednesday, 29. January 2014, 15:51 11 years ago
    I don't remember exactly how it worked... maybe I used Lua to force the current frame of each animation or I used an individual animation for each number value?

    you may have to look at my script & see how it works - I usually add comments to the scripts. If you can't figure it out then let me know & I'll have a wee look when I can.

    Imperator

    7278 Posts

  • #48, by Simon_ASAWednesday, 29. January 2014, 19:01 11 years ago
    I definetely don't find the mistake. I spent the afternoon on it but it still doesn't work. Same problem : the numbers scroll almost instantly from 9 to 0 (or 5 to 0), and they loop very fast (reset to their max value when they reach 0). The result is fun but not as expected :p

    If you can find some time someday to help, it would be great.
    No need to hurry on this, I'll work on something else.

    This is what I did :

    Copied the .lua file in a [scripts] folder of my project.
    (file Timer_display.lua)
    I checked it, read it several times, didn't change anything.

    ---

    Scripts :

    added the following Definition script

    function loadScripts()
      local f, cerror
    
      f, cerror = loadfile("./scripts/timer_display.lua")
      if f == nil then
        print("cerror: " .. cerror)
      else
        print("Load external scripts")
        f()
      end
    end
    


    ---

    Scenes :

    In my first scene, i added these 2 conditions, set to false :
    timer_is_on?
    timer_is_paused?

    ---

    Interfaces :

    I want to display the timer in my Options interface.
    set to class Options Interface

    I have created my own numbers sequence from 0 to 9 (png)

    Creation of the following buttons :
    day_single
    hour_double
    hour_single
    minute_double
    minute_single
    second_double
    second_single

    Creation of the following Values :
    sin_day_val
    dbl_hour_val
    sin_hour_val
    dbl_min_val
    sin_min_val
    dbl_sec_val
    sin_sec_val

    Each Button :
    - is set to Action area
    - contains the numbers sequences in the animation tab (dsa, hda, hsa, mda, msa, sda, ssa), from 0 to 9 or 0 to 5 depending on the digit.
    (Animations setting : pauses [msec] = 0, infinite loop)

    ---

    Character :

    Interfaces :
    I checked my Options interface

    I created 2 new actions :

    Action 1 : Load_timer_settings
    (called by other action)

    >Change condition timer_is_paused? to false
    >Change condition timer_is_on? to true
    >Execute script load_Scripts()
    >Execute script startCountdown()

    Action 2 : Check_time
    (called by other action)

    >If condition timer_is_paused? is false
    if condition timer_is_on? is true
    pause for 1 second
    execute script check_ssd_val()
    jump to action part, jump relative, value -4
    else
    play video YouLose.avi
    end if
    >end if

    ---

    Scenes :

    at beginning of the scene, load action :
    load_timer_settings

    Great Poster

    321 Posts

  • #49, by afrlmeWednesday, 29. January 2014, 20:59 11 years ago
    er it has 0 - 9 inside of each animation no?

    it needs to set the first & last frame for each animation on game launch, which prevents it from cycling through the animation frames.

    as for the definition script: you don't need that - you could just copy the script from the actual .lua file into the editor script section as a definition script. the reason for the load script is because I work externally in sublime instead of the script editor & I can't be bothered copy/pasting & saving the project each time I edit scripts. once I've finished I add them into the editor itself.

    also that script is a countdown timer - it's also possible to edit it to count upwards instead.

    could you check the log file for me please? let me know what it says. I have a feeling that it is buggering up on account of trying to locate active animations that are not active.

    Imperator

    7278 Posts

  • #50, by Simon_ASAFriday, 31. January 2014, 11:40 11 years ago
    Thanks for your help.
    It doesn't have 0 - 9 inside each animation : the double hour, double minute and double second have a 0 - 5 animation. I did the same than in your template, so I don't think it's the problem wink

    This is what the log file says :

    11:28:37: Error: Failed to run string in Lua: [string "load_Scripts()"]:1: attempt to call global 'load_Scripts' (a nil value)
    11:28:37: Error: String content: load_Scripts()
    11:28:37: Error: Failed to run string in Lua: [string "startCountdown()"]:1: attempt to call global 'startCountdown' (a nil value)
    11:28:37: Error: String content: startCountdown()

    I don't understand well what it means, I hope you will.

    also that script is a countdown timer - it's also possible to edit it to count upwards instead.


    I'll ask you later about that, if the countdown works in my game, but I'm interested !

    Great Poster

    321 Posts