Jump to content

ZioRed

Members
  • Posts

    1,133
  • Joined

  • Last visited

Posts posted by ZioRed

  1. I don't know what you are doing or what you want to do, I only explained a scenario sample of handling click on a mesh ;)

     

    There's no difference about adding the models at runtime or in the editor. If you add them in the editor then you can check "name" with GetEntityKey since you should know what are the names or however you can use LUA scripting for your clickable models in which are set a custom property which you will check against with GetEntityKey.

  2. In my game I have an array of characters which have a slot number and a mesh in its properties, so in the selection screen I initialize the characters meshes and set the relative slot number (SetEntitiKey(characterMesh, "slot", slot_number)), so after the pick call I check the "slot" key of the entity to know what character has been clicked (I set mouse visible for that).

  3. and i have a quick question: is it possible to make plug-ins for any of the leadwerks tools? i know you cane get library's

    Someone else was asking something like this, that is the creation of plugins for the editor, but this feature is not present atm (it would be nice).

  4. TCamera mycam = CreateCamera();
    TPick mypick;
    TEntity myent;
    
    if (MouseDown())
    {
           if (CameraPick(mypick, mycam, Vec3(MouseX(),MouseY(),1000)))
           {
                  //Do something when the mesh GetPicked
                  myent = mypick.entity;
                  EntityColor(myent, Vec4(1,0,0,0));
           }
    }
    

     

    To know what entity has been picked you can check a key previously stored with GetEntityKey(). I would filter the CameraPick for a specific CollisionType which you need (you can also specify a pickfilter callback for more advanced filtering).

  5. I wrote this little tool just because was bored to manually rename every model (I bought a Dexsoft pack, tens of trees to convert and rename), so I agree with this request too. May be nice if we can have the same ability as vegetation to fill an area with multiple istances of the objects as a brush to quickly fill the scene (the creation of villages or an area full of NPCs would be really quick).

  6. Since it is a beta version please try it on a backup copy of your work before using it on your production. I hope this may be useful to someone else besides me.

  7. index.php?app=downloads&module=display&section=screenshot&id=146

    File Name: zrLEHelper

    File Submitter: ZioRed

    File Submitted: 18 May 2010

    File Updated: 19 May 2010

    File Category: Tools and Utilities

     

    zrLEHelper may be a useful utility for whom is bored to go back and forth on one or more Explorer windows to convert models, edit scripts, creating PHYs etc. With zrLEHelper you have an all-in-one window in which you can convert (using the basic Leadwerks conversion tools) or also rename multiple files at once, e.g.: think if you must add a prefix "vegetation_" to ten or more of your models+LUAs+PHYs, with this tool you just select all files and use RENAME > ADD PREFIX, digit the prefix and you will have all the selected files renamed (the prefix/suffix adding/removing regard the file name without extension).

     

    You can double click on a file in the right list to open it with your default program (the one registered on Windows).

     

    This program requires .NET Framework 4.0 which must be installed before install the program.

     

    Feel free to suggest more functionalities or report bugs.

     

     

    Features

    • Adding or remove prefixes and suffixes to multiple files
    • Direct calls to Leadwerks conversion tools for multiple files
    • Possibility to add a folder your Special folders or quick access
    • Direct access to the Leadwerks tools (Editor, Script Editor, Material Editor, Model Viewer)

     

    Next release features:

    • Projects management

     

    Click here to download this file

  8. Changes to some behaviours... if my game would be almost finished then I don't think that updating the engine can be a good way if I don't want to change something on my code too (except if the previous version caused major bugs in the game). Of course this is only my personal opinion, anyone can agree or not, it's matter of point of view.

  9. May be also useful a combination of keys, e.g.: holding down X, Y or Z and pressing UP/DOWN (or RIGHT/LEFT) arrows could gradually scale it in that dimension. For the gizmo, I think that could be nice if positioned at top-right of the scene (like it is on 3DSMAX if I remember well).

  10. that may be true Josh... but the exact same code that was being used in 2.31 caused the problem to fault out in 2.32r, which means that something internally was changed... that's the point i think he was trying to make...

    Just to defuse and cool down the souls, I cannot imagine how a whatever code may be improved without changing it internally :)

     

    And for the "I expect my code works 100% on any major update" thing, I really never expect that a code for a previous version of any library has the 100% behaviour when used on a newer one but only "hope" it. And however surely don't complain if some behaviour changes due to performance/quality enhancement or bugs (these are generally fixed when found and reported) or drop nothing for a poor thing like that, simply if I don't want to update the code I go to use the older version.

     

    For the object:Render replacement I have to say that using a deprecated method which internally calls the new Draw should be surely the best way for at least 2.32

  11. I am working on this for my own GUI manager and other stuff, what I'm doing is initializing a key/value pair array (key=specific mesh ID, value=click callback), then calling CameraPick and finally calling the callback matching the picked entity mesh ID on the array.

     

    I don't know what should be the correct C++ code for this, since I work on C#.

  12. I have to admit that Lumooja's posted code does seem to offer a safer way of determining that the entity returned is indeed the top level model.

    I agree and I must admit that Gamelib contains some very helpful functions, I think to use it for my C++ games and write a C# wrapper or porting for my current project.

     

    there should still be a check for a NULL Entity prior to supplying it to any function

    Well, I think that it should be a must for safe programming in any language.

  13. But when I have a very large scene with lots of objects, isn't this very computer power comsuming? I mean the scene can hold thousand of objects, is looking through every child in the scene very heavy?

    I don't know how the engine stores the object list, but if it uses a correspondent of C# Hashtable to store the list then recovering an item from it through its key (in that case the object's name would be the key of the item) is the quicker way. However I think that if you should cycle through every object to find the one you need then every other way should have almost the same CPU consuming.

  14. Considering your situation, you would have to learn anyway something new, unless you want to write headers for VB.NET (should be quite similar as the existing C#.NET headers).

    I think there is no need to write VB.NET headers, it should be enough compiling the C# wrapper and add reference to the resulting DLL in any .NET language.

  15. I would get the entity by its name, this works:

     

    
    scene = LoadScene("abstract::tunnels.sbx")
    
    
    while AppTerminate()==0 do 
    
    if KeyHit(KEY_ESCAPE)==1 then
    	break
    end 
    
    if KeyHit(KEY_SPACE)==1 then
    	m_entity = scene:FindChild("node_1")
    	if m_entity ~= nil then
    		camera:SetPosition(m_entity:GetPosition(1))
    	end
    end 
    
    UpdateAppTime() 
    world:Update(AppSpeed()) 
    
    SetBuffer(gbuffer) 
    world:Render() 
    SetBuffer(BackBuffer()) 
    world:RenderLights(gbuffer) 
    
    DrawText(UPS(),0,0) 
    Flip(0)
    
    end
    

×
×
  • Create New...