PHP Map Preview Script
PHP Map Preview Script
So your wondering "What is this about?"
As it is my general desire to express myself briefly through the subject title, I think you can guess what this is going to be about
Yes. I've finally decoded the Javascript and recoded it in PHP. I don't know if anyone thought it was possible (I didn't think it would be). It took me a day to fully understand the script written in Javascript and then another day to find out as much as I could about the commands that I needed to accomplish what I had in mind.
Finally, after taking a few hours rest and a few hours of university studying, I have completed a version that I have tested and can tell you all that it works!
I've attached it to this post. So I hope people will find it useful.
UPDATE: 14 - 02 - 2013
Script is now located here: https://code.launchpad.net/~zodiacsohma ... ap_preview
As it is my general desire to express myself briefly through the subject title, I think you can guess what this is going to be about
Yes. I've finally decoded the Javascript and recoded it in PHP. I don't know if anyone thought it was possible (I didn't think it would be). It took me a day to fully understand the script written in Javascript and then another day to find out as much as I could about the commands that I needed to accomplish what I had in mind.
Finally, after taking a few hours rest and a few hours of university studying, I have completed a version that I have tested and can tell you all that it works!
I've attached it to this post. So I hope people will find it useful.
UPDATE: 14 - 02 - 2013
Script is now located here: https://code.launchpad.net/~zodiacsohma ... ap_preview
Last edited by LOVER$BOY on Thu Feb 14, 2013 3:48 am, edited 1 time in total.
Re: PHP Map Preview Script
Oopsy... I made a slight mistake in the script.
At line 131 and 132, those two values should be enclosed in the '..'
Like this:
At line 131 and 132, those two values should be enclosed in the '..'
Like this:
Code: Select all
$sizeWidth = '100%'; // the width of the map to display on the browser screen
$sizeHeight = '100%'; // the height of the map to display on the browser screen
- AI-team
- Shutout Match Winner
- Posts: 1020
- Joined: Tue Jun 23, 2009 6:17 pm
- Location: Germany/Munich
- Contact:
Re: PHP Map Preview Script
clientside rendering > serverside rendering
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
Re: PHP Map Preview Script
um... I don't understand what your trying to say AI-Team...
UPDATE: 14 - 02 - 2013
If anyone want an preview example of this script, check out my map's preview: http://vertrex.tk/aa/resource/index.php ... .aamap.xml
Here are the color standards:
GREEN - Win Zone
LIGHT GREEN - Target Zone
RED - Death Zone
Blue - Flag Zone
Orange - {Rubber | Unknown} Zone
Yellow - Teleport Zone
Brown - Ball Zone
UPDATE: 14 - 02 - 2013
If anyone want an preview example of this script, check out my map's preview: http://vertrex.tk/aa/resource/index.php ... .aamap.xml
Here are the color standards:
GREEN - Win Zone
LIGHT GREEN - Target Zone
RED - Death Zone
Blue - Flag Zone
Orange - {Rubber | Unknown} Zone
Yellow - Teleport Zone
Brown - Ball Zone
Last edited by LOVER$BOY on Thu Feb 14, 2013 3:54 am, edited 5 times in total.
Re: PHP Map Preview Script
The client is still the one rendering, this script is more of a translator from xml to svg.AI-team wrote:clientside rendering > serverside rendering
There's a difference between knowing your shit, and knowing you're shit. Grammar does matter.
- AI-team
- Shutout Match Winner
- Posts: 1020
- Joined: Tue Jun 23, 2009 6:17 pm
- Location: Germany/Munich
- Contact:
Re: PHP Map Preview Script
you know what I mean <_<
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
Re: PHP Map Preview Script
I do, but i havent seen the JS one, so theres not much context.AI-team wrote:you know what I mean <_<
There's a difference between knowing your shit, and knowing you're shit. Grammar does matter.
Re: PHP Map Preview Script
Oh ok.
Well the JS is linked in my first post. It's at pastebin for you all to see.
Well at-least this is now useful, I hope. Took me quite a while to get it right.
Well the JS is linked in my first post. It's at pastebin for you all to see.
Well at-least this is now useful, I hope. Took me quite a while to get it right.
Re: PHP Map Preview Script
Any resources you dont use in your server (by having the client do some of the work) mean they can be used for other things. This is what he means, if somebody has to waste resources, the client is preferred. Having the client do this has its pros and cons, same for doing it on the server; in this case, it doesnt really matter which way you go.LOVER$BOY wrote:um... I don't understand what your trying to say AI-Team...
There's a difference between knowing your shit, and knowing you're shit. Grammar does matter.
Re: PHP Map Preview Script
Your percentages on line 131 & 132 should be a string, else you get an error.
At least I do on version, PHP 5.4.4-12.
Now what I'm interested in, as I'm not used to SVG is, would it be possible to show point coordinates at the end of each wall? I'm trying to edit a map that has the most impossible to read coordinates ranging from like -25000 to 25000 and I just need to change one wall by a few places. I can't figure out which wall it is though, lol.
Well, figured it out the hard way, but coordinates would be very nice in the future.
At least I do on version, PHP 5.4.4-12.
Now what I'm interested in, as I'm not used to SVG is, would it be possible to show point coordinates at the end of each wall? I'm trying to edit a map that has the most impossible to read coordinates ranging from like -25000 to 25000 and I just need to change one wall by a few places. I can't figure out which wall it is though, lol.
Well, figured it out the hard way, but coordinates would be very nice in the future.
Re: PHP Map Preview Script
Sure, I'll see what I can do about it. Thanks for bringing this to my attention
I know what your talking about since I have seen turtle/adveture/ maps of Advanced Racing of Adventures of Tron. I can barely see the overview of the map since sine mapped it so huge
Also, if people are interested, all of my free scripts are located here: http://vertrex.tk/wiki/Scripts
I know what your talking about since I have seen turtle/adveture/ maps of Advanced Racing of Adventures of Tron. I can barely see the overview of the map since sine mapped it so huge
Also, if people are interested, all of my free scripts are located here: http://vertrex.tk/wiki/Scripts