Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. Rick

    flip hook

    Right, but I assume it actually runs the hooks I have defined, yet in the example I don't see it being called anywhere. [EDIT] I guess it doesn't need to be. Worked without calling RunHooks() myself.
  2. Rick

    flip hook

    So what is RunHooks() all about? In the examples on there it's not being called anywhere I can see.
  3. Rick

    flip hook

    Say I want to have one of my object functions draw text onto the screen. What's the usage of the flip hook?
  4. Rick

    Future Ideas

    If it's the same speed I would rather use the DB because then you don't have to define grids and what objects belong to what grid. Just add objects and their position & rotation to the table and you're done. Much easier than having to grid stuff out.
  5. I also agree that if the issue is partly to help programmers get a more consistent color, as a programmer I would most likely fail at making a color palette that is worth anything. I would be interested in seeing the results of something like this though.
  6. Rick

    Future Ideas

    Your grid structure would be a database table. Every object would need to be stored inside a table that has an X and Z column. These 2 columns would be indexed for fast searching. You know the player position, so that would be used as one point. In your where clause you run the pathogram theorem to get the distance between your player X & Z and the columns X & Z and check it for < a certain range. This will return all objects that are within that range and need to be shown. I would think this would be faster than looping through a million objects and seeing the distance on each one. Because of the indexing this should be faster, BUT I would think this would work best on static objects only.
  7. This would be interesting. The ability to save off multiple objects combined as a prefab. I wonder if there would be any way for the community to do this vs Josh doing it in the editor code. Maybe we could have a prefab object. You set the targets of the prefab to all the other objects you want combined together. Then in the settings of the prefab you could have something that saves a new object out there. For this to happen we would need the ability to create an object from lua code. I'm not sure if we have that ability.
  8. Rick

    Keys

    That works for the letters, so I suppose I'll have to manually do all the other keys though? Arrows, Home, Insert, etc
  9. Rick

    camera angles

    Actually the more I think about this the more this doesn't seem like it'll work. If the player pivot is the parent to the camera, and the camera is offset behind and up from the player pivot, the player pivot could stop at 90 degress but that doesn't mean the camera is directly above the pivot because of the offset. So I have to be able to take into account the starting position of the camera somewhere to figure out how much the player pivot can go before the camera is directly above/below the player pivot. Maybe I need to get the rotation of the camera pivot, since it's parented to the player pivot, and when the player pivot rotates the camera pivot should rotate with it, and if that's 90 deg I can stop the player pivot from rotating.
  10. Rick

    camera angles

    Oh I think I see now. Since I have a pivot at the player location and the camera is parented to that, I can limit the pivot rotation instead of trying to limit the camera rotation. Since if I stop the pivot, the camera will stop with it. I was trying to limit the camera instead of the pivot. I'll give that a try tonight.
  11. Rick

    camera angles

    Is there anyway you could post the fpscontroller.lua file here? I don't have access to it from where I am and I'd love to take a look at the code. I'm also thinking that might be different since the fps camera is rotating around itself, where the 3rd person camera is rotating around an different point.
  12. It's right under the LE directory that you installed. The thing to remember is that all the languages you can use with LE can do everything LE provides. LUA is slower but allows for realtime editing where you can see the change you make instantly. C++ is faster but you have to go through a compiling step. So if you were using C++ to position something just perfectly, it would take you way longer to change code, recompile until you get it right. If you are using LUA it would all be instant and would take no time at all. The trade off is that when using lua, you might lose some frames per second depending on what you have lua doing. If it's running heavy logic it will slow your game down. You can, however, mix your C++ classes with lua so you can have C++ doing the heavy lifting so that part is faster. This would however take some experience and most likely drive you insane after some time
  13. I can't see the video from where I am, but did you try having a controller fall through it? I know in the editor a controller won't fall through the terrain but vehicles do.
  14. Yeah, holes in terrains open up the world design a ton. We can now have caves carved into mountains.
  15. Rick

    Keys

    Is there an easy way to get a text value of a key related to the number value of a key or do I need to brute force it manually like: keys["KEY_W"] = KEY_W keys["KEY_Q"] = KEY_Q ... I'm making a configurable object where the drop down of the setting will list every key in it. I then take the text value they selected and convert it to something that can be used in KeyDown()/KeyHit(). I can do this manually, but wasn't sure if there was some looping trick I might be able to do to make the code shorter.
  16. Rick

    camera angles

    So I'm having an issue with my camera angle on the Y axis. So I have my camera rotating around the target just fine. You can go all the way around it, but I need to restrict the camera so it only goes so far when you are looking from above and below. Generally in a 3rd person camera you can only look directly down and not past down, if that makes sense. I use just a number to restrict the y value, but that doesn't seem to always work. The starting point of the camera is defined by the user and can be anywhere from the target. The y value that needs to be set to restrict needs to be different depending on the starting place of the camera from the target. I was hoping there would be some sort of angle way to determine this restriction so it would work no matter what. When the camera is directly above the target object, the angle between the 2 points would be 0, and when it's directly below it would be 180. I'm just not sure how to do that.
  17. Rick

    Future Ideas

    I'm kind of digging Lumooja's idea about SQL db holding the information of object placement. This could actually be done right now by the community. A process could take an sbx file and parse it out to store the data in a SQLLite db. Then a new load process could read this db to make the scene.
  18. I just added 1/2 the controller height to the y position of the object. Since the object ends up being on the plane of the terrain this moves the controller up to the terrain level and it doesn't fall through anymore.
  19. It does, but I guess I was wondering if you could get it outside of that function. Kind of like how in .NET the Paint event passes you the graphics objects, but if you wanted the graphics object outside of the paint event there is another way of getting it. I guess I could probably store off the grid as a class variable and set it from inside the InitDialog event. I'll give that a try. My thought process is to be able to modify the settings based on some objects placed in the scene.
  20. Look in Scripts/Games to see a fps lua example.
  21. Oh yeah that's right. Thanks. I'll just uncomment the "editor" mode setting the position and call it good. I can't comment on the outside of the editor. Haven't tried that yet.
  22. Also, pressing the reset physics puts my controller at the origin. *sigh*
  23. Now when I create a scene with a terrain and place the model the controller falls right through the terrain. What gives. The most frustrating thing about the new editor and lua is getting things to work the way you want in the editor vs when you run via game. So if you make that object if sits correctly where you place it? I assume you created this object then? What do your files that you created for this look like? I actually have to do "run game" once before it resets correctly and doesn't fall through. Maybe I'll try resyncing or something.
  24. So my "model" is a character object. I have it basically like a pivot. I only really care about the position because I place a controller at the position of the object in the editor. My issue is that the first time I run it it doesn't set the controller position correction. What am I missing? require("scripts/class") local class=CreateClass(...) function class:InitDialog(grid) self.super:InitDialog(grid) group = grid:AddGroup("Character") group:AddProperty("model", PROPERTY_FILE, "GMF Files (*.gmf):gmf", "", "Model Files") group:AddProperty("controller_height", PROPERTY_FLOAT, "Controller Height") group:AddProperty("controller_radius", PROPERTY_FLOAT, "Controller Radius") group:AddProperty("controller_step_height", PROPERTY_FLOAT, "Controller Step Height") group:AddProperty("controller_max_slope", PROPERTY_FLOAT, "Controller Max Slope") group:Expand(1) end function class:CreateObject(model) local object=self.super:CreateObject(model) object.model = model local height = tonumber(object:GetKey("controller_height", "1.8")) local radius = tonumber(object:GetKey("controller_radius", "0.4")) local step = tonumber(object:GetKey("controller_step_height", "0.5")) local slope = tonumber(object:GetKey("controller_max_slope", "45.0")) object.oneTime = false object.controller = CreateController(height, radius, step, slope) object.controller:SetMass(1.0) EntityType(object.controller, 1) object.controller:SetPosition(object.model:GetPosition()) function object:SetKey(key,value) --Notify(key.." "..value) if key=="model" then else return self.super:SetKey(key,value) end return 1 end function object:GetKey(key,value) if key=="" then else return self.super:GetKey(key,value) end return value end function object:Update() if GetGlobalString("mode") == "GAME_MODE" then if object.oneTime == false then Notify("inside") object.oneTime = true object.controller:SetPosition(object.model:GetPosition()) end else -- constantly update the controller to the model in scene --object.controller:SetPosition(object.model:GetPosition()) end end
  25. Bah. Thanks. I swear I didn't do that when programming in C++
×
×
  • Create New...