Jump to content

Memmorath

Member
  • Content Count

    11
  • Joined

  • Last visited

About Memmorath

  • Rank
    Freshly Bitten

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm fairly certain the MaxCondition in lightbulbs has to do with Vehicle Headlights, but since I never tested changing that, I can't say for sure. At least for me, whenever I find a lightbulb and place it as a vehicle headlight, it's condition is 10%. Whereas headlights found already installed in vehicles have condition between 0-100.
  2. Not quite. I'm fine with whatever power they drain. The issue is that after "some period of time", placeable lamp furniture go dark, and the lightbulb needs to be replaced. I don't know if lightbulbs have an actual duration meter (like batteries do), but since the lamps require new lightbulbs from time to time I assume that is the case. I spent few hours digging through all game files, but didn't really know what I was looking for. In essence, I'd like to change the placeable lightbulb lamp fixture behaviour to last 10-15 times longer before the lightbulb needs to be replaced.
  3. Anyone know which which file contains the information for the world object 'Water Well' / 'Well'? I would like to copy Well interactions to be used with a Standpipe, but can't find the file locations The asset for Fire Hydrant seems to be "WorldObjectSprite = street_decoration_01_12,", but what about the well? (also, where can I find the full list of these???)
  4. Probably not the file I'm looking for, but: ProjectZomboid\zombie\iso\IsoLightSource.class Below is the code. Although I don't really understand code, it seems to me it only controls lightswitch lights inside houses, correct? package zombie.iso; import zombie.characters.IsoPlayer; import zombie.core.opengl.RenderSettings; import zombie.SandboxOptions; import zombie.GameTime; import zombie.iso.objects.IsoLightSwitch; import java.util.ArrayList; import zombie.iso.areas.IsoBuilding; public class IsoLightSource { public static int NextID; public int ID; public int x; public int y; public int z; public float r; public float g; public float b; public float rJNI; public float gJNI; public float bJNI; public int radius; public boolean bActive; public boolean bWasActive; public boolean bActiveJNI; public int life; public int startlife; public IsoBuilding localToBuilding; public boolean bHydroPowered; public ArrayList<IsoLightSwitch> switches; public IsoChunk chunk; public Object lightMap; public IsoLightSource(final int x, final int y, final int z, final float r, final float g, final float b, final int radius) { this.life = -1; this.startlife = -1; this.bHydroPowered = false; this.switches = new ArrayList<IsoLightSwitch>(0); this.x = x; this.y = y; this.z = z; this.r = r; this.g = g; this.b = b; this.radius = radius; this.bActive = true; } public IsoLightSource(final int x, final int y, final int z, final float r, final float g, final float b, final int radius, final IsoBuilding localToBuilding) { this.life = -1; this.startlife = -1; this.bHydroPowered = false; this.switches = new ArrayList<IsoLightSwitch>(0); this.x = x; this.y = y; this.z = z; this.r = r; this.g = g; this.b = b; this.radius = radius; this.bActive = true; this.localToBuilding = localToBuilding; } public IsoLightSource(final int x, final int y, final int z, final float r, final float g, final float b, final int radius, final int n) { this.life = -1; this.startlife = -1; this.bHydroPowered = false; this.switches = new ArrayList<IsoLightSwitch>(0); this.x = x; this.y = y; this.z = z; this.r = r; this.g = g; this.b = b; this.radius = radius; this.bActive = true; this.life = n; this.startlife = n; } public void update() { final IsoGridSquare gridSquare = IsoWorld.instance.CurrentCell.getGridSquare(this.x, this.y, this.z); if (this.bHydroPowered && GameTime.instance.NightsSurvived >= SandboxOptions.instance.getElecShutModifier() && (gridSquare == null || !gridSquare.haveElectricity())) { this.bActive = false; return; } if (!this.bActive) { return; } if (this.localToBuilding != null) { this.r = RenderSettings.getInstance().getAmbientForPlayer(IsoPlayer.getPlayerIndex()) * 0.7f; this.g = RenderSettings.getInstance().getAmbientForPlayer(IsoPlayer.getPlayerIndex()) * 0.7f; this.b = RenderSettings.getInstance().getAmbientForPlayer(IsoPlayer.getPlayerIndex()) * 0.7f; } if (this.life > 0) { --this.life; } if (this.localToBuilding != null && gridSquare != null) { this.r = RenderSettings.getInstance().getAmbientForPlayer(IsoPlayer.getPlayerIndex()) * 0.8f * IsoGridSquare.rmod * 0.7f; this.g = RenderSettings.getInstance().getAmbientForPlayer(IsoPlayer.getPlayerIndex()) * 0.8f * IsoGridSquare.gmod * 0.7f; this.b = RenderSettings.getInstance().getAmbientForPlayer(IsoPlayer.getPlayerIndex()) * 0.8f * IsoGridSquare.bmod * 0.7f; } for (int i = this.x - this.radius; i < this.x + this.radius; ++i) { for (int j = this.y - this.radius; j < this.y + this.radius; ++j) { for (int k = 0; k < 8; ++k) { final IsoGridSquare gridSquare2 = IsoWorld.instance.CurrentCell.getGridSquare(i, j, k); if (gridSquare2 != null) { if (this.localToBuilding == null || this.localToBuilding == gridSquare2.getBuilding()) { final LosUtil.TestResults lineClear = LosUtil.lineClear(gridSquare2.getCell(), this.x, this.y, this.z, gridSquare2.getX(), gridSquare2.getY(), gridSquare2.getZ(), false); if ((gridSquare2.getX() == this.x && gridSquare2.getY() == this.y && gridSquare2.getZ() == this.z) || lineClear != LosUtil.TestResults.Blocked) { float n; if (Math.abs(gridSquare2.getZ() - this.z) <= 1) { n = IsoUtils.DistanceTo((float)this.x, (float)this.y, 0.0f, (float)gridSquare2.getX(), (float)gridSquare2.getY(), 0.0f); } else { n = IsoUtils.DistanceTo((float)this.x, (float)this.y, (float)this.z, (float)gridSquare2.getX(), (float)gridSquare2.getY(), (float)gridSquare2.getZ()); } if (n <= this.radius) { final float n2 = 1.0f - n / this.radius; float n3 = n2 * n2; if (this.life > -1) { n3 *= this.life / (float)this.startlife; } final float n4 = n3 * this.r * 2.0f; final float n5 = n3 * this.g * 2.0f; final float n6 = n3 * this.b * 2.0f; gridSquare2.setLampostTotalR(gridSquare2.getLampostTotalR() + n4); gridSquare2.setLampostTotalG(gridSquare2.getLampostTotalG() + n5); gridSquare2.setLampostTotalB(gridSquare2.getLampostTotalB() + n6); } } } } } } } } public int getX() { return this.x; } public void setX(final int x) { this.x = x; } public int getY() { return this.y; } public void setY(final int y) { this.y = y; } public int getZ() { return this.z; } public void setZ(final int z) { this.z = z; } public float getR() { return this.r; } public void setR(final float r) { this.r = r; } public float getG() { return this.g; } public void setG(final float g) { this.g = g; } public float getB() { return this.b; } public void setB(final float b) { this.b = b; } public int getRadius() { return this.radius; } public void setRadius(final int radius) { this.radius = radius; } public boolean isActive() { return this.bActive; } public void setActive(final boolean bActive) { this.bActive = bActive; } public boolean wasActive() { return this.bWasActive; } public void setWasActive(final boolean bWasActive) { this.bWasActive = bWasActive; } public ArrayList<IsoLightSwitch> getSwitches() { return this.switches; } public void setSwitches(final ArrayList<IsoLightSwitch> switches) { this.switches = switches; } public void clearInfluence() { for (int i = this.x - this.radius; i < this.x + this.radius; ++i) { for (int j = this.y - this.radius; j < this.y + this.radius; ++j) { for (int k = 0; k < 8; ++k) { final IsoGridSquare gridSquare = IsoWorld.instance.CurrentCell.getGridSquare(i, j, k); if (gridSquare != null) { gridSquare.setLampostTotalR(0.0f); gridSquare.setLampostTotalG(0.0f); gridSquare.setLampostTotalB(0.0f); } } } } } public boolean isInBounds(final int n, final int n2, final int n3, final int n4) { return this.x >= n && this.x < n3 && this.y >= n2 && this.y < n4; } public boolean isInBounds() { final IsoChunkMap[] chunkMap = IsoWorld.instance.CurrentCell.ChunkMap; for (int i = 0; i < IsoPlayer.numPlayers; ++i) { if (!chunkMap[i].ignore) { if (this.isInBounds(chunkMap[i].getWorldXMinTiles(), chunkMap[i].getWorldYMinTiles(), chunkMap[i].getWorldXMaxTiles(), chunkMap[i].getWorldYMaxTiles())) { return true; } } } return false; } public boolean isHydroPowered() { return this.bHydroPowered; } public IsoBuilding getLocalToBuilding() { return this.localToBuilding; } static { IsoLightSource.NextID = 1; } }
  5. Right, so I did some tinkering (thank you for pointing me in the right direction). Turns out, at least for the battery-powered items, I can achieve all this by modifying the item scripts. (I'm not sure if the entire item script code is needed, but for the sake of this post I'll just post the relevant info) Would be ideal to find which file has the lightbulb life for outdoor / indoor lamps, but at least this is already halfway there. Below are the default and modified values. -- Default values: -- Battery useDelta = 0.00001, (Lamp on Post; depletes roughly 5 % over 24 hours) -- Hand Torch useDelta = 0.0004, (didn't actually check the default deplete rate) -- Flashlight useDelta = 0.0009, (takes roughly 4,5 hours to fully deplete) -- Modified values: -- Battery useDelta = 0.000001, (900 % increase; not good in math, but will take a long time to deplete) -- Hand Torch useDelta = 0.00004, (900 % increase; depletes 23 % over 24 hours, so should take over 4 days to fully deplete) -- Flashlight useDelta = 0.00003, (2900 % increase; depletes 17 % over 24 hours, so should take almost 6 days to fully deplete) This also means it is safe to deactive and reactive the mod; it will return to default depletation rate on mod deactivation.
  6. You're a wizard, thank you for the indepth explanation as well. The change affecting newly build lightsources with batteries, such as the carpentry item "Lamp on a Post" ,makes sense, but how about those lamps found on tables and such (the ones that essentially use lightbulbs)?
  7. how about this file? "ISLightSource" found in "ProjectZomboid\media\lua\server\BuildingObjects" ?
  8. Character action of a lightsource? You mean like a Flashlight or a torch?
  9. Which file to edit for infine lightsource fuel, specifically lamp light sources fueled by lightbulbs? The file ISLightActions.lua in "ProjectZomboid\media\lua\client\TimedActions" seems like would be the place, however, I'm not sure if I understand it correctly. Pasted below is the code I think I'm supposed to edit? (specifically the "o.maxTime" value?; also how long is one unit of "time"? Any help would be appreciated. function ISLightActions:new(mode, character, lightswitch, item) local o = {}; setmetatable(o, self); self.__index = self; o.mode = mode; o.character = character; o.lightswitch = lightswitch; o.item = item; o.stopOnWalk = true; o.stopOnRun = true; o.maxTime = 300; if mode=="AddLightBulb" or mode=="RemoveLightBulb" then o.maxTime = 120; elseif mode=="AddBattery" or mode=="RemoveBattery" then o.maxTime = 60; end
  10. I am also facing similar difficulties. I'm trying to mod in new versions of existing clothes (bulletproof vests, backpack, etc), but I cannot get the 3d sprites to show up. Likewise, despite adding values to the items the character completely ignores these values (such as the invisible vest having 100 protection value, but the proctection tab showing 0%). I am able to rexture and modify the existing default items just fine and that works, but rather than that, I would like to add these as new items. So, the problem(s) New items do not show on character when equipped (they can be looted and found, but no character model) New items do not calculate their properties on the character (defense values, etc) New items' inventory sprite spawns with random colors, despite setting random color / tint to false The goal Use the existing default items and retexture them as new, separate items I uploaded a .rar file of the mod as an attachment. If anyone could take a look at the mod and tell me what I'm doing wrong I would greatly appreciate it! NewArmyItems.rar
×
×
  • Create New...