How do you make time pass?

Discussion in 'General Modification' started by Shiningted, Aug 11, 2005.

Remove all ads!
  1. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,746
    Likes Received:
    375
    O more precisely, how do you make a moment go by between executions of Python commands?

    I want to have a game.particles appear, go through its whole routine, THEN have something appear after that. Just scripting them back to back means they get executed consecutively at Pentium speed and are basically concurrent to the naked eye.

    Is there some Python thing that will wait a designated period of time before executing the next command?
     
  2. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Try experimenting with "game.timeevent_add" (make a search for it in original scripts, and also on this forum - you'll find some information about it), seems to add an event (a function) that will execute in a certain period of time (someone said that 7200000 or something like that means two hours, it's somewhere in this forum).

    I would have looked into it personally, but I'm too tired (maybe I'll get to it later on).

    - Agetian
     
  3. darmagon

    darmagon stumbler in the dark

    Joined:
    Mar 22, 2005
    Messages:
    295
    Likes Received:
    0
    Code:
    game.timevent_add(function_name, (args), delay_time)
    note the spelling only one e (there is also a version with two e's but I have never tried it)
    okay, a bit of explantion: function_name is,strangely enough, the name of the function you want to call. args is a comma seperated list of the arguments you want to pass to the function and delay_time is the time the python interpreter will let pass before running the function. If you have my new spells (and I know you do) have a look in the script for Holy Sword. That should give you a rough idea of how to use it.

    The time is measured in milliseconds so 1000 ms/s*60 s/min*60 min/hr*2 hr = 7,200,000 ms

    Darmagon
     
  4. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,746
    Likes Received:
    375
    Thanks guys!
     
Our Host!