Rick Posted December 6, 2009 Share Posted December 6, 2009 Could we get a 2D drawing function that gets called automatically from the engine/editor? This should be pretty easy to do I would think. It's just like Update(), but this would be right before the Flip() method. It would work just like the other functions in that if it doesn't exist for an object it just doesn't get called. This would allow us to make 2D objects that people could plug-n-play via the editor that would provide huds and gui controls. I think this would go well with the new single state model as other objects would probably require data and feed data to these. I know a possible solution currently would be to do something like billboards but it would be nice to have this option also. Quote Link to comment Share on other sites More sharing options...
Niosop Posted December 6, 2009 Share Posted December 6, 2009 +1 Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 6, 2009 Share Posted December 6, 2009 idem dito Quote Link to comment Share on other sites More sharing options...
Rick Posted December 13, 2009 Author Share Posted December 13, 2009 Since some changes are happening with single lua state could this be added? This could really open some doors for HUDS. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 13, 2009 Share Posted December 13, 2009 getting close to having something like this right now... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted December 13, 2009 Share Posted December 13, 2009 I agree. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Unter Posted December 13, 2009 Share Posted December 13, 2009 I too consider that Lua it is possible to make anything you like. But if Lua it is integrated for users not the programmers that such things as HUD, the scenes manager and other base functions are characteristic for all games It is necessary to integrate in Lua, instead of to write them in the form of a script. I understand that Josh all it will not make one, but all I hope that such possibility will appear. I apologise for bad English, thanks. Quote characters artist animator environment artist vehicles artist vehicles script writer Participated in ready game projects: Russian http://4x4game.ru/ English http://www.1cpublishing.eu/game/4x4-hummer/overview Link to comment Share on other sites More sharing options...
Rick Posted December 13, 2009 Author Share Posted December 13, 2009 getting close to having something like this right now... Yeah but from your posts you are making this in the fpscontroller script because currently that's the only way you can draw 2D. The switch should be able to handle that all inclusively. I think that would mean that in it's Update() is has it's own picking instead of being just one picking in the main loop so not sure if that would kill performance if enough entities did their own picking inside their Update(). If it does kill performance, then per entity stuff like this could be a pain and not really drop and drag and use. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 13, 2009 Share Posted December 13, 2009 The switch should be able to handle that all inclusively. So true. Another thing that would be great to use this with is placeable Volume lights. This way you can place several billboars on screen creating volume light and you have more controll over it. on 3:30 in this movie you see how this works. You have to freeze there though because it goes really fast. Quote Link to comment Share on other sites More sharing options...
Rick Posted December 13, 2009 Author Share Posted December 13, 2009 I thought billboards render with the 3D stuff though? If so, you might be able to do that right now? Quote Link to comment Share on other sites More sharing options...
TylerH Posted December 13, 2009 Share Posted December 13, 2009 This is exactly what you would use a hook system for... Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
macklebee Posted December 13, 2009 Share Posted December 13, 2009 Yeah but from your posts you are making this in the fpscontroller script because currently that's the only way you can draw 2D. The switch should be able to handle that all inclusively. well right now it handles the setting the selectable variable that decides if its going to be shown as well as loading the texture to be used... the fpscontroller script just handles the pick and the drawing... offhand i don't know how useful having a 2d image constantly shown on my screen would be when i am editing a map? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 13, 2009 Share Posted December 13, 2009 getting close to having something like this right now... Macklebee: Are you able to show the hand icon just on the switch only? I've been strugling with that for a week. I manage to show the image with raycast but I can't make it so, that it only appears on specified objects (like just the switch.) Rick: I tried to make a simple flat plane with a texture and alpha on it, but the effects really ugly. When you stand in the volume ligt you are sort of in the plane and you will see the the edge of the plane going through your screen. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 13, 2009 Share Posted December 13, 2009 Macklebee: Are you able to show the hand icon just on the switch only? I've been strugling with that for a week. I manage to show the image with raycast but I can't make it so, that it only appears on specified objects (like just the switch. i have only been messing with it since last night really but thats where i am stuck at the moment... once i have that same key on another model its just looks at the first model that it comes across with that key and goes no further... so at the moment this key/value is particular to this model... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Rick Posted December 13, 2009 Author Share Posted December 13, 2009 well right now it handles the setting the selectable variable that decides if its going to be shown as well as loading the texture to be used... the fpscontroller script just handles the pick and the drawing... offhand i don't know how useful having a 2d image constantly shown on my screen would be when i am editing a map? I agree which is why I created a way to tell if I'm running in the editor or from the game script. This would probably be helpful if Josh included something like this by default. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 13, 2009 Share Posted December 13, 2009 i have only been messing with it since last night really but thats where i am stuck at the moment... once i have that same key on another model its just looks at the first model that it comes across with that key and goes no further... so at the moment this key/value is particular to this model... The problem is (I think) that the key doesn't refresh as it is in the loop. I build a menu to check if you want an icon to appear. however when you set a key, you don't check wether the value in the menu is true or false. I used this approach (with a lot of help from Rick). switch.lua : fpscontroller.lua: --check hand icon pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then -- show hand icon if (GetEntityKey(pick.entity,"showhand","yes")==true) then handIcon = true end else handIcon = false end But it's not working correctly. Sometimes it works but not always. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 13, 2009 Share Posted December 13, 2009 yes, i have a selectable boolean property as well inside the switch to determine whether to show it or not... also i am doing the loading of the texture with the switch so its loaded with the model and I am also doing a entitydistance check as well in the fpscontroller script. what i have right now is very consistent with one model type... meaning i can have several instances of the same model and it works just fine, but add the same key to a different model and it fails to work for both models... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 13, 2009 Share Posted December 13, 2009 yes, i have a selectable boolean property as well inside the switch to determine whether to show it or not... also i am doing the loading of the texture with the switch so its loaded with the model and I am also doing a entitydistance check as well in the fpscontroller script. what i have right now is very consistent with one model type... meaning i can have several instances of the same model and it works just fine, but add the same key to a different model and it fails to work for both models... can you show what you have? I'm interested in how much it differs from what I have. perhaps this way I can find something that solves the problem. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 13, 2009 Share Posted December 13, 2009 can you show what you have? I'm interested in how much it differs from what I have. perhaps this way I can find something that solves the problem. yes lets do it over a pm so we don't fill up a post with our conversation... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.