Page 4 of 5

Re: 2019-02-20 snapshot

Posted: Sun Feb 24, 2019 2:21 pm
by vengefuluoto420
How can i change my avatar from Kermit lmao

Re: 2019-02-20 snapshot

Posted: Sun Feb 24, 2019 3:42 pm
by hvpmvp
Can someone explain to me how to add these to a track?

Re: 2019-02-20 snapshot

Posted: Sun Feb 24, 2019 6:39 pm
by aeffertz
hvpmvp wrote:Can someone explain to me how to add these to a track?
You're going to have to learn Javascript. JLV gave an example on the previous page.

Re: 2019-02-20 snapshot

Posted: Mon Feb 25, 2019 3:24 am
by jlv
vengefuluoto420 wrote:How can i change my avatar from Kermit lmao
These lines control the avatars. The catch all at the end is Kermit. Each line matches a name to the row and column the avatar is in. The names are regular expressions, which are a complicated subject but if you just use /\bFIRSTNAME.*\bLASTNAME\b/i it should do what you want.

Code: Select all

        { page: 1, row: 0, col: 1, re: /\bmiss.*\bpiggy\b/i },
        { page: 1, row: 1, col: 0, re: /\bgonzo\b/i },
        { page: 1, row: 1, col: 1, re: /\bfozzy.*\bbear\b/i },
        { page: 1, row: 2, col: 0, re: /\browlf\b/i },
        { page: 1, row: 2, col: 1, re: /\bscooter\b/i },
        { page: 1, row: 3, col: 0, re: /\bpepe.*\bprawn\b/i },
        { page: 1, row: 3, col: 1, re: /\brizzo.*\brat\b/i },
        { page: 1, row: 4, col: 0, re: /\bbunsen.*\bhoneydew\b/i },
        { page: 1, row: 4, col: 1, re: /\bbeaker\b/i },
        { page: 1, row: 5, col: 0, re: /\bwaldorf\b/i },
        { page: 1, row: 5, col: 1, re: /\bstatler\b/i },

        /* catch all - this should be last */
        { page: 1, row: 0, col: 0, re: /.*/ },

Re: 2019-02-20 snapshot

Posted: Tue Feb 26, 2019 12:13 am
by hvpmvp
aeffertz wrote:
hvpmvp wrote:Can someone explain to me how to add these to a track?
You're going to have to learn Javascript. JLV gave an example on the previous page.
RIP

Re: 2019-02-20 snapshot

Posted: Sun Mar 03, 2019 9:58 pm
by aeffertz
Is there a full list of available functions anywhere?

Re: 2019-02-20 snapshot

Posted: Mon Mar 04, 2019 2:17 am
by jlv
aeffertz wrote:Is there a full list of available functions anywhere?
Sorry, not yet. Will definitely be writing some documentation soon though.

Re: 2019-02-20 snapshot

Posted: Fri Mar 08, 2019 11:11 pm
by aaronr5
jlv, could you give me a quick explanation on how mx.paste_custom_frame works or even just what the arguments for it are? I tried figuring it out from the jstest example but couldn't understand it.

Re: 2019-02-20 snapshot

Posted: Sat Mar 09, 2019 1:45 am
by jlv
aaronr5 wrote:jlv, could you give me a quick explanation on how mx.paste_custom_frame works or even just what the arguments for it are? I tried figuring it out from the jstest example but couldn't understand it.
The parameters are like this:

mx.paste_custom_frame(texture_id, frame_number, src_x, src_y, dst_x, dst_y, width, height)

It copies width x height pixels from the specified frame in the sequence file to the texture. "texture_id" is the texture id you got from "mx.read_texture()". "frame_number" is the frame number starting from 0. "src_x" and "src_y" are the location in the source frame and "dst_x" and "dst_y" are the location in the texture. The coordinates are in width and height units. So "0" is the left edge and "1" is the right edge.

So as an example, if you wanted to copy the bottom right corner of frame 5 to the center of the texture, you'd do this:

frame=5;
sx=0.5;
sy=0.5;
dx=0.25;
dy=0.25;
w=0.5;
h=0.5;
mx.paste_custom_frame(mytid, frame, sx, sy, dx, dy, w, h);

"begin_custom_frame" initializes the texture to black or transparent depending on whether the texture has an alpha channel.

Sorry I don't have any documentation yet!

Re: 2019-02-20 snapshot

Posted: Sat Mar 09, 2019 3:13 am
by DJ99X
Right, I didn't understand the second number before, but that now explains why this only works for seq files.

Re: 2019-02-20 snapshot

Posted: Sun Mar 10, 2019 1:34 am
by aaronr5
jlv I also meant to ask you, did you end up going with duktape for the js interpreter?

Re: 2019-02-20 snapshot

Posted: Sun Mar 10, 2019 2:49 am
by jlv
aaronr5 wrote:jlv I also meant to ask you, did you end up going with duktape for the js interpreter?
Yes, it's duktape.

Re: 2019-02-20 snapshot

Posted: Tue Mar 12, 2019 5:17 pm
by willyt366
Anyone created a track yet with sounds thats ready to DL? Id love to hear the sounds in the game but not too experienced in Java

Re: 2019-02-20 snapshot

Posted: Tue Mar 12, 2019 6:02 pm
by TeamHavocRacing
willyt366 wrote:...not too experienced in Java
DBRider251 wrote:I recommend Udemy honestly. $12 for a course, usually better than a college professor.
aaronr5 wrote:
aeffertz wrote:Anybody got a good Javascript course/tutorial on YouTube or Skillshare?
Eloquent javascript
jlv wrote: Mozilla's reference pages are excellent.

Re: 2019-02-20 snapshot

Posted: Tue Mar 12, 2019 11:14 pm
by aeffertz
willyt366 wrote:Anyone created a track yet with sounds thats ready to DL? Id love to hear the sounds in the game but not too experienced in Java
The rF Indianapolis track has some sounds on it this week.