Jump to content

Tchernobill

Member
  • Posts

    167
  • Joined

  • Last visited

Posts posted by Tchernobill

  1. No mod.

    PC Mouse & Keyboard

     

    context:

    Well Fed Moodle is the lowest visible moodle.

    Cursor is on the well fed moodle (top of the painted red arrow in the image below).

    => tooltip Well Fed is visible

    The player moves the cursor down to an UI that is VERY close (bottom of the red arrow in the image below).

     

    Current:

    The Well Fed tooltip remains visible. (as long as the cursor remains on that new U.I

     

    Expected:

    The Well Fed tooltip disappears.

     

    Reproductibility: non systematic but very high occurrence. rapid mouse movements increase the reproductibility.

    OnMouseOverBug.png

  2. You can override lua functions.

    You cannot override java methods (this way).

    IsoDoor & IsoThumpable are Java classes.

     

    I do not know how to override java methods from lua.

    I do not know anyone who knows how to do that. (but if someone can, please explain me how).

     

     

    That said, ToggleDoor* leads** to the call of LuaEventManager.triggerEvent("OnContainerUpdate");***

    *In a subcall to ToggleDoorActual

    **event is called only in some cases (not garage door, not double door, not locked door, ..)

    ***event is called with no parameter so you do not know if the OnContainerUpdate is called for a door opening or something else (like a zombie dead or item generation or whatever)

     

    So, if you can maintain a list of doors, and identify that the door changed its state, you could inject your toxic stuff at that time.

    It is tricky, verbose and will require a lot of work for a possibly meh result.

     

  3. Hi,

     

    Do you think I should continue to call getTexture within the render loop or is it worth the added work/complexity to store getTexture to minimise thoses calls.

     

    1/ keep it simple s.

    function ISUICustom:render()
    	self:drawTexture(getTexture("MyPrettyPic.png"), 0, 0, 1, 1, 1, 1);
    end

    2/ preload getTexture

    function ISUICustom:render()
    	self:drawTexture(self.texture, 0, 0, 1, 1, 1, 1);
    end
    
    function ISUICustom:new()
    	self.texture = getTexture("MyPrettyPic.png");
    end

     

  4.    public boolean Eat(InventoryItem var1, float var2) {
          Food var3 = (Food)Type.tryCastTo(var1, Food.class);
          //[..]
             
             //condition requiring the timer effectiveEdibleBuffTimer to be completed.
             if (this.BodyDamage.getFoodSicknessLevel() > 0.0F && (float)var3.getReduceFoodSickness() > 0.0F && this.effectiveEdibleBuffTimer <= 0.0F) {
    
                //here we decrease food sickness level
                var14 = this.BodyDamage.getFoodSicknessLevel();
                this.BodyDamage.setFoodSicknessLevel(this.BodyDamage.getFoodSicknessLevel() - (float)var3.getReduceFoodSickness() * var2);
                if (this.BodyDamage.getFoodSicknessLevel() < 0.0F) {
                   this.BodyDamage.setFoodSicknessLevel(0.0F);
                }
                
                //here we decrease poison level
                var7 = this.BodyDamage.getPoisonLevel();
                this.BodyDamage.setPoisonLevel(this.BodyDamage.getPoisonLevel() - (float)var3.getReduceFoodSickness() * var2);
                if (this.BodyDamage.getPoisonLevel() < 0.0F) {
                   this.BodyDamage.setPoisonLevel(0.0F);
                }
    
               
               //here we decide of the time taken until next check. from shorter to longer: IronGut < WeakStomach < NoTrait
                if (this.Traits.IronGut.isSet()) {
                   this.effectiveEdibleBuffTimer = Rand.Next(80.0F, 150.0F);
                } else if (this.Traits.WeakStomach.isSet()) {
                   this.effectiveEdibleBuffTimer = Rand.Next(120.0F, 230.0F);
                } else {
                   this.effectiveEdibleBuffTimer = Rand.Next(200.0F, 280.0F);
                }
             }
             //[..]
             return true;
       }
    
       private void updateInternal() {
         //[..]
         
         //decrease timer over time as should be
                   if (this.effectiveEdibleBuffTimer > 0.0F) {
                      this.effectiveEdibleBuffTimer -= GameTime.getInstance().getMultiplier() * 0.015F;
                      if (this.effectiveEdibleBuffTimer < 0.0F) {
                         this.effectiveEdibleBuffTimer = 0.0F;
                      }
                   }
         //[..]
       }

    It also has impact on poison level decrease and food sickness level decrease.

     

    I do not understand how this is part of the "Eat" method though, but it may be unrelated.

  5. This is still the case with B41.73

    It looks A LOT like WeakStomach and default (no associated trait) cases have been swapped for duration.

    see IsoGameCharacter.java Eat( InventoryItem, float ) method.

     

    That said, the BodyDamage.java JustAteFood( Food, float ) is in the correct order for poison / dangerousuncooked / rotten effects amplitudes.

  6. CharacterSave mod does it.

    Beware it is easy to confuse XpBoost and XpMultiplier.

    The first is related to profession and traits.

    --remove all previous profession, traits [..] (incldues XpBoost removal)
    character:getDescriptor():setProfession("unemployed");
    character:getTraits():clear();
    
    --alternative selective XpBoost removal (not tested)
    character:getXp():setPerkBoost(perk, 0)

     

    The second is related to skill books.

    --add
    player:getXp():addXpMultiplier(perk, multiplier, levelMin, levelMax);
    
    --remove
    player:getXp():getMultiplierMap():remove(perk)
    
    --alternative remove functional equivalent with current vanilla state (not tested)
    player:getXp():addXpMultiplier(perk, 1, levelMin, levelMax);

     

  7. Hi,

     

    As you noticed, at the time the IsoDeadCorpse container is created:

    1- the visible items (clothes, worn weapons..) are transferred from the  "just dead" IsoZombie to the IsoDeadCorpse.

    2- the invisible items are created.

     

    If you wanna mess with loots that pop up at IsoDeadCorpse time, without using the loot tables, there is a (twisted) way:

    - Store the IsoZombie identifier when the Zombie Dies.

    - When a new container is reacheable (OnRefreshInventoryWindowContainers) check it is a Dead corpse, check the associated IsoZombie identifier matches a Zombie newly dead, add your loot.

  8. I use a modded animation.

    When I start to turn, the turning animation breaks my animation.

    It is the same with running animation.

     

    I would like my animation to remain active until I decide it ends (when I stop it or when it finishes).

    Is there a way to inhibit all other animation for a time ?

    Is there a better design/solution to get rid of these cases my animation is interrupted by another animation ?

    Regards

  9. @EnigmaGrey

    when setting StaticModel, primaryAnimMask and secondaryAnimMask of an item in txt file, the associated item appears in hands.

    when calling DoParam (or ItemTweaker mod) on the associated scriptitem for those parameters, the associated item does not appear in hands.

    Is there a way to make this work from lua code for StaticModel, primaryAnimMask and secondaryAnimMask ?

     

    Also PlanetAlgol explicited this in the code comments of his last mod: Visible Generators and Corpses.

    Regards

  10. I have an algorithm that extracts data from the game engine and I wanna synthetise it as an image storing data in RGB and Alpha.

    I could also store it as text and use an external tool to do the text to image conversion, but this would remove some options.

     

    1/ Snippet

    From internet I found https://github.com/wyozi/lua-pngencoder that seems to do the job but requires "bit" base library that seems not accessible to my mod.

    Anyone has any idea how to use "bit" in a pz mod ?

    Also I intend to produce BIG images and I'm not sure it will do the trick. If it does I am afraid of lua performances.

     

    2/ Ingame tools

    2a/ ImageUtils.saveImage

    This function is based on an ingame Texture type.

    It only seems to work for creating "png" but I am totally ok with that.

    One Texture constructor seems promising for use from lua:

    public Texture(String var1, int[] var2);

    How can I fill var2 with my RGBA values ?

     

    3/ Any other idea on how to create images ingame is welcome.

     

  11. When you play Solo, your game loads lua/server and lua/client.

    When you Host a server, your game loads lua/server and lua/client.

    When you Join a game Hosted by someone else, your game loads lua/client, but not lua/server.

    When you Join a dedicated server, your game loads lua/client, but not lua/server.

    The dedicated server loads lua/server, but not lua/client. (I'm not 100% sure for this one).

     

    Obviously lua/shared is loaded by everyone, always.

  12. Here is my interpretation of the condition for the famous "high spear critical chances" as RE from IsoPlayer::pressedAttack(boolean)

    --spear +30% crit: this = IsoPlayer 
     float var8 = IsoUtils.DistanceTo(var11.x, var11.y, this.x, this.y);
     this.setVariable("TargetDist", var8);
     int var9 = this.calculateCritChance(var11);
     if (var11 instanceof IsoZombie) {
        IsoZombie var10 = this.getClosestZombieToOtherZombie((IsoZombie)var11);
        if (!this.attackVars.bAimAtFloor //not aim floor
        && (double)var8 > 1.25D //target must be further than 1.25 "meters"
        && var4 == WeaponType.spear //weapon is spear
        && (var10 == null || (double)IsoUtils.DistanceTo(var11.x, var11.y, var10.x, var10.y) > 1.7D) //closestZombie from targetZombie is further than 1.7 meters from targetZombie
        ) {
           if (!GameClient.bClient || this.isLocalPlayer()) {
              this.setAttackType("overhead"); //go go spear in the head my boy !
           }
           var9 += 30;
        }
     }

     

    Here is my proposition for correction modification of the decision algorithm :

    Do not take into account the closest Z to my target.

    But take into account the closest Z to me that I can detect.

     float var8 = IsoUtils.DistanceTo(var11.x, var11.y, this.x, this.y);
     this.setVariable("TargetDist", var8);
     int var9 = this.calculateCritChance(var11);
     if (var11 instanceof IsoZombie) {
        IsoZombie var10 = this.getClosestZombieThatisNotThatZombie((IsoZombie)var11); //get closestZombie to me, that I can detect, except targetZombie
        if (!this.attackVars.bAimAtFloor //not aim floor
        && (double)var8 > 1.25D //target is further than 1.25 "meters"
        && var4 == WeaponType.spear //weapon is spear
        && (var10 == null || (double)IsoUtils.DistanceTo(this.x, this.y, var10.x, var10.y) > 1.7D) //if that other "closestZombie" is far enough from me I can safely headshot with my spear
        ) {
           if (!GameClient.bClient || this.isLocalPlayer()) {
              this.setAttackType("overhead");
           }
           var9 += 30;
        }
     }

     

×
×
  • Create New...