Jump to content

Josh

Staff
  • Posts

    23,123
  • Joined

  • Last visited

Blog Comments posted by Josh

  1. Meh, 3D World Studio had prefabs since before it was called 3D World Studio.

     

    The editor file open dialog will actually allow you to load prefabs like a map, so you can make your changes with the full editor options and resave them. A smaller prefab editor inside the editor would just be the editor inside itself.

  2. So if the skinning is done in the CPU... Will a raycast be able to hit the mesh in its animated location/orientation? Rather than just hitting the original non skinned mesh like it currently does in LE2

    Raycasts are performed on a BSP structure that is generated from a triangle mesh, to make them fast. Dynamically recreating the BSP structure would make performance very slow. I could step through testing triangles one at a time, which would be faster but still slow, but I anticipate using GPU skinning in the high-end renderer, so I think that would be a bad idea.

     

    However, you can attach hit boxes in the editor pretty easily in the editor, save the model as a prefab, and then reuse it.

    • Upvote 1
  3. That would be cool, but I don't know of any way to make a cross-platform text editor with syntax highlighting and line numbers. Scintilla is the only one I know of and it's undocumented and buggy. I'm using the actual OS text editor control on Windows and Mac right now, with my own syntax highlighting code. I can create a gutter next to the text, but it would have to sync with the text area scrolling, and I don't know if that's possible.

     

    This works fine, but the scroll syncing is the problem:

    ' createtextarea.bmx
    
    Import MaxGui.Drivers
    
    Strict 
    
    Const GUTTERWIDTH:Int=35
    
    Global window:TGadget = CreateWindow( "My Window", 130, 20, 640, 480 )
    
    Global textarea:TGadget = CreateTextArea( 0, 0, ClientWidth(window), ClientHeight(window), window )
    SetMargins textarea,GUTTERWIDTH+2
    
    'Gutter:
    Local gutter2:TGadget=CreatePanel(0,0,GUTTERWIDTH+1, textarea.ClientHeight(),textarea)
    SetGadgetLayout gutter2,1,0,1,1
    SetGadgetColor gutter2,192,192,192
    Local gutter:TGadget=CreatePanel(0,0,GUTTERWIDTH, gutter2.ClientHeight(),gutter2)
    SetGadgetColor gutter,220,220,220
    SetGadgetLayout gutter,1,1,1,1
    Local label:TGadget
    Local lineheight:Int=14
    Local font:TGUIFont=LoadGuiFont("Arial",10)
    For Local i:Int=1 To 1000
    label=CreateLabel(i,0,(i-1)* lineheight,gutter.ClientWidth(), 12,gutter,LABEL_RIGHT)
    label.SetLayout 1,0,1,0
    SetGadgetSensitivity(label,SENSITIZE_MOUSE)
    SetGadgetFont label,font
    Next
    
    SetGadgetLayout( textarea, EDGE_ALIGNED, EDGE_ALIGNED, EDGE_ALIGNED, EDGE_ALIGNED )
    SetGadgetText( textarea, "A TextArea gadget. :-)~n~nOne line...~n...and then another!")
    ActivateGadget( textarea )
    For Local n:Int=0 To 300
    AddTextAreaText textarea,"Hello, how are you today?~n"
    Next
    
    ' Select the entire third (index: 2 [base-0]) line.
    SelectTextAreaText( textarea, 2, 1, TEXTAREA_LINES )
    
    
    ' Output the properties of the current text selection (should be 1, 1 as set above).
    Print "TextAreaCursor(): " + TextAreaCursor( textarea, TEXTAREA_LINES )
    Print "TextAreaSelLen(): " + TextAreaSelLen( textarea, TEXTAREA_LINES )
    
    While WaitEvent()
    Print CurrentEvent.ToString()
    Select EventID()
    	Case EVENT_MOUSEDOWN
    		SetGadgetColor TGadget(EventSource()),0,0,255,1
    		SetGadgetColor TGadget(EventSource()),255,255,255,0
    	Case EVENT_WINDOWCLOSE
    		End
    	Case EVENT_APPTERMINATE
    		End
    End Select
    Wend

  4. what about setting the locations of the joints between the bodies... that's always been an issue determining if you have the joint/pin set in the location correctly... is there going to still be a visual aspect to this that lets us know where it is located at?

    I'm not dealing with that yet.

     

    as for the parent-child-parent thing - a simple example would be newton's cradle. Would making the ball the parent instead of the two opposing strings still allow for this to work correctly? but then it gets to being a matter of making the stands that the strings are attached to separate pieces instead of one to allow for the parent-child relationship, i guess...

    The way I would do it is make the frame the parent, then make the balls children, connected with one hinge each. Using two ball joints would not be anything close to an approximation of a string, because a string only exerts a force if the distance between two bodies goes beyond some distance. A ball joint will actually push connected bodies away if they are too close together.

  5. True, but I think at that point you are getting into more advanced AI that can't be easily automated. You might have a few waypoints set up throughout the scene the enemies know to go to, and then just use the pathfinding to steer them around. There's a lot of ways to make them behave, which makes it a lot of fun to work with.

  6. I was wondering...is it possible to set the pathfollowing different per entity? In the vid, all the enemies follow the same path, so is it possible to have them follow different paths individually, and if so, is it hard to do? Does it require new code to make it happen?

    Normally your enemies would be scattered around the scene and attacking you from different angles. One technique in Left 4 Dead is to run into an area, shoot a few zombies, then retreat so they all come running at you from one direction, and are easier to shoot. So I'm not sure that behavior is a bad thing.

  7. The control widget always shows for each entity in perspective view, including brushes. The control widget shows in orthographic views for all entities except brushes. It sounds a little weird when I describe it, but it's pretty simple and intuitive to use.

     

    I'm planning to implement icons for some entity types like lights, emitters, etc.

     

    All the properties you see are built into the editor, and appear based on what's selected. You don't need a script for control of the basic stuff.

×
×
  • Create New...