thevisad / DayZ-Private-master

Reality DayZ - replaced Bliss for DayZ servers
GNU General Public License v2.0
45 stars 84 forks source link

Namalsk Script Restriction #115 #152

Closed ghost closed 11 years ago

ghost commented 11 years ago

I get this kick error then i'am trying to soldering my broken equipment!

So i find the problem in namalsk filter addWeaponCargoGlobal separated on 3 sections, but after compiling in script.txt we get only last section!

Example: namalsk filter:

"addWeaponCargoGlobal": "!\"if (_iItem != \"\") then {\n _item addWeaponCargoGlobal [_iItem,1];\n};\"", "addWeaponCargoGlobal": "!\"brokenEquipType)) then {\n if ", "addWeaponCargoGlobal": "(_wpnCoun > 2) then {\n _bp addWeaponCargoGlobal [_brokenEquipType, _wpnCoun - 2];\n};\n} else {\n _bp add\""

(Here error in (_iItem != \"\") returns (_iItem != "") but needs to return (_iItem != \"\") and after each \n space, in official scripts.txt for namalsk no space between for ex. output \n_bp ....)

in script.txt added

(_wpnCoun > 2) then {\n _bp addWeaponCargoGlobal [_brokenEquipType, _wpnCoun - 2];\n};\n} else {\n _bp add" (_wpnCoun > 2) then {\n _bp addWeaponCargoGlobal [_brokenEquipType, _wpnCoun - 2];\n};\n} else {\n _bp add"

So the full line of filter must be(how in official Sumrak DayZ Namalsk script.txt):

"addWeaponCargoGlobal": "!\"if (_iItem != \\\"\\\") then {\n _item addWeaponCargoGlobal [_iItem,1];\n};\" !\"brokenEquipType)) then {\nif (_wpnCoun > 2) then {\n_bp addWeaponCargoGlobal [_brokenEquipType, _wpnCoun - 2];\n};\n} else {\n_bp add\""

this must be on output:

!"if (_iItem != \"\") then {\n_item addWeaponCargoGlobal [_iItem,1];\n};" !"brokenEquipType)) then {\nif (_wpnCoun > 2) then {\n_bp addWeaponCargoGlobal [_brokenEquipType, _wpnCoun - 2];\n};\n} else {\n_bp add"

but when i use this i get error: Substitution replacement not terminated at -e line 1.

Please fix it

MajorPainage commented 11 years ago

Use this for line 117

5 addWeaponCargoGlobal !"\"addWeaponCargoGlobal\"," !"_holder addweaponcargoGlobal [_x,(_objWpnQty select _countr)];" !"dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];" !"if (_bcpkWpn != \"\") then {\ndayz_myBackpack addWeaponCargoGlobal [_bcpkWpn,1];\n};\n};" !"if (_iItem != \"\") then {\n_item addWeaponCargoGlobal [_iItem,1];\n};" !"if (_iItem != \"\") then {\n_item addWeaponCargoGlobal [_iItem,1];\n};" !"brokenEquipType)) then {\nif (_wpnCoun > 2) then {\n_bp addWeaponCargoGlobal [_brokenEquipType, _wpnCoun - 2];\n};\n} else {\n_bp add"

ghost commented 11 years ago

i know what i must use it, i need fixed build.pl and update_scripts.pl, i'am using it for my server

ghost commented 11 years ago

I found that problem in char '>' in (_wpnCoun > 2) if delete it from filter line is substituting

thevisad commented 11 years ago

Actually the issue is in the (). It is a replacement character in Perl.

ghost commented 11 years ago

But i tried to delete ( and ) from (_wpnCoun > 2) and error still appears, it only dissapear if delete > So how to fix it?

ghost commented 11 years ago

I used reality script encoder for script item createUnit here line: !"and_bspawn\" && dzn_ns_bloodsucker) then {\n\"ns_bloodsucker\" createUnit [[(_originalPos select 0) - (random 60), (_originalPos sel" !"loodsucker && ((random 100) < dzn_ns_bloodsucker_den)) then {\n\"ns_bloodsucker\" createUnit [[(_originalPos select 0) - (random 60), (_originalPos sel" !"s_bloodsucker_den)) then {\n_bloodsucker = \"ns_bloodsucker\" createUnit [[(_originalPos select 0) - (random 60), (_originalPos sel" !"s_bloodsucker_den)) then {\n_bloodsucker = \"ns_bloodsucker\" createUnit [[(_originalPos select 0) - (random 60), (_originalPos sel" !"sucker_den)) then {\nprivate[\"_lootType\"];\n\"ns_bloodsucker\" createUnit [[(_originalPos select 0) - (random 60), (_originalPos sel" !"temBloodbag'\";\n} else {\n_content = \"\";\n};\n\"ns_bloodsucker\" createUnit [[(_originalPos select 0) + (random 60), (_originalPos sel"

This is i get from program:

"createUnit": "!\"and_bspawn\\" && dzn_ns_bloodsucker) then {\n\\"ns_bloodsucker\\" createUnit [[(_originalPos select 0) - (random 60)\, (_originalPos sel\" !\"loodsucker && ((random 100) < dzn_ns_bloodsucker_den)) then {\n\\"ns_bloodsucker\\" createUnit [[(_originalPos select 0) - (random 60)\, (_originalPos sel\" !\"s_bloodsucker_den)) then {\n_bloodsucker = \\"ns_bloodsucker\\" createUnit [[(_originalPos select 0) - (random 60)\, (_originalPos sel\" !\"s_bloodsucker_den)) then {\n_bloodsucker = \\"ns_bloodsucker\\" createUnit [[(_originalPos select 0) - (random 60)\, (_originalPos sel\" !\"sucker_den)) then {\nprivate[\\"_lootType\\"];\n\\"ns_bloodsucker\\" createUnit [[(_originalPos select 0) - (random 60)\, (_originalPos sel\" !\"temBloodbag'\\";\n} else {\n_content = \\"\\";\n};\n\\"ns_bloodsucker\\" createUnit [[(_originalPos select 0) + (random 60)\, (_originalPos sel\""

I am pasted it to namalsk filter, run script update and get error:

illegal backslash escape sequence in string, at character offset 257 (before "\, (_origin alPos se...") at C:\Games\DayZ_Server\DayZServer\Scripts\DatabaseManage\update_scripts.pl line 42.

thevisad commented 11 years ago

Its this \, lets see if I am creating that slash in the tool.

ghost commented 11 years ago

And found small problem and fix for it

Problem in scripts_update.pl if we use paramerter --with-namalsk it applys global filter to all downloaded scripts and namalsk filter only for scripts.txt Solution is save ARGV array:

   # For each --with-<exception> option, attempt to find an exception set
my @DefARGV = @ARGV;                                  # Here we save ARGV because cyclic shifting
while (my $option = shift(@ARGV)) {
    next unless ($option =~ m/with-([-\w.]+)/);
    next unless (defined $lookups{$1});

            while (($pattern, $exception) = each %{$lookups{$1}}) {
            my $regex = "s/([0-9]{1})\\s$pattern\\s(.*)([\\\/]{2}.*)*/" . (($exception) ? "\\1 $pattern \\2 $exception\n/g" : "/g");
        replace_text($regex, "$dst/$script");
    }
}
@ARGV = @DefARGV;                                  # Here we restore ARGV for next cycle pass (next script)
ghost commented 11 years ago

And i think need to add !\"MedBox0_DZN\" to "box" exceptions because in Namalsk version 0.74 is added custom class for namalsk box with supplies MedBox0_DZN

thevisad commented 11 years ago

151

madrigo64 commented 11 years ago

Мах появился твой намальско под 1.7.6.1 Numalsk updated to 0.741 for dayz mod 1.7.6.1

ghost commented 11 years ago

Ну отлично) Спасибо @skynetdev :) Please update repositrory for new namalsk :)

madrigo64 commented 11 years ago

pls update