Jump to content

aarrowh

Members
  • Posts

    27
  • Joined

  • Last visited

Posts posted by aarrowh

  1. I'm attempting to implement a simple x,y display for the mouse and x,y,z for the camera, but I cannot get any text display to work.

     

    I'm using the context::DrawText() command, I've attempted drawing the text before the world and vice versa to see if that was the issue, but that didn't work either. The documentation example doesn't use any 3d rendering in the demo code, so I have no idea if I'm rendering everything in the correct order.

     

    Here is a copy of the app loop I was testing with

     

    //Close the window to end the program
    if (window->Closed()) return false;
    //Press escape to end freelook mode
    if (window->KeyHit(Key::Escape))
    {
    
     if (!freelookmode) return false;
     freelookmode = false;
     window->ShowMouse();
    }
    if (freelookmode)
    {
     //Keyboard movement
     float strafe = (window->KeyDown(Key:) - window->KeyDown(Key::A))*Leadwerks::Time::GetSpeed() * 0.05;
     float move = (window->KeyDown(Key::W) - window->KeyDown(Key::S))*Leadwerks::Time::GetSpeed() * 0.05;
     camera->Move(strafe, 0, move);
     //Get the mouse movement
     float sx = context->GetWidth() / 2;
     float sy = context->GetHeight() / 2;
     Vec3 mouseposition = window->GetMousePosition();
     float dx = mouseposition.x - sx;
     float dy = mouseposition.y - sy;
     //Adjust and set the camera rotation
     camerarotation.x += dy / 10.0;
     camerarotation.y += dx / 10.0;
     camera->SetRotation(camerarotation);
     //Move the mouse to the center of the screen
     window->SetMousePosition(sx, sy);
    }
    context->SetColor(0, 0, 0);
    context->Clear();
    //Draw some centered text on the screen
    std::string text = "Leadwerks";
    Font* font = context->GetFont();
    int x = context->GetWidth() / 2;
    int y = context->GetHeight() / 2;
    x -= font->GetTextWidth(text) / 2;
    y -= font->GetHeight() / 2;
    context->SetBlendMode(Blend::Alpha);
    context->SetColor(1, 1, 1);
    context->DrawText(text, x, y);
    context->SetBlendMode(Blend::Solid);
    
    Leadwerks::Time::Update();
    world->Update();
    world->Render();
    context->Sync();
    

  2. I pre-ordered Leadwerks 3.1 which came with indie for steam. Now that the full version is up and running on steam(with workshop) Will I need to purchase the full version on steam in order to utilize the workshop support? Whenever I try to open my project from steam I get a "C++ template not found" error.

     

    Is there a way to get the non-steam editor to recognize workshop support or am I going to have to pay the extra $99?

  3. How much LUA do you use with your C++? I'm trying to find a good balance between the two. How do you use LUA in your games?

     

    Also, is there a way to access LUA variables from C++?

  4. I'm having some trouble with leadwerks on my new laptop.(Surface Pro 3) The engine loads and runs just fine, but when I try and make any changes in C++ and test them out, it asks me to perform a "save as" instead of auto-saving over the file. When I attempt to save under the same name it will not allow me to, giving me an "Access denied error"

     

    I've searched on the forum and googled for this and have found nothing, anybody else had this problem?

  5. Exactly. Hit yellow and you should jump up and into the blue. Grey is just for walking around. I expected with a jump force of 600 that hitting the blue would instantly kill me(My goal). Instead, I fly straight through and into the sky beyond.

  6. i am not sure. That would require a bit of try and error.

     

    My first guess is that it possibly collides again with the Trigger object.

     

    Try this to have Triggers not kill your character: (not tested code)

    function Script:Collision(entity,position,normal,speed)
    if speed>20 and entity:GetCollisionType()~=Collision.Trigger then
     self:Hurt(100)
    end
    end
    

     

    This didn't work, i tried playing with it a bit, and still nothing. But I did notice that it is still killing me even if the force is set under 20

  7. Well. at least point 2 makes sence because if you look into the script you will see this part:

    function Script:Collision(entity,position,normal,speed)
    if speed>20 then
    self:Hurt(100)
    end
    end
    

    which means that if the character collides with something at a speed greater 20 you will be killed instantly.

    But if I'm still on top of the same brush I'm not colliding with anything new, and that also wouldn't explain why getting pushed straight is ok but not a different direction.

  8. *edit* it says I'm not permitted to upload .map files

     

    Script.JumpForce = nil --vec3 "Jump Force"
    Script.SelectiveCollision = false --bool "Selective Collision"
    Script.ColObj = nil --Entity "Collision Object"
    Script.Active = false --bool "Active"
    
    function Script:Start()
    
    end
    function Script:Enable()
    if self.Active == false then
    self.Active = true
    end
    end
    function Script:Disable()
    if self.Active == true then
    self.Active = false
    end
    end
    
    function Script:Collision(entity, position, normal, speed)
     if (self.SelectiveCollision == true and entity == self.ColObj ) then
    		 self.ColObj:AddForce(self.JumpForce)
     elseif (self.SelectiveCollision == false) then
    		 entity:AddForce(self.JumpForce)
     end
    end
    

    That is my jumppad script

     

     

    Both brushes of ground are set to rigid body and scene.

  9. I'm testing out different types of physics pads (Jump pads, boost pads) I've found a couple odd things.

     

    1. When you use a jump pad and hit the bottom of a brush my controller(FPS prefab) goes straight through and lands on the top

     

    2. when using a force based boost pad, going any direction other than straight will instantly kill you.

     

     

    Both pads are based on the JumpPads tutorial.

  10. I'm attempting to add the shotgun from the assets page into the AI demo level. But whenever I load the model, and save it as a prefab it loads in reverse in the game. I tried using

    self.weapon.entity:SetRotation()
    

    But, then my bullets go behind me and the muzzle flash gets stuck to the floor in front of spawn(No idea there.)

     

    I might be blind but I cannot find where the direction of bullet is set in FPSplayer.lua. I'm also trying to orient my weapon outside of the FPSplayer script(So I can use multiple guns)

     

    Any ideas would be great.

  11. I'm very interested in pre-ordering LE 3.1, but I've noticed that the mobile plugins are no longer for sale in the store. Does this mean that they are no longer being offered? Or are they included in the 3.1 purchase.

     

    The mobile plugins being available in any capacity is very important to me.

  12. The reason I'm wondering is because I want to back(Hit that Ouya stretch!) But I ship for Marine recruit training in febuary. As such it will be a very long while before I'll be able to use it again.

     

    So should I back the kickstarter and get Linux and possibly Ouya, or stay safe and get PC/Mac now.

×
×
  • Create New...