2019-02-20 snapshot

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

Re: 2019-02-20 snapshot

Post by vengefuluoto420 »

How can i change my avatar from Kermit lmao
hvpmvp
Posts: 319
Joined: Sat Apr 01, 2017 12:43 pm
Location: Michigan

Re: 2019-02-20 snapshot

Post by hvpmvp »

Can someone explain to me how to add these to a track?
aeffertz
Posts: 4031
Joined: Sat Sep 06, 2014 7:01 am
Team: Studio ATE
Location: Wiscansin

Re: 2019-02-20 snapshot

Post 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.
Image
jlv
Site Admin
Posts: 14930
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Post 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: /.*/ },
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.
hvpmvp
Posts: 319
Joined: Sat Apr 01, 2017 12:43 pm
Location: Michigan

Re: 2019-02-20 snapshot

Post 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
aeffertz
Posts: 4031
Joined: Sat Sep 06, 2014 7:01 am
Team: Studio ATE
Location: Wiscansin

Re: 2019-02-20 snapshot

Post by aeffertz »

Is there a full list of available functions anywhere?
Image
jlv
Site Admin
Posts: 14930
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Post by jlv »

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: 596
Joined: Wed Dec 29, 2010 8:03 am
Team: DAM
Location: North Carolina

Re: 2019-02-20 snapshot

Post 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.
jlv
Site Admin
Posts: 14930
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Post 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!
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.
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: 2019-02-20 snapshot

Post by DJ99X »

Right, I didn't understand the second number before, but that now explains why this only works for seq files.
aaronr5
Posts: 596
Joined: Wed Dec 29, 2010 8:03 am
Team: DAM
Location: North Carolina

Re: 2019-02-20 snapshot

Post by aaronr5 »

jlv I also meant to ask you, did you end up going with duktape for the js interpreter?
jlv
Site Admin
Posts: 14930
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: 2019-02-20 snapshot

Post 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.
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: 28
Joined: Thu Apr 14, 2011 11:41 pm
Team: TTT Racing

Re: 2019-02-20 snapshot

Post 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
TeamHavocRacing
Posts: 8361
Joined: Thu Nov 19, 2009 5:52 am
Team: Havoc Racing
Contact:

Re: 2019-02-20 snapshot

Post 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.
jlv wrote:If it weren't for Havoc I'd have been arguing with the 12 year olds by myself.
aeffertz
Posts: 4031
Joined: Sat Sep 06, 2014 7:01 am
Team: Studio ATE
Location: Wiscansin

Re: 2019-02-20 snapshot

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