Jump to content

YouGroove

Members
  • Posts

    4,978
  • Joined

  • Last visited

Posts posted by YouGroove

  1. It is like texture compression without it the game is becoming too big huh.png

    Example sounds i have is 10 Mo in Wav , and it turns to 1Mo in Ogg for example.

     

    Anyone made Ogg support in LE3 using a free lib and C++ already ?

    (It would be great to have that as some addon in the workshop)

  2. Instead of calling a sub function i kept animations call in UpdateWorld() and it works great now.

     

    function Script:UpdateWorld()
    
    
    ...
    ...
    ...
    if self.canAttack == true and self.state == "idle" then
    self.state = "attack"
    self.animationmanager:SetAnimationSequence("attack",0.02,200,1,self,self.stopAttack,30)
    end
    
    
    if self.state == "idle" then
    self.animationmanager:SetAnimationSequence("idle",0.02)
    end
    
    ...
    ...
    
    end

     

    I spend the day try to figure out something that should work , but doesn't work in Lua, i like less and less Lua.

    It is really too permissive allowing many errors and can go weird and not work sometimes.

     

     

    Bring on BlitzMax laugh.png

  3. The code is too simple , but perhaps i don't see something ?

     

    function Script:UpdateWorld()
    
     self.delay =Time:GetCurrent()- self.attackDelayTimer
    
       if self.enabled == true   then
    
     --timer
     if   Time:GetCurrent()- self.attackDelayTimer > self.attackDelay then
    
      self.canAttack = true
      self.attackDelayTimer = Time:GetCurrent()
     end
    
    
    
    
    
       if self.canAttack == true and  self.state == "idle"  then
    
      self.state = "attack" 
    
       end
    
    
     self:animations()
    
     self.canAttack = false
    
       end
    
    end
    
    
    function Script:animations()
    
    if self.state == "attack"  then 
     self.animationmanager:SetAnimationSequence("attack",0.02,2000,1,self,self.EndAttack)
     --self.animationmanager:SetAnimationSequence("attack",0.02)
    
    end
    
    if self.state == "idle"  then  
     --self.animationmanager:SetAnimationSequence("walk",0.03,50,0,self,self.EndIdle)
     self.animationmanager:SetAnimationSequence("walk",0.03,50,0,self,self.EndIdle)
    end
    
    
    end
    
    function Script:EndIdle() 
    
    end
    
    function Script:EndAttack() 
    
    
     self.state = "idle"  
    
    end
    

  4. I have a test project just for this animation project.

    -Dezip all files and put all in "Models" project folder

    -Open map level file "animationDebug.map" and launch the game

     

     

    The goal is to have the attack animation playing entirely and the other animation playing when the state is not "attacking".

    exportdebug.zip

  5. When i use the following code, the "attack" animation just not terminate, it plays only the beginning ?

    Any idea ?

     

     

    self.animationmanager:SetAnimationSequence("attack",0.02,10000,1,self,self.EndAttack)
    

     

    I tried many values for blending , it is better with bigger values , still it never plays the animation entirely.

  6. I use that following modified script and i have a player with teamid = 1 , i'm curious why it doesn't work ?

     

    --find the player
    local entities = GetEntityNeighbors(self.entity,10000,true)
    local k,entity
    for k,entity in pairs(entities) do
     if entity.script~=nil and entity.script.teamid~=1  and entity.script.teamid==1  then
      self.debugteam = 1
       if entity.script.health>0 then
     self.target = entity:FindChild("hitBoxPlayer")
       end
     end
    end
    

     

    When i read self.debugteam after this function it has value = 0 ?

  7. Wish I could animate, tried several times but it gives me headache lol...

    It is just practice, and you have tools to help you like mixamo or you can buy animations (only animation retargetting is missing in LE3).

     

     

    coding time

    coding.jpg

    • Upvote 1
×
×
  • Create New...