Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Posts posted by macklebee

  1. That file contains a type that declares all the procedural functions, since they aren't part of a class.

     

    so this is the correct way to do it?

    Framework leadwerks.ENGINE
    Import lugi.generator
    Import "luacommands.bmx"
    Import leadwerks.framewerk
    'Include "lua-gluefunctions.bmx"
    'generateGlueCode("lua-gluefunctions.bmx")
    'End
    GenerateGlueCode("BMAX2luaFramewerk.bmx")
    End

     

    then include the "BMAX2luaFramewerk.bmx" from now on?

     

     

    ***edit--- ok that didn't work. The generated file still didn't allow skybox or water properties to be automatically created in bmax... So I assume I am doing something wrong. But in any case, this seems like this should already be built-in, especially if core objects in the editor are going to use framewerk methods. I realize this will probably eventually happen, and that it will just take time to do so... Seems like having the entire framewerk built in lua is a must if you expect users to be able to share scripted models with each other easily.

  2. Thanks, I'm looking through the 'Introduction to Particles' tutorial.

     

    gordon, just add an emitter to a scene in the editor making adjustments as you see fit, and load the scene with your program. It can be all handled by lua script now.

  3. ahh... hehe you already found this... :D:)

     

    in any case, if you create a environment_emitter.INI file with these settings:

    color=255,255,255,255
    intensity=1
    particles=50
    velocity=0,1,0
    radius=0.1,0.1
    rotationspeed=1.0
    life=1.0
    waver=1.0
    area=1,1,1

     

    and save the file inside the ..\Leadwerks Engine SDK\Models\Entities\Environment\Emitter folder.

     

    Restart the editor and place an emitter in the scene. This allows you to avoid having to set the color/alpha every time you create an emitter, unless of course you wish to change the color.

  4. Is it possible in the LE. to ceate a Wall of Fog. A fog that you could walk into but not be able to see anything particularly, say just gray. I assume particles would produce something like this. Any ideas?

     

    you could use distancefog, but it would make everything gray... and not some defined entity that you could approach. Or you could use a particle emitter... perhaps even implement the cloud shader on an entity...

  5. You need to use it in conjunction with the Consume() and GenitalShrinkage() functions.

     

    i don't know if the last one will work... newton has issues with scaling. :)

    • Upvote 1
  6. Hi... i would just like to say, this poll cold be slightly deceiving. What i mean by that is, i guess you may use a poll for many reason but one reason would be so you know what direction to aim LE for, for such things as.. support, examples, documention, headers, tutorials ETC (may be not be the case here, but this is just in case you intent to). Well, i voted C++ simply because thats what i am currently using, but not by choice. Simply beacuse that is what is most currently supported for... for example the tutorials... there nearly all aimed at C++ and so i download MSVC++ and went from there, but i would much prefer to use blitmax and i know that if there was as many tutorials and examples for blitzmax than there was for C++ then my vote would be for blitzmax, not C++.

     

    Not a rant, just thought ide say as i feel with the way results are going this will only push you more towards c++ users.

     

    Maybe a poll for "what would you prefer to use" :)

     

    Thanks

    Andy

     

    Agree. You are not the first one that felt they had to use C++ for leadwerks simply because most of examples/tuts were geared towards c++. It was unfortunate that the decision was to focus on c++. Always thought it was strange that the logic for doing this was because bmax users can simply convert c++ tuts whereas apparently c++ users can't convert bmax tuts... but in any case, what I have found as well as others (actually we just had a recent convert :) ) that bmax is still a lot easier to get a handle on for LE especially if you are new to programming.

  7. Hey everyone.

     

    So I've got my code loading new 2.3 Editor maps with Lua script and its starting to look amazing.

     

    I did have one question. I would like to create Nodes, much like the AI node so that I can create a player start position as well as different enemy nodes so that I can parse it and load an object in code as well as the model.

     

    My question however is how I create and parse the nodes so that I can do the processing in code.

    I have looked at the tutorial but it seems with the new editor, parsing is a bit different.

     

    Easiest would be to just give it a specific unique name in the editor properties, save the sbx, and then just search for the entity key that has that specific name (instead of the old way of searching for a classname). If the entity in your parsing of the sbx has that unique name then perform whatever you wish based on that entity.

  8. You can get the LuGI modules at http://github.com/nilium/lugi.mod. 0.9b should work with Leadwerks, but you may wish to clone and use the stable-0.8 tagged revision instead just for consistency's sake, since I don't believe Leadwerks is using 0.9b (yet, perhaps).

     

    do i just download the generator.mod and place that in the blitzmax mod folder for lugi.mod folder? sorry, I am not sure I understand what you mean when you say clone?

  9. what are you using for an acceleration value for the UpdateController command? That increases the acceleration of your controller (and inversely the deceleration). What is the mass you have set to your controller? A controller with a much higher mass than the object it collides with will react differently than when the two are closer in mass. Also, play around with the iterations value (the parameter after the acceleration parameter in UpdateController), because according to the wiki:

    The iterations parameter controls how many times collision is calculated. Using several iterations can make motion appear smoother when a camera is attached to the controller. However, an iterations value of one is enough for controllers that do not control the view.
  10. I keep getting errors because it doesn't find the interface for module "lugi.generator" if I do it like this:

    Framework leadwerks.ENGINE
    Import lugi.generator
    Import "luacommands.bmx"
    Include "lua-gluefunctions.bmx"
    'generateGlueCode("lua-gluefunctions.bmx")
    'End

     

    If I comment this line out and the use the generateGluecode, I get an error that it doesn't recognize the generateGluecode command.

    Framework leadwerks.ENGINE
    'Import lugi.generator
    Import "luacommands.bmx"
    'Include "lua-gluefunctions.bmx"
    generateGlueCode("lua-gluefunctions.bmx")
    End

     

    If I comment out the generateGluecode/End and lugi.generator, and include the "lua-glufunctions.bmx" then it works.

    Framework leadwerks.ENGINE
    'Import lugi.generator
    Import "luacommands.bmx"
    Include "lua-gluefunctions.bmx"
    'generateGlueCode("lua-gluefunctions.bmx")
    'End

     

    So where do I get the lugi.generator module? I assume this contains the generategluecode command? and yes I have the lugi module inside the blitzmax module folder...

  11. Hey, so is there a way to make a mesh (CreateSphere) be see through instead of white? I want to do this so that when I apply the cloud layer texture to my sky sphere I can see the blue sky texture on the skybox outside the sky sphere.

     

    see this video and look at the wiki home page for the pdf file...

  12. That works too, you're on a roll. :blink:

     

    thanks gordonramp.

     

    If any bmx users are interested, you can get an updated controller program from my blog that sets your skybox, water properties, and distance fog based on your Editor map, as well as give the option to set aa, bloom, godray, hdr, ssao, and wireframe during runtime... basically just what I am using to test the new editor and lua scripted objects...

  13. yeah, good point josk...

     

    to get the oildrum lua script sound to work in your bmax framewerk program, you need this in your bmax code:

    SetGlobalObject("listener", CreateListener(fw.Main.camera))

     

    and this is the modified oildrum.lua code for the collision function:

    --Add collision noise
    function Collision(model,entity,position,normal,force,speed)
           local entity=entitytable[model]
           local time,i
           if fw~=nil then
                   listener = fw.listener
           else
                   listener=GetGlobalObject("listener")
           end
           if EntityDistance(listener,model)<30 then
                   if speed>hitthreshhold then
                           time=AppTime()
                           if time-lasthitnoisetime>hitnoisedelay then
    
                                   --Check how many impact noises are already active
                                   local countsources=0
                                   for i=0,2 do
                                           if hitnoise[i]~=nil then
                                                   countsources=countsources+hitnoise[i]:ActiveSources()
                                           end
                                   end
    
                                   --Only emit a sound if there are fewer than the allowed max sources
                                   if countsources<maxhitsources then
                                           i=math.random(0,2)
                                           if hitnoise[i]~=nil then
                                                   entity.model:EmitSound(hitnoise[i],30,1.0,0)
                                           end
                                   end
    
                                   lasthitnoisetime=time+math.random(0,hitnoisetimevariation)
                           end
                   end
           end
    end

  14. Mack,

    Your code with collisions is working for me too, thanks for that. :unsure:

     

    glad i could help ;)

     

    i am trying to finish setting up my bmax framewerk testing code that will set the water, distance fog, skybox, what have you... i will post that in my blog for anyone to use for testing if they wish...

  15. Mike, try changing the light_point INI file from this:

    classname="light_point"
    color=255,255,255,255
    intensity=1
    range=10
    shadowmapsize=256
    shadowoffset=0.0,0.95
    inversesquarefalloff=1

     

    to this:

    classname="light_point"
    color=255,255,255,255
    intensity=1
    range=10
    resolution=0
    linearoffset=0.0
    multoffset=0.95
    inversesquarefalloff=1

     

    This is the easiest so you don't have to change the lua script.

     

    Linearoffset and multoffset replace shadowoffset.

     

    Resolution replaces shadowmapsize in the INI file and the settings are this:

    resolution=0 is a shadowmapsize of 256

    resolution=1 is a shadowmapsize of 512

    resolution=2 is a shadowmapsize of 1024

    resolution=3 is a shadowmapsize of 2048

     

    Then restart the Editor and open up your scene and click onto your pointlight and check the settings... then resave the sbx and see if works now... you might have to delete the pointlight and recreate it to get it to work correctly.

  16. i was wrong... it seems as if the scene doesn't need to have a waterplane in it... and in BlitzMAX, all you need to do is fw.Renderer.SetWater True

     

    then, use these to set the water properties...

     

    fw.Renderer.SetWater True

    fw.Renderer.SetWaterHeight 0.5

    fw.Renderer.SetWaterSoftness 2

    fw.Renderer.SetWaterAmplitude 88

     

    fw.Renderer.SetWaterWaveSpeed 2

    fw.Renderer.SetCaustics True

    fw.Renderer.ReflectionRenderComponents=ENTITY_RENDERABLE

    fw.Renderer.SetWaterColor Vec4(0.1,0.2,0.49,1), Vec4(0.1,0.2,0.49,1)

     

     

     

    if you get a chance would you confirm this for me... thx

     

    --Mike

     

    yep, those look like what I have... working on modifying my testcode right now to incorporate that into my parsing loop along with setting the skybox...

×
×
  • Create New...