rexrainbow's Recent Forum Activity

  • Date.Year, Date.Month for year and month.

    Year/Month/Date

    Hours : Minutes : Seconds : Milliseconds

    like that

    forums.wasabistudio.ca/download/file.php

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Date.Day is weekday

    0 ="Sunday"

    1 ="Monday"

    2 ="Tuesday"

    ...

    Date.Date is day in a month (1~31)

  • Oops, sorry, I had fix it, try again.

    Edit:

    Expression:CurTicks is wrapped from Date.getTime()

  • I had implemented a 'date' plugin simply wrapped from javascript's Date object.

    Here is the zip file.

    You can get full year, month, date, hours, minutes, seconds, milliseconds from expression.

    And provided an action:Start timer, expression: Timer to get delta time in milliseconds. See the capx in zip file for example.

  • Thanks a lot.

  • Hi, I write a simple plugin to implement 'function' object like in C1.

    There is my plugin and test capx.

    dl.dropbox.com/u/5779181/plugins.7z

    I call 'runtime.trigger' in acts.CallFunction to trigger cnds.OnFunctionCalled.

         acts.CallFunction = function (name)
         {
            this._function_name = name; 
           ??this.runtime.trigger(cr.plugins_.MyFunction.prototype.cnds.OnFunctionCalled, this);
         }; 
         cnds.OnFunctionCalled = function (name)
         {
              return (this._function_name == name);
         };

    It works fine, OnFunctionCalled can be triggered correctly.

    But, there are something wrong when go back to caller.

    I find that in eveng.js, function: run_actions_and_subevents

              // Run each action
              for (evinfo.actindex = 0, len = this.actions.length; evinfo.actindex < len; evinfo.actindex++)
              {
                  ?if (this.actions[evinfo.actindex].run())
                        return;
              }

    evinfo.actindex is incorrected when runtime.trigger finished.

    In my test case,

    evinfo.actindex = 2 when executing action line 3 (Call function).

    Event "On function" only has 1 line, so that evinfo.actindex = 1 when leaved.

    Now, go back to previous for loop (run_actions_and_subevents). The evinfo.actindex changed to 1 (before was 2)

    So that line 3 will be executed again, and again.

    Do I miss something about using 'runtime.trigger'?

  • Using 'print' command to dump message at development period is import for me, so that I wrote a small application to let 'print' command work in construct.

    Tool can be download at

    sites.google.com/a/binhua.twbbs.org/construct-project/FileStorage/MessageConsoleClient.7z

    I use a named pipe client to send 'print' message from construct to my named pipe server application.

    The instruction of using this tool is,

    1. open named pipe server application MessageConsoleServer\MessageConsoleServer.exe

    2. execute construct application

  • Yes, it's my own. All of these source files are put in zip file.

    The concept of timeline is simple.

    At each tick:

    1. get current time

    2. pick timer which is time-out.

    3. execute callback function of timer picked in step2

    A performance issue is, it need call python function each tick.

  • Thanks, I got it.

  • I have wrote a timeline in python before.

    sites.google.com/a/binhua.twbbs.org/construct-project/FileStorage/timeLine.7z

    Here is a sample code to

    1. flash a sprite object immediately

    2. then wait 2 second

    3. rotate the sprite each 0.01 second

    def test_iter(timer, obj):

        obj.Flash(0.1, 1)

        timer.delay_time = 2

        yield QTimer.CONTINUE

        timer.delay_time = 0.01

        while(1):

            obj.RotateClockwise(1)

            yield QTimer.CONTINUE

  • Hi, I can't find link of example cap file, would you please tell me where to download it?

  • Thanks, the plasma works.

    Dose "Plasma.PasteObject("fireball")" means I can not designate a target instance(ex: fireball[0]) from a kind object?

    "if 1:" is just a switch to easy turn off python script by change "1" to "0"(just for testing purpose). The built-event can turn off by clicking "Toggle event".

rexrainbow's avatar

rexrainbow

Early Adopter

Member since 4 Apr, 2011

Twitter
rexrainbow has 84 followers

Connect with rexrainbow

Trophy Case

  • 13-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies