Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

1,655 Excellent


About AggrorJorn

  • Rank
  • Birthday 12/18/1989

Profile Information

  • Gender
  • Location
    The Netherlands

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. AggrorJorn

    Introducing Leadwerks Marketplace

    There are a lot of cool model packs. Really tempting not to buy all kinds of stuff that I do not need.
  2. AggrorJorn

    Problem with medikit (Workshop) model

    So you load the model, set the script, and mass and physics type are set. And your medkit falls down when you start the game? If you run your game in debug mode and debug physics (I think you have to press P or F1) to toggle, does your entity have a physics shape? Does that differ from a medkit that is loaded via the editor?
  3. AggrorJorn

    Problem with medikit (Workshop) model

    And can you access the scripta variables? Is the collision type set? Is the mass set?
  4. AggrorJorn

    Problem with medikit (Workshop) model

    I mean the script you use to load in the medkit in to your scene. If you load the model of the medpack, you need to set the script yourself. Once you have spawned the medpack, can you access any variable in it? if not than that would mean there is no script attached to it.
  5. AggrorJorn

    Introducing Leadwerks Marketplace

    Some feedback: When viewing categories, can you show a price tag? Also sorting on price would fit common webshop capabilities:
  6. AggrorJorn

    Introducing Leadwerks Marketplace

    For animated characters I would add a mandatory list of animations that the character has.
  7. AggrorJorn

    Problem with medikit (Workshop) model

    Can you show the script? Are loading in the prefab or the model via script?
  8. AggrorJorn

    Help me, Collision Camera.

    Note that the pickinfo object needs to be created before you do a pick. local pickInfo = Pickinfo() if world:Pick( posPivote.x, posPivote.y, posPivote.z, posCamara.x, posCamara.y, posCamara.z, pickInfo, 0, true ) then System:Print(pickInfo.position) end
  9. AggrorJorn

    DrawText question

    If you still want to use FlowGui, there is a small wiki: https://bitbucket.org/Aggror/flowgui/wiki/GUI Manager here is how a minimal example would work: import flowGui somewhere in your main.lua create a flowGui manager create a gui element and add it to the manager. (styles are not even needed to get a ui element to work. ) Remember that FlowGui is no longer being developed and that is there is an official Leadwerks ui that has been released.
  10. AggrorJorn


    Pickmode 0 ignores picking. https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_SetPickMode
  11. AggrorJorn

    DrawText question

    You could also do a simple test to see which script is loaded first. Place this in the start function of the scripts you use. System:Print("Script start from " .. self.entity:GetKeyValue("name"))
  12. AggrorJorn

    DrawText question

    We are getting closer. So for some reason the Flowgui manager is empty in your script. Is it referenced in your countdown script? Instead of linking in the flowGUI manager, you can also create it by script. Note that you only need 1 flowguiManager. So you would either place it in main.lua or you have to make sure it is made only once. self.flowGUIManager = FlowGUI_Manager:Create(Window:GetCurrent(), Context:GetCurrent() )
  13. AggrorJorn

    DrawText question

    "argument #3 is 'string';'[no object]' means that you put in an object rather than a string. Can you post the code were you print info? I tried with FlowGUI it's telling me "attempt to index field 'healthLabel' (a nil value) --line 93 Can you screenshot the scene tree were you have created the style, guimanager? Child/parent isn't really required but helps organising the scene. As long as the guimanager is loaded first and the styles are being loaded before you create the label, everything should work. If you look at any example scene from the FlowGUI project, you can see that I like to organise my scene as follow: pivot-GuiManager (gui manager script attached) pivot styles (no script attached) timerLabelStyle (labelstyle script attached) mycustomobject (in your case the timer) Referencing GUI manager and Timer lablestyle. here is loading the ui style with a wait time build in. I am not at home, so haven't tested it. --Load FlowGUI if a script makes use of it. import "Scripts/FlowGUI/FlowGUI.lua" Script.guiManager = nil --entity "GUI manager" Script.healthLabelStyle = nil --entity "HealthLabelStyle" Script.healthLabel = nil Script.uiLoadInterval = 1 Script.startTimeStamp = nil Script.uiLoaded = false function Script:Start() self.startTimeStamp = Time:GetCurrent() self.guiManager = self.guiManager.script end function Script:UpdateWorld() if self.uiLoaded == false and Time:GetCurrent()-self.startTimeStamp > self.uiLoadInterval then self.healthLabelStyle = self.healthLabelStyle.script:GetStyle() self:CreateLabel() sel.uiLoaded = true end end function Script:CreateLabel() self.healthLabel = FG_Label:Create() self.healthLabel:SetPosition(Vec2(200,120)) self.healthLabel:SetScale(Vec2(150,50)) self.healthLabel:SetText("Your health") self.healthLabel:SetGUIStyle(self.healthLabelStyle) self.healthLabel:SetTextPosition(FG_TextPosition.Center) self.healthLabel:SetDebug(false) self.guiManager:AddElement(self.healthLabel) end function Script:PostRender() if sel.uiLoaded then self.healthLabel:SetText("Your updated health") end end
  14. AggrorJorn

    Voxel Cone Tracing Part 3 - Raycasting

    Really impressive stuff this. How you get this done so quickly is beyond me. I remember having spend weeks on an implementation of marching cubes, to only get a result were it took 3 seconds to render a small blob of voxels.
  15. AggrorJorn

    DrawText question

    You can load the font in the start function, and set the font in the postrender function. self.font = Font:Load("Fonts/arial.ttf",10) You can clean it up (like you already said) with something like this: centerTimerX = context:GetWidth() - (timerAreaWidth / 2) drawX = centerTimerX - (font:GetTextWidth(text)/2) You can also System:Print(font:GetTextWidth(text)) to see if the width of the text is actually changing. Sorry I was thinking of a healthbar for some reason, but it doesn't matter for its purpose.