Skip to content

Commit

Permalink
added the PHP-based mao.csv generator script
Browse files Browse the repository at this point in the history
  • Loading branch information
TomArrow committed Jul 29, 2018
1 parent a337130 commit 6de33e3
Show file tree
Hide file tree
Showing 9 changed files with 91,149 additions and 0 deletions.
28,843 changes: 28,843 additions & 0 deletions php/mapforgeitems/0.5.1.1.csv

Large diffs are not rendered by default.

15,229 changes: 15,229 additions & 0 deletions php/mapforgeitems/0.6.csv

Large diffs are not rendered by default.

228 changes: 228 additions & 0 deletions php/mapforgeitems/ForgeTagMap_old.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
34A4,34A4
2EB3,2EB3
2EB4,2EB4
2EBC,2EBC
34A5,34A5
34C1,34C1
2EB1,2EB1
2EAF,2EAF
34A7,34A7
34A8,34A8
34A9,34A9
4225,4225
34AB,34AB
2EBF,2EBF
2EBE,2EBE
34A6,34A6
2EBA,2EBA
2EBB,2EBB
2EB5,2EB5
2EB6,2EB6
2EB2,2EB2
2EBD,2EBD
2EB0,2EB0
2EB8,2EB8
2EB9,2EB9
444A,444A
34C0,34C0
34C2,34C2
27EF,27EF
34C5,34C5
444B,444B
34AA,34AA
3FD4,3FD4
4221,4221
444C,444C
4226,4226
4224,4224
3FD3,3FD3
4220,4220
4223,4223
3FD6,3FD6
3FD5,3FD5
3A94,3A94
2EE5,2EE5
3A9E,3A9E
4222,4222
2EB7,2EB7
01AC,01AC
01AF,01AF
01B2,01B2
01B5,01B5
1564,1564
1561,1561
1567,1567
2EA9,2EA9
1566,1566
1560,1560
1565,1565
1569,1569
2EAB,2EAB
2EAC,2EAC
2EAA,2EAA
1B8E,1B8E
1B8F,1B8F
2EC3,2EC3
2EC4,2EC4
2EC5,2EC5
2EC6,2EC6
2EC7,2EC7
2EC8,2EC8
2EC9,2EC9
2ECA,2ECA
2ECB,2ECB
2E90,2E90
2E98,2E98
2E91,2E91
2E9A,2E9A
2E9D,2E9D
2E92,2E92
2E9C,2E9C
2E9E,2E9E
2E99,2E99
2E93,2E93
2E95,2E95
2E96,2E96
2E9B,2E9B
2ECC,2ECC
2E94,2E94
2E97,2E97
2E9F,2E9F
2EA7,2EA7
2EA8,2EA8
2EC0,2EC0
2EC1,2EC1
2EC2,2EC2
444E,444E
444F,444F
4450,4450
4451,4451
4452,4452
4453,4453
151F,151F
4441,4441
4442,4442
4443,4443
4447,4447
1599,1599
4444,4444
4445,4445
4446,4446
4448,4448
151A,151A
1518,1518
1517,1517
1598,1598
159B,159B
1596,1596
1520,1520
1519,1519
4449,4449
1516,1516
151E,151E
1581,1581
1582,1582
1583,1583
1584,1584
157C,157C
15BB,15BB
15BC,15BC
1585,1585
1586,1586
15BD,15BD
1587,1587
1A45,1A45
15B1,15B1
157D,157D
158C,158C
158D,158D
158E,158E
158F,158F
1500,1500
157E,157E
1593,1593
1594,1594
14F7,14F7
1595,1595
14F8,14F8
14FE,14FE
15C0,15C0
15C1,15C1
15C2,15C2
15C3,15C3
15C4,15C4
1591,1591
1509,1509
1504,1504
1592,1592
1580,1580
15BF,15BF
1588,1588
1589,1589
158A,158A
15BE,15BE
158B,158B
1525,1525
1590,1590
14FF,14FF
15B3,15B3
15B2,15B2
159E,159E
284C,284C
150C,150C
1A54,1A54
3A18,3A18
14FB,14FB
1A56,1A56
1A55,1A55
14F9,14F9
48CB,47B1
48D4,47BA
48D5,47BB
48E7,47CD
48FF,47E5
490C,47F2
4934,481A
4963,4849
4968,484E
496D,4853
497F,4865
4987,486D
499F,4885
4711,4711
48C9,47AF
476D,14F9
480A,1509
4880,1A56
4CB8,4BA3
4CBF,4BAA
4F03,4DED
4F05,4DEF
4F0E,4DF8
4F10,4DFA
4F12,4DFC
4A7F,4965
4F1E,4E08
4F26,4E10
4F36,4E20
4F41,4E2B
4F57,4E41
4F5C,4E46
4F6E,4E58
4F02,4441
527C,5166
5290,517A
529F,5189
52A4,518E
5529,541C
5006,4EF0
4FF9,4EE3
5534,5427
554E,5441
5557,544A
555F,5452
556D,5460
2A76,2A76
5578,546B
5492,5380
57DF,56DA
76 changes: 76 additions & 0 deletions php/mapforgeitems/createmap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

header("Content-Type: text/plain; charset=utf-8");

$point5 = file("0.5.1.1.csv");
$point6 = file("0.6.csv");
$oldtagmap = file("ForgeTagMap_old.csv"); // to know which ones are relevant in 0.5.1.1 forge

$oldindexarray = array();
$objectsthatwerediscarded = array();
$objectsthatwerenotdiscarded = array();
foreach($oldtagmap as $item){
$parts = explode(",",$item);
$superoldindex = $parts[0];
$oldindex = trim($parts[1]);
$oldindexarray[] = $oldindex;
}


$point6_nametoindex = array();
$point6_indextoname = array();

foreach($point6 as $item){

$parts = explode(",",$item);
$point6index = substr($parts[0],-4);
$point6name = trim($parts[1]);
if(!isset($point6_nametoindex[$point6name])){
$point6_nametoindex[$point6name] = $point6index;
}
$point6_indextoname[$point6index] = $point6name;
}

$point5indextopoint6index = array();

foreach($point5 as $item){

$parts = explode(",",$item);
$point5index = substr($parts[0],-4);
$point5name = trim($parts[1]);
$point6index = isset($point6_nametoindex[$point5name]) ? $point6_nametoindex[$point5name] : NULL;
if(isset($point6_indextoname[$point5index]) && $point5name == $point6_indextoname[$point5index]){

}
else {
if($point6index !== $point5index){
$point5indextopoint6index[$point5index] = $point6index;

if(in_array($point5index,$oldindexarray) && $point6index === NULL){
$objectsthatwerediscarded[] = $point5name;
}
if(in_array($point5index,$oldindexarray) && $point6index !== NULL){
$objectsthatwerenotdiscarded[] = $point5name;
}
}
}
}


// make csv map
$csv = "";
$limitedcsv = "";

foreach($point5indextopoint6index as $point5index => $point6index){
$csv .= $point5index.",".$point6index."\n";

if(in_array($point5index,$oldindexarray)){
echo 1;
$limitedcsv .= $point5index.",".$point6index."\n";
}
}

file_put_contents("map.csv",$csv);
file_put_contents("map_limited.csv",$limitedcsv);
file_put_contents("discardedobjects.csv",implode("\n",$objectsthatwerediscarded));
file_put_contents("not-discardedobjects.csv",implode("\n",$objectsthatwerenotdiscarded));
42 changes: 42 additions & 0 deletions php/mapforgeitems/discardedobjects.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
0x04E8
objects\weapons\rifle\dmr\dmr_v5
0x27EF
0x3FD3
0x3FD4
0x3FD5
0x3FD6
0x40E7
0x40E9
0x4220
0x4221
0x4222
0x4223
0x4224
0x4225
0x4226
0x4442
0x4443
0x4444
0x4445
0x4446
0x4447
0x4448
0x4449
0x444A
0x444B
0x444C
0x444E
0x444F
0x4450
0x4451
0x4452
0x4453
0x4711
objects\equipment\instantcover_equipment\instantcover_equipment_mp
0x47BA
0x4DED
0x4DF8
0x4DFA
0x5189
0x518E
objects\levels\solo\020_base\computer_briefcase_small\computer_briefcase_small_crashed
Loading

0 comments on commit 6de33e3

Please sign in to comment.