Jump to content

beo6

Developers
  • Posts

    799
  • Joined

  • Last visited

Posts posted by beo6

  1. Or another idea which I liked in some older games.

    The menu where already ingame. I can remember an arcade bowling game where you controlled the bowlingball and selected the level with the game controls.

     

    Or another example even though it also included a normal menu is Portal 2 coop where you land with your partner to select a level.

  2. haven't tried it, but i guess it should work that you export the terrain as *.raw file, open it in an image manipulation application that can open it, make the image bigger so it fits, save and import it into a 2048 terrain.

    • Upvote 1
  3. it can't at least directly. But you can do it with 3 functions.

     

    1. the argument function:

    function Script:something()--arg
    return "Hello"
    end
    

     

    2. the output function:

    function Script:Use()
    self.component:CallOutputs("Use")
    end
    

     

    3. the receiving function:

    function Script:Receive(yourvalue)--in
    System:Print( yourvalue )
    end
    

     

    now just connect the use function with the receive function and drag the something function to the argument point in the flowgraph.

     

     

    //edit:

    just like in some of my scripts. For example this:

    http://www.leadwerks.com/werkspace/page/viewitem?fileid=510080616

    • Upvote 2
  4. Yeah. the Joint:Slider function changed at some point.

     

    here is a fixed version of the Elevator script:

    Elevator.lua

     

     

    Btw. i didn't noticed anything wrong with your example map too.

    So maybe you have modified your scripts a bit that this happens?

     

    Because it looks a bit that your elevator is still active when you step on it.

     

    In my script the elevator is deactivated when it is not moving with setting its mass to 0 which might help there.

     

     

    //Edit: that script there in google drive is really really old i think. smile.png

     

    //Edit2: just uploaded it to the Workshop:

    http://steamcommunity.com/sharedfiles/filedetails/?id=510080616

     

    not sure why i haven't done that sooner.

    • Upvote 2
  5. You can try this:

    https://github.com/luapower/winapi/blob/master/winapi/clipboard.lua

    but you probably need to disable the Lua Sandbox in the Editor and you will not be able to use this in the Leadwerks Game Launcher.

     

    Or i can probably make you a library with Lua ffi,

    but that will definetly require you to disable Lua Sandboxing and prevent publishing to the Leadwerks Game Launcher.

     

     

    //Edit:

    here i added it to my small library.

    https://cloud.software-sl.de/index.php/s/JLiv6hkd9koCLms

     

    copy both files to your root directory of your game. (where your exe is)

     

    and just add in your Main.lua or App.lua right at the top the line:

    import("LEAddon.lua")

     

    then you can use

    addon.SetClipboardToText("This will end up in the clipboard")

     

    or

    local clipboardtext = addon.GetTextFromClipboard()

    • Upvote 1
  6. interesting. yes that executes every time.

     

    one thing i liked about loadfile though is that i was able to load the note into a local variable.

     

    local luaFile = loadfile(documentPath)
    self.text = luaFile()
    

     

    i can't think about a way to only use local variables with the other approaches.

    ( using self.text = {"the text in the file"} )

    ends in an error "attempt to index global 'self'"

     

    but as long as there is no variablename conflict it should be no problem.

  7. thanks. i already thought so.

     

    i now changed it to use import(). My problem first was that import only gets executed once.

     

    But now i just add every loaded note into a table so i can read them later from there. not sure about memory usage there but i guess its not that bad for text only files.

  8. Just wanted to try my Notes script again from the Workshop but i always get

    ---------------------------

    Leadwerks Editor

    ---------------------------

    Failed to download Workshop item.

    ---------------------------

    OK

    ---------------------------

     

    i already unsubscribed to all items since there where some in the list who had no name anymore.

     

    After that i tried to delete everything inside the "SteamApps\workshop\content\251810\" folder which seems to be the downloaded workshop files.

     

    after i resubscribed to the notes script i found the notes script inside a bin file which can be opened as a zip file. (which is why i know it is the correct notes script)

     

    so it got downloaded correctly.

     

    Even creating a new project, pressing install ends in the mentioned error.

     

    ending the subscription and resubscribing does not help. and leadwerks + steam has all write rights to the projects folder.

     

    same with the camera dolly script. other workshop files do work. (at least the ones i tested)

     

    looks like it only happens with my own workshop files?

  9. i hope i understand it correctly what you are trying to do.

     

    you can do the following:

    function Script:CreateNewParent(pName,x,y,z)
    --self.parent[pName]=nil
    self.parent[pName] = Model:Box()
    self.parent[pName]:SetPosition(x,y,z)
    end
    

     

    after a

    self:CreateNewParent('yourchoosenname', 0, 0, 0)

    you should be able to access it with self.parent.yourchoosenname

     

    //Edit:

    if you want to make the current entity a parent of the new one you would have to add

    self.entity:SetParent(self.parent[pName])

    after you created it.

    • Upvote 1
  10. Thanks.

     

    Using

    Prefab:Load("Prefabs/myprefab.pfb", Map.LoadScripts+Prefab.NoStartCall)

     

    seems to work.

     

    But it feels a bit odd since calling only

    Prefab:Load("Prefabs/myprefab.pfb")

     

    for the first time does load the script. So it is not really clear that Prefab.NoStartCall does completely prevent loading the script and not only just prevents calling the Start function.

     

     

    //Edit: what about that prefabs placed by the editor do not return their entity name with

    self.entity:GetKeyValue("name") ?

×
×
  • Create New...