Jump to content

Weapon range not as advertised. (from turret factory)


Kosmo-not

Recommended Posts

Habe das gleiche beobachtet mit verschiedenen Lasern die ich gebaut habe. Man kann auch gut sehen wie die Laserstrahlen lange vor der Zielmarkierung aufhören.

___

 

Google translator:

 

Have the same observed with different lasers which I have built. You can also see how the laser beams stop long before the target marking.

Link to comment
Share on other sites

Habe das gleiche beobachtet mit verschiedenen Lasern die ich gebaut habe. Man kann auch gut sehen wie die Laserstrahlen lange vor der Zielmarkierung aufhören.

___

 

Google translator:

 

Have the same observed with different lasers which I have built. You can also see how the laser beams stop long before the target marking.

 

Yes, that too. I may try (when I scrounge up the materials) to create a weapon with a lower range to see what happens.

Link to comment
Share on other sites

Ich hab mich mal ein bisschen in LUA eingearbeitet und mit Hilfe der tooltipmaker.lua das Problem sichtbar gemacht:

 

Ein Laser unverändert

 

laser1.jpg

 

 

und mit Hochleistungslinsen für mehr Reichweite

 

laser2.jpg

 

 

Die Eigenschaft "reach" wird zwar erhöht, die Eigenschaft "blength" (beam length) aber nicht. Das Gleiche mit Projektilwaffen:

 

ohne Änderung

 

kanone1.jpg

 

mit Hochdruckröhren

 

kanone2.jpg

 

 

Die tatsächliche Reichweite ist das Produkt aus Geschwindigkeit(pvelocity) und maximaler Flugzeit(pmaximumTime).

 

Edit: Bilder als Spoiler markiert. Ist doch ein wenig unübersichtlich ...

_____

Google translator:

 

I have a bit in LUA worked in and with the help of the tooltipmaker.lua the problem made visible:

 

A laser unchanged

...

 

And with high-performance lenses for longer range

...

 

The "reach" property is increased, but the "blength" property is not. The same with projectiles:

 

without change

...

 

With high pressure tubes

...

 

The actual range is the product of speed (pvelocity) and maximum flight time (pmaximumTime).

Link to comment
Share on other sites

Ich konnte das Problem lösen \o/

function makeTurret(weaponType, rarity, material, ingredients)

    local turret = makeTurretBase(weaponType, rarity, material)
    local weapons = {turret:getWeapons()}

    turret:clearWeapons()

    for _, weapon in pairs(weapons) do
        -- modify weapons
        for _, ingredient in pairs(ingredients) do
            if ingredient.weaponStat then
                -- add one stat for each additional ingredient
                local additions = math.max(ingredient.minimum - ingredient.default, math.min(ingredient.maximum - ingredient.default, ingredient.amount - ingredient.default))

                local value = weapon[ingredient.weaponStat]
                if type(value) == "boolean" then
                    if value then
                        value = 1
                    else
                        value = 0
                    end
                end

			-- **********************************************
			-- **        Jerhemas' Range Bug Fix           **
			-- **********************************************
			local modifier = (value + ingredient.statDelta * additions)/value
                value = value * modifier
                weapon[ingredient.weaponStat] = value

			if ingredient.weaponStat == "reach" then
				if weapon["blength"] then
					weapon["blength"] = weapon["blength"] * modifier
				end
				if weapon["pmaximumTime"] then
					weapon["pmaximumTime"] = weapon["pmaximumTime"] * modifier
				end
			end
			-- **********************************************

		end
        end

        turret:addWeapon(weapon)
    end

    for _, ingredient in pairs(ingredients) do
        if ingredient.turretStat then
            -- add one stat for each additional ingredient
            local additions = math.max(ingredient.minimum - ingredient.default, math.min(ingredient.maximum - ingredient.default, ingredient.amount - ingredient.default))

            local value = turret[ingredient.turretStat]
            value = value + ingredient.statDelta * additions
            turret[ingredient.turretStat] = value
        end
    end


    return turret;
end

Download: http://nsite.de/public/turretfactory.lua

 

Habs mit nem Laser getestet und es funktioniert prima. Für andere Waffen fehlen mit die Materialien

 

____

 

Google translator:

 

I could solve the problem \ o /

 

...

 

Have it tested with a laser and it works great. I miss the materials for other weapons

Link to comment
Share on other sites

Selbes Problem hier. 3,22 km Laser-Geschützturm macht erst ab 1,8 km Schaden.

Zusatzinfo:

Der Kreis wird auf der richtigen Distanz Grün, die Laser kommen aber nicht so weit, siehe Anhang.

 

English:

Same problem here. Laser with 3,22 km range does only damage within 1,8 km.

extended info:

Range indicator cycles turn green within the right range. The laser light only reaches 1,8 km, visible in the attachment.

Link to comment
Share on other sites

Jerhema,

 

I used your fix and found that it does work for all the types of turrets. Thanks!

 

However, it introduced a bug where turrets that are produced with identical stats don't stack in the menu as if they were unique.  I took a look at your code, but I am not sure of why this  would be?  Could you offer any insight?  I would like to fix this if possible.

 

This picture below shows some of the mining turrets I crafted which should all be identical but each has it's own item stack in the menu.

 

 

MHtGJS6.jpg

 

 

The mining and salvaging turrets also appear to have stopped doing damage after implementing your code fix.

Link to comment
Share on other sites

Das ist seltsam. Ich selbst habe keinen dieser Bugs und habe auch von niemand anderem davon gehört. Verschwinden die Fehler, wenn du den Fix rückgängig machst?

 

Ich habe das Skript nur in der aktuellen Steam-Version (0.10.2 r7448) und ohne andere Mods getestet. Abgesehen von meiner modifizierten tooltipmaker.lua

 

Ich würde gerne helfen aber ich wüsste nicht wie :(

 

_______

Google translator:

 

This is strange. I myself have none of these bugs and have not heard of anyone else. Disappear the errors when you undo the fix?

 

I have tested the script only in the current Steam version (0.10.2 r7448) and without other mods. Apart from my modified tooltipmaker.lua

 

I would like to help but I would not know how

Link to comment
Share on other sites

Im not sure if my observation belongs to this topic neither if it is a bug or works as intended. i tried to model a chaingun and with less Ammunition S i got better damage. I would expect it to be the other way round. Bug or Inteded?

Link to comment
Share on other sites

Das ist tatsächlich ein Bug. Das Script ermittelt für einige Eigenschaften den Unterscheid zur nächstbesten Version der Waffen, bzw. der nächsten Seltenheit. Dabei kommt es aber vor das die nächstbessere Waffe tatsächlich schlechtere Werte hat und die Differenz negativ wird. Ich habe den Bug bei mir zwar behoben, aber dafür kommt es vor das in seltenen Fällen für eine Waffe gar kein Schaden berechnet werden kann. Ich arbeite noch dran ...

 

___

Google translator:

This is actually a bug. The script determines for some properties the difference to the next version of the weapon or the next rarity. But sometimes the next weapon actually has worse values and the difference becomes negative. I have fixed the bug with me, but in some rare cases the damage for a weapon no cannot be calculated. I'm still working on it ...

Link to comment
Share on other sites

Thanks a lot for this mod, but how can i use it ?

 

For the moment i have created  a file : "turretfactory.lua" based on your source code and place it in ...data/script/lib

But it doesn't work.

 

What must i do exactly with your code ?

 

You will find the right file in the folder scripts/entity/merchants, just let it overwrite the file there and you should be good!

Link to comment
Share on other sites

Thanks a lot for this mod, but how can i use it ?

 

For the moment i have created  a file : "turretfactory.lua" based on your source code and place it in ...data/script/lib

But it doesn't work.

 

What must i do exactly with your code ?

 

Der im Post gezeigte Code ist nur ein Auszug aus der geänderten Datei mit dem Fix. Deine neu erstellte Datei alleine wird nicht funktioniere weil dann der ganze andere Code aus der turretfactory.lua fehlt. Am besten lädst du meine verlinkte turretfactory.lua runter und machst es wie Devious vorgeschlagen hat. Wie immer bei solchen Dingen solltest du aber vorher eine Sicherheitskopie deiner original turretfactory.lua anlegen, falls was schief geht.

___

Google translator:

 

The code shown in the post is only an excerpt from the modified file with the fix. Your newly created file alone will not work because then the whole other code from the turretfactory.lua is missing. The best is to download my linked turretfactory.lua and do it as Devious has suggested. As always with such things, you should create a security copy of your original turretfactory.lua, if something goes wrong.

 

I assume this script does not correct this error for already created weapons?

 

Deine Annahme ist leider richtig.

___

Google translator:

 

Your assumption is unfortunately correct.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...