Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. There have been posts on threading before and they generally don't turn out very well. Not to discourage you but do some forum searches for threading and see what others have found. It might help.
  2. Rick

    flatten terrain

    SetTerrainHeight( terrain:TTerrain, x, y, height# ) seems odd to me. Why x & y? Wouldn't it be x & z? I'm picturing find all the x & z points in the terrain that the object would be placed on. Then maybe pick the "middle" point and set all the surrounding heights to that so they are all the same height?
  3. I'm wondering what commands I would look into for flattening terrain. I'm thinking in terms of say an RPG if I want to place a building on uneven terrain that I would be able to flatten the area around the building so it's level on the ground. Has anyone tried something like this?
  4. From my understanding there are no thread safe commands in LE. It's not a thread safe library currently.
  5. What's C++ about what you have so far? Looks like C to me. You don't seem to be using any C++ features yet. So you are trying to say that "Easy" is faster than C++ even though it's made from C++? Your macros are replaced by what you have them defined as. So it's not faster, it's the same.
  6. Rick

    textbox thingoid

    Here is the entire lua file. I also put in a little example of how you can get input. The drawing of the textbox is just the DrawRec(). I didn't put much time into making the textbox look better. You would also need to make text saved per instance and displaying it. This is just to get people thinking differently about GUI programming in lua. I just copy the light objects and rename them to TextBox. require("scripts/class") require("scripts/hooks") --- create the class local class=CreateClass(...) function class:InitDialog(grid) self.super:InitDialog(grid) group = grid:AddGroup("TextBox") group:AddProperty("location", PROPERTY_VEC2, "0,0", "Location") group:AddProperty("size", PROPERTY_VEC2, "100,50", "Size") end function Pi_TextBox_Flip() -- we want to find textboxes so we can check their properties and draw them according to their settings for k,v in pairs(objecttable) do if v.type ~= nil then if v.type == "textbox" then SetBlend(1) SetColor(v.color) --DrawText("Hello", 0, 100) DrawRect(v.location.x, v.location.y, v.size.x, v.size.y) SetColor(Vec4(1, 1, 1, 1)) SetBlend(0) end end end end function class:CreateObject(model) local object=self.super:CreateObject(model) object.model = model object.name = object.model:GetKey("name") object.type = "textbox" object.location = Vec2(0,0) object.size = Vec2(100, 50) object.color = Vec4(1, 0, 0, 1) -- Add the drawing hook AddHook("Flip", Pi_TextBox_Flip) function object:Free(model) -- Must be sure to remove the hook or it'll still draw RemoveHook("Flip", Pi_TextBox_Flip) self.super:Free() end function object:SetKey(key,value) if key == "location" then object.location = StringToVec2(value) elseif key == "size" then object.size = StringToVec2(value) else return self.super:SetKey(key,value) end return 1 end function object:GetKey(key,value) if key=="location" then return Vec2ToString(object.location) elseif key=="size" then return Vec2ToString(object.size) else return self.super:GetKey(key,value) end return value end function object:Initialize() --Notify(object.model:GetKey("name")) -- could store off all textbox objects here for k,v in pairs(objecttable) do if v.type ~= nil then if v.type == "textbox" then end end end end function object:Update() if GetGlobalString("mode") == "GAME_MODE" then if MouseHit(1) == 1 then if MouseX() > object.location.x and MouseX() < object.location.x + object.size.x and MouseY() > object.location.y and MouseY() < object.location.y + object.size.y then object.color = Vec4(0, 1, 0, 1) end end else end end end
  7. Remember that because it'll bite you many times most likely. You cannot scale physics bodies. Well, it'll let you, but it they won't work correctly. That's probably the part that's confusing.
  8. I like the VB++ lol http://thedailywtf.com/Articles/VB_0x2b__0x2b_.aspx
  9. Rick

    Animation Prototype

    I had something similar to this, but the crappy part was the animations weren't really setup correctly for it. As I'm sure you noticed with that model, which I have also, the attack animation isn't setup that create to be played with the lower half having the walking animation playing at the same time. Just looks unnatural.
  10. Whatever is easiest and fastest
  11. We just need a way to not have to have a graphics card. If we call a command that requires a graphics card then it should just bomb and be our fault. All the other commands should still work.
  12. I 4th the need for the ability to run a server with LE commands without graphics card, but with physics.
  13. We've decided to go RakNet since it's more established at this time.
  14. You could do everything in textures which would give you 2D. CreateTexture() & DrawImage() would give you everything you need for true 2D. Then for collisions you could just use bounding boxes.
  15. So I'm working on a textbox thingoid. You drag it into your scene and it creates a 2D textbox. You can control the location and size via the settings. Basically what this does is create a flip hook. My question is, the way I'm currently getting a given instance of the textbox from inside this hook is looping through the object table and checking a variable. I would prefer not to have to loop through the object table since I think it has every object in your scene, and was wondering if anyone can think of another way to do this. Ideally I would just be able to loop through just these object instances and not every object in the scene. I could probably create a global table, but was just curious if there is a way to loop through just certain models of like type? For example if I place 10 monstertruck models in my scene, would there be a table that I can loop through that just returns the monstertruck instances and not all the other models in my scene, and how could I get that into a hook function? If anything I'd like to just get some dialog going on it. Here is an example of what I'm talking about: function Pi_TextBox_Flip() -- we want to find textboxes so we can check their properties and draw them according to their settings -- ideally I would be able to just loop through the textbox objects and not every object in the scene for k,v in pairs(objecttable) do if v.type ~= nil then if v.type == "textbox" then SetBlend(1) SetColor(v.color) --DrawText("Hello", 0, 100) DrawRect(v.location.x, v.location.y, v.size.x, v.size.y) SetColor(Vec4(1, 1, 1, 1)) SetBlend(0) end end end end function class:CreateObject(model) local object=self.super:CreateObject(model) object.model = model object.name = object.model:GetKey("name") object.type = "textbox" object.location = Vec2(0,0) object.size = Vec2(100, 50) object.color = Vec4(1, 0, 0, 1) -- Add the drawing hook AddHook("Flip", Pi_TextBox_Flip) ... /code]
  16. Rick

    Lua and LE

    I think learning with the C++ tutorials is the best way to start. Really the lua objects in the editor are almost setup so that programmers can create objects for others to just drop and drag and use without knowing how to code. As you work with it more though you can see that it's almost like object oriented programming because you can build some cool logic objects that can be pretty reusable and generic enough that you can almost create a visual programming language with it.
  17. Niosop, thank you so much for the tutorial video. That was really helpful. I'm excited to test my new knowledge out!
  18. Rick

    Lua Error.

    This is why I think there should only be the editor. There should be a command line switch where you pass your key to turn it into the editor and when that switch is missing it acts as an engine. At least they will never have a chance to get out of sync then.
  19. I actually had a similar issue yesterday. I placed the viper model and ran the FPS game script and when I touched the viper model it went flying in one direction and I went flying in the other. It was very odd.
  20. Rick

    Lua Error.

    Seems to me the fw variable is getting freed to early in the engine.exe maybe?
  21. Rick

    Lua Error.

    Look in your atmosphere lua file and look for the word renderer. Where is it in there? I'm at work so I don't have the files but it might help point you in the right direction as to what's happening. Maybe in the Free method of the atmosphere something is incorrect?
  22. There is a reason why AAA games have a designer job. I think we need more designers around here. That's a full time job in itself. If designers came to this forum with all their ducks in a row, more game projects would be in progress or complete. Programmers and even artists don't make good game designers. All you end up with is great looking screenshots and a ton of cool random features. Designers create the vision. As a programmer I would be more willing to work on a project if the designer had their vision all documented on paper.
  23. The problem is that these are just screenshots. To take a screenshot to a functioning game is completely different. Don't get me wrong the screenshots look amazing but that's only 1 piece of the puzzle that needs to happen to make a game. A AAA game can easily have a few hundred thousand lines of code. That takes time and people to pull off on the coding side of things. That's the issue. It takes more than just good looks. That more than good looks just so happens to be the hard part about games. That's what makes a game a game instead of a screenshot.
  24. I find that this is almost always the case when you start trying to make reusable Thingoids though, like the character Thingoid Victor and I are working on. Especially when they are logical Thingoids. Having logical Thingoids is one of the coolest things about this whole lua implementation I think. It's object oriented programming at it's best. The plug and play ability of these is amazing, but the logical Thingoids still require a model in the editor which kind of stinks. It increases the load time since it has to load a dummy model which isn't used and does cause collision issues sometimes if you aren't careful. If you don't make anything a child of that dummy model you can hide it when you run in game mode which is a solution, but in his case if he makes the dummy model the parent and these other room models the children, if he hides the dummy model it'll hide all the rooms also. That's why I suggested just positioning them in the update method. Or I guess when in game mode he could unparent them and then hide it, then parent again when back in editor mode. You just wouldn't want that extra mesh and body hanging around when in game mode driving down your FPS if you have a ton of them. In this case it's only 1, but in my case where everything is a Thingoid, logic and all, you'll end up with a ton of them.
×
×
  • Create New...