Jump to content

josk

Members
  • Posts

    567
  • Joined

  • Last visited

Posts posted by josk

  1. Copied the Shaders folder and it works, knew it was something simple, thanks.

     

    Hidden entities do cast shadows though.

     

    Had to google croc, I think I remember playing a demo,

     

    I have ended up knocking togeather a small demo level by accident just by learning Lua. I will upload after the weekend, not Croc gameplay but I think you might have inspired me.

  2. Sorted, studied the code bit by bit and and read the the explanation of the

    EnemyAttackForEachEntityInAABBDoCallback(entity,extra)
    

    by Chris Vossen in a past thread, another hurdle is overcome.

    • Upvote 1
  3. Just trying to understand using functions between Scripts.

     

    Code is taken from Darkness Awaits but cut down a bit.

     

    self:AttackEnemy() is called in the goblin Script.

     

    but I get attempt to index local 'Newplayer' (a nil value)

     

     

    In Newplayer Script I have

    function Script:TakeDamage(damage)
    if self.Health>0 then
     self.Health = self.Health - damage
    end
    end
    

     

    in Goblin Script I have

    function Script:AttackEnemy(Newplayer)
    local entitypos = Newplayer.entity:GetPosition(true)
    local pos = Transform:Point(entitypos.x,entitypos.y,entitypos.z,nil,self.entity)
    pos = pos * self.entity:GetScale()
    pos.z = pos.z * -1
    if pos.z>0 and pos.z<self.attackRange then
     if pos.z>math.abs(pos.x) then
      Newplayer:TakeDamage(10)
    end  end
    end
    

  4. Until Yesterday Recent status Updates you to show on right hand side of the forum. Is their a user setting to move it back?

    Nothing major but used to looking at updates while checking the forum. Now have to go to community or Portal.

  5. In a Lua script i add force to an object, I can change the amount of force but if the object slows down to a stop I cant get it to move again.

     

    as an example in the update Physics bit

    if self.speed ==1 then self.entity:AddForce(0,0,1.0,true) end
    if self.speed ==2 then self.entity:AddForce(0,0,1.5,true) end
    if self.speed ==3 then self.entity:AddForce(0,0,2.0,true)end
    

     

    so if the variable ever goes to 1, the object wont move again if you then change the variable 2 or 3.

     

    not done much with Physics so any help appreciated.

×
×
  • Create New...