Mapper (simplifies map making)

Designed a level that creates new, exciting, and challenging Armagetron game play? Or maybe just something funky. Put it right here.
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Mapper (simplifies map making)

Post by ivantis »

I wrote a script in Perl that takes standard input and converts it into parts of a map to copy and paste (it mainly saves your hands typing). Download it from http://arma.ivantis.net/mapper.zip.
Note: You may have to change the first line of code to your Perl interpreter's path. Mine is /usr/bin/perl.
Image
Image
Image
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Post by kyle »

looks nice.

what about making it do some duty work like adding in circle walls and 3 point arks.
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

what kind of input does it take?
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

kyle: how do i do that? im not too good at maps, i just needed something to do

epsy: it takes standard input, you should run it through your command line on Mac OS X and UNIX/Linux systems, if you run windows, you will need a port of Perl, find one at cpan.org
Image
Image
Image
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

i understood it takes it's input from the stdin, i was asking what form of input does it take? i don't get it
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

like, on the first thing you type wall, zone, or spawn, and it will give you directions
Image
Image
Image
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Post by kyle »

i don't know perl but,
for a circle you would ask for center, radius and number of points.

then you would take and make a loop start at point 0 and go all the way up to that number of points (you have to have 1 extra to close it)

in that look you add the x point and y point

x would be center_x + radius_x * cos(point*2*PI/points)
y would be center_y + radius_y * sin(point*2*PI/points)

EDIT:^^yes better formula z-man i was sleepy
Last edited by kyle on Mon May 19, 2008 1:04 pm, edited 1 time in total.
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

kyle wrote:x would be center_x + radius * cos(point*2*PI/points)
y would be center_y + radius * sin(point*2*PI/points)
Better :)
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

what? could you dumb that down for me
Image
Image
Image
User avatar
Lucifer
Project Developer
Posts: 8641
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

To draw a circle, ask the user for the location of the center and a radius, and you can use kyle's formula to determine the points that are needed in the circle.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Post by kyle »

we can add radius_x and radius_y to make an ellipse also :D formula updated
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

hmm... idk if perl will solve with sin and cos. what do sin and cos mean anyway? im no good at math. if they dont work in perl, maybe i should translate it to C++ or something.
Image
Image
Image
User avatar
Lucifer
Project Developer
Posts: 8641
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

They're trig functions. Perl has them, but you may need to load a math module to get them. You do in python, anyway.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

ok, i tried it out and perl can handle sin and cos. how do i find where the points will be plotted with that forumla?
Image
Image
Image
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

http://mathworld.wolfram.com/Trigonometry.html

Specifically:
Let θ be an angle measured counterclockwise from the x-axis along an arc of the circle. Then cos(θ) is the horizontal coordinate of the arc endpoint, and sin(θ) is the vertical component.
Post Reply