Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 11

120.36.x.x forum
175.44.x.x forum
178.255.x.x forum
199.21.x.x forum
23.22.x.x forum
5.254.x.x forum
66.249.x.x forum
66.249.x.x dilbertplus
85.11.x.x news
91.236.x.x comment
94.228.x.x rss

Last Seen

TacTicToe Mon 22:33
Dodgeitorelse Mon 19:45
xMin Mon 17:18
»Stefan Mon 16:57
daezor2001 Mon 10:38

Newest Members

Forums
Multiple map names / single map images
palyarmerc
Mon Apr 23 2012, 02:30PM

Posts: 63
Joined: Mon Apr 02 2007, 07:08PM
Registered Member #2999
I had multiple map name variants of a single map (image)

for example, in Ghost Recon, DRx made day,night,snow,clear versions of the same map. So I did some editing...

lgsl_class.php

function lgsl_image_map($status, $type, $game, $map, $check_exists = TRUE, $id = 0)
{
global $lgsl_file_path, $lgsl_url_path;

$type = preg_replace("/[^a-z0-9_]/", "_", strtolower($type));
$game = preg_replace("/[^a-z0-9_]/", "_", strtolower($game));
$map = preg_replace("/[^a-z0-9_]/", "_", strtolower($map));


//-----------GhostRecon-------fixes -DRx-s Day/Night/Rain/Snow variants------------------------------+


if (preg_match("/caves/",$map,$matches)) {$map = str_replace($map, "m01_caves", $map);}
if (preg_match("/m02_farm/",$map,$matches)) {$map = str_replace($map, "m02_farm", $map);}
if (preg_match("/rrbridge/",$map,$matches)) {$map = str_replace($map, "m03_rrbridge", $map);}


etc,etc

So, for example, if any map with caves in the title appears, it only shows the stock m01_caves.jpg image
even if there are maps called

DRx m01 caves -day-
DRx m01 caves -night-
etc,etc

Website
Wussie
Tue Apr 24 2012, 05:51PM

Posts: 166
Joined: Sun Mar 22 2009, 06:53AM
Registered Member #4938
Your intentions are good but it doesn't seem like a very practical approach. What if tomorrow comes out an all new "caves_something" map which should have an entirely different image? And what about many other maps with variants which are not named "caves", "farm" or "rrbridge", should they be added to lgsl_class.php too?
In my humble opinion, editing core php scripts within LGSL may be fine for a connaisseur like yourself, but sounds like a bad idea for the average user.
The easy way to link multiple map names to the same map image is probably this (only if you run on LINUX): make a symlink for each map variant pointing to the same image name.
In your case, you need to type the following into the Linux console, from within the images folder:
ln -s m01_caves.jpg m01_caves_day_.jpg

Basically, this will create a shortcut m01_caves_day_.jpg pointing to the same image m01_caves.jpg, working exactly like having 2 separate images but with less space occupied on the harddrive.
You will need to have shell access to the webserver to do that, unless your ftp client or cpanel can also create symlinks.
I'm not sure if shortcuts on Windows systems can do the same trick as symlinks on Linux, but one could try it and get back here to report...
Website
palyarmerc
Tue Apr 24 2012, 06:02PM

Posts: 63
Joined: Mon Apr 02 2007, 07:08PM
Registered Member #2999
You are absolutely right.

In the main, most missions/mapnames were named after the maps.
If not, I still needed a map image or to do as you've suggested.

I did it this way because it does not require you to have another map image, or know the mission/mapname
I was faced with having to create as many as 10 identical images
not to mention having to work out how many under_scores to get it to show up
eg:

***OE06 - Embassy Rescue
M05 Embassy -Night-
*SK* Embassy
Embassy Action
HX-D-Embassy
,HX-MP-Embassy
.HX(team) Embassy

There are around 60+ maps (a lot of work in itself) but well over 500+ missions

So you see, with one line, I bypassed a lot of work.
Website
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org