Jump to content

DudeAwesome

Members
  • Posts

    541
  • Joined

  • Last visited

Posts posted by DudeAwesome

  1. I have a camera with birds eye perspective and will now use my mouse to click on primitive objects to select them. I´m stuck a little bit how to get the objects behind my mousecursor. The Window Class only gives me functions like GetMousePosition. I have an idea to calculate a ray startpoint in relation to the xy position from my mousecursor in the window and send the ray with 90° into my world to see if there is a collision with an entity but that seems to be not that nice.

     

    someone give me a hint?

  2. I agree , basic Lua tutorials would help a lot to come more slowly to LE3 instead of being confused by too much stuff like tutorials dealing with camera, player, raycast all at same time.

    Rick Wiki Snippets is ideal site to have such category we could name : "Lua in LE3 for beginners"

     

    mhmm but where are tutorials for advanced people? I have the feeling that a lot of LE3 users buy leadwerks and think its a drag and drop clicktool where you can build a GTA 5 clone in 2 hours without any coding skills. I really would like to see some tutorials like introduce into shaders or some design patterns for game development. Sometimes I think new users are just lazy when I read some steamcommunity threads.

  3. Light is on, light is off. I've messed around with some script, but I was trying to have a PushButton lua call a pivot which contained some custom code I wrote to turn the light off and it wasn't working... bah.

     

    its supereasy just use PushButtonscript and create a new one with a flowgraph function like

     

    Script:Toggle() --in

     

    if self.entity:Hidden() then
    self.entity:Show
    else
    self.entity:Hide()
    end
    

     

    and use this script with a light.

     

    I really prefer more advanced tutorials

  4. should be possible to create some ballistcs like parabel and so an. I´m trying to do something like a bullet find its target always with a beziercurve. in 2d no problem to implement in 3d I need more time ;D

  5. I rotated an entity (ground) with

     

    function Script:UpdateWorld()
    if App.window:KeyDown(Key.L) then
    rotationNow = self.entity:GetRotation()
    self.entity:SetRotation(rotationNow.x,rotationNow.y,rotationNow.z-1)
    
    System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z)
    end
    
    if App.window:KeyDown(Key.J) then
    rotationNow = self.entity:GetRotation()
    self.entity:SetRotation(rotationNow.x,rotationNow.y,rotationNow.z+1)
    System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z)
    end
    
    if App.window:KeyDown(Key.K) then
    rotationNow = self.entity:GetRotation()
    self.entity:SetRotation(rotationNow.x-1,rotationNow.y,rotationNow.z)
    System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z)
    end
    
    if App.window:KeyDown(Key.I) then
    rotationNow = self.entity:GetRotation()
    self.entity:SetRotation(rotationNow.x+1,rotationNow.y,rotationNow.z)
    System:Print("X: " ..rotationNow.x .. " Y: " ..rotationNow.y .. " Z: " ..rotationNow.z)
    end
    
    end

     

    before rotation

    https://www.dropbox.com/s/wobccysass1cxtc/Screenshot%202014-01-18%2000.37.51.png

     

    after rotation

    https://www.dropbox.com/s/t7p73t5x9tm969f/Screenshot%202014-01-18%2000.38.19.png

     

    when I have probs (like the sphere) on the ground they ignore the rotation and stay in the air until I touch them (with FPSplayer)

     

     

    I think I need some kind of UpdateShape() or UpdatePhysics()

     

     

    someone could tell me the right command that my props act like they should ?

  6. i´m not interested into the LE 3 terrain editor (useless for me) I need lua/c++ functions from the LE3 API to load a .raw or export information about every pixel to create random worlds. I also have a script written with pure OpenGL but when the LE3 API have some functions to analyse .raw-maps it would be also nice

  7. I got it now. triggering just with shapes is possible

     

     

    if someone is interested in:

     

    just add this script to a pivot object and move it to the position where you want the trigger.

     

    Size can be manipulated in the Script Tab

     

    Press L to show triggers in debug mode

     

     

     

     

    Script.Mapfile = "" --path Map
    Script.triggerSize = Vec3(1,1,1) --vec3 TriggerSize
    Script.triggerVisible = true --bool ShowTrigger
    function Script:Start()
    self.enabled=true
    if self.triggerVisible then
    --Create box
    self.box = Model:Box(self.triggerSize.x, self.triggerSize.y, self.triggerSize.z)
    self.box:SetPosition(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z)
    self.box:SetColor(0,1,0)
    end
    --Create shape
    self.entity:SetCollisionType(Collision.Trigger)
    self.shape = Shape:Box(0,0,0, 0,0,0, self.triggerSize.x, self.triggerSize.y, self.triggerSize.z)
    self.entity:SetShape(self.shape)
    self.shape:Release()
    end
    function Script:Collision(entity, position, normal, speed)
    if self.enabled then
    self.component:CallOutputs("Collision")
    System:Print("BAZINGA")
    if(self.Mapfile) ~= "" then
    --do a mapload
    end
    
    end
    end
    function Script:Enable()--in
    if self.enabled==false then
    self.enabled=true
    self:CallOutputs("Enable")
    end
    end
    function Script:Disable()--in
    if self.enabled then
    self.enabled=false
    self:CallOutputs("Disable")
    end
    end
    
    function Script:UpdateWorld()
    if DEBUG then
    if App.window:KeyHit(Key.L) then
    if self.box == nil then
    --Create box
    self.box = Model:Box(self.triggerSize.x, self.triggerSize.y, self.triggerSize.z)
    self.box:SetPosition(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z)
    self.box:SetColor(0,1,0)
    self.box:Hide()
    end
    if self.box:Hidden() then
    System:Print("Trigger on")
    self.box:Show()
    else
    System:Print("Trigger off")
    self.box:Hide()
    end
    end
    end
    end
    

    • Upvote 1
  8. Could you explain what difference it would matter?

     

    A material need resources to storage and there is a drawcall that "draw" the invisible material. I dont need both things in this case and it cost rendertime and storage in my RAM.

     

    the minimal information I need is:

     

    a nullpoint to find my trigger

    and 6 faces (6*2 =12 triangles)

     

     

    so I only have a nullpoint = 3 integers // x y z

     

    and 12 triangles (12*3= 36 vertices) = 3*36 = 108 integers (or less because some vertices are the same)

     

    (sure when I create objects there are more informations)

     

    for a cuboid trigger

     

     

     

    I would like to have something that isnt drawn in the world and just have shapes to detect collisions maybe a new entity?

    • Upvote 2
×
×
  • Create New...