2019-02-20 snapshot

Post anything about MX Simulator here. Please. I'm begging you.
vengefuluoto420
Posts: 40
Joined: Sun Oct 29, 2017 1:49 am
Team: Privateer

Re: 2019-02-20 snapshot

Postby vengefuluoto420 » Sun Feb 24, 2019 2:21 pm

How can i change my avatar from Kermit lmao

User avatar
hvpmvp
Posts: 144
Joined: Sat Apr 01, 2017 12:43 pm
Team: Privateer
Location: USA

Re: 2019-02-20 snapshot

Postby hvpmvp » Sun Feb 24, 2019 3:42 pm

Can someone explain to me how to add these to a track?

User avatar
aeffertz
Posts: 3524
Joined: Sat Sep 06, 2014 7:01 am
Team: W.B.G
Location: Wiscansin

Re: 2019-02-20 snapshot

Postby aeffertz » Sun Feb 24, 2019 6:39 pm

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.
Image

jlv
Site Admin
Posts: 13383
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Postby jlv » Mon Feb 25, 2019 3:24 am

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: /.*/ },
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

User avatar
hvpmvp
Posts: 144
Joined: Sat Apr 01, 2017 12:43 pm
Team: Privateer
Location: USA

Re: 2019-02-20 snapshot

Postby hvpmvp » Tue Feb 26, 2019 12:13 am

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

User avatar
aeffertz
Posts: 3524
Joined: Sat Sep 06, 2014 7:01 am
Team: W.B.G
Location: Wiscansin

Re: 2019-02-20 snapshot

Postby aeffertz » Sun Mar 03, 2019 9:58 pm

Is there a full list of available functions anywhere?
Image

jlv
Site Admin
Posts: 13383
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Postby jlv » Mon Mar 04, 2019 2:17 am

aeffertz wrote:Is there a full list of available functions anywhere?

Sorry, not yet. Will definitely be writing some documentation soon though.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

aaronr5
Posts: 593
Joined: Wed Dec 29, 2010 8:03 am
Team: DAM
Location: North Carolina

Re: 2019-02-20 snapshot

Postby aaronr5 » Fri Mar 08, 2019 11:11 pm

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.

jlv
Site Admin
Posts: 13383
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Postby jlv » Sat Mar 09, 2019 1:45 am

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!
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

User avatar
DJ99X
Posts: 15503
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: 2019-02-20 snapshot

Postby DJ99X » Sat Mar 09, 2019 3:13 am

Right, I didn't understand the second number before, but that now explains why this only works for seq files.

aaronr5
Posts: 593
Joined: Wed Dec 29, 2010 8:03 am
Team: DAM
Location: North Carolina

Re: 2019-02-20 snapshot

Postby aaronr5 » Sun Mar 10, 2019 1:34 am

jlv I also meant to ask you, did you end up going with duktape for the js interpreter?

jlv
Site Admin
Posts: 13383
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Postby jlv » Sun Mar 10, 2019 2:49 am

aaronr5 wrote:jlv I also meant to ask you, did you end up going with duktape for the js interpreter?

Yes, it's duktape.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

willyt366
Posts: 26
Joined: Thu Apr 14, 2011 11:41 pm
Team: TTT Racing

Re: 2019-02-20 snapshot

Postby willyt366 » Tue Mar 12, 2019 5:17 pm

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
Check out my youtube channel!
https://www.youtube.com/channel/UCyMiqu ... Hi7whl8yTw
Subscribe!

User avatar
TeamHavocRacing
Posts: 7228
Joined: Thu Nov 19, 2009 5:52 am
Team: Havoc Racing
Contact:

Re: 2019-02-20 snapshot

Postby TeamHavocRacing » Tue Mar 12, 2019 6:02 pm

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.
変化がなければ、何かが私たちの中で眠り、めったに目覚めません

User avatar
aeffertz
Posts: 3524
Joined: Sat Sep 06, 2014 7:01 am
Team: W.B.G
Location: Wiscansin

Re: 2019-02-20 snapshot

Postby aeffertz » Tue Mar 12, 2019 11:14 pm

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.
Image


Return to “General Discussion”

Who is online

Users browsing this forum: aeffertz, Solli_93 and 4 guests