Edit map file ?

Everything else which you can't find above

Moderator: TM-Patrol

Post Reply
User avatar
RamCUP2000
road tourist
road tourist
Posts: 105
Joined: 01 Apr 2009 17:43
Owned TM-games: MP, TMU(F), TMS, TMO
Manialink(s): usdmania
Location: Czech republic » Jihomoravský kraj » Břeclav
Contact:

Edit map file ?

Post by RamCUP2000 » 13 Oct 2012 14:44

Hi, I have a simple question.
Is any way of editing map file correctly? Outside TM...

Code: Select all

$gbx = file_get_contents($filename);
$gbx = str_ireplace(array('Sunrise','Day','Sunset','Night'), 'Night', $gbx);
file_put_contents($filename, $gbx);
This PHP edited a file, but TM didn't open edited file...

Thanks :)
Image
Czech ManiaPlanet Moderator
TrackMania player since Q2 2004 (TrackMania v1.2.5)

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: Edit map file ?

Post by Xymph » 13 Oct 2012 15:19

No, because the string length value just before the string itself is no longer correct in 3 out of 4 cases, the changed length will break all offsets to other data in the file, and the replace may affect more places in the track file than just the header. And even if you somehow managed to correctly changed the mood in such a simplistic manner, there's no guarantee you'll actually see the effect in-game, because the game client may use a Mood value from the data section instead of the header.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

Bane
swift roadking
swift roadking
Posts: 758
Joined: 02 Feb 2011 15:03
Owned TM-games: TMO,TMNF
Location: Novi Sad, Serbia

Re: Edit map file ?

Post by Bane » 20 Oct 2012 00:45

I always wondered about that too ! Good to know.
ImageImage
Image

DRIVING ON A FAST LANE !
TMO FOREVER !

Post Reply