Jump to content

Tails

Members
  • Posts

    740
  • Joined

  • Days Won

    16

Everything posted by Tails

  1. @CodyJ(L) I tested the editor out yesterday and I know it's just alpha but I had a hard time understanding the UI and the controls. First thing I noticed when I opened up the editor was the UI. The UI is really small on 1080p and the menu's are also way too small. Second, it took me a while to figure out how to toggle the mouse and camera mode, almost up to the point where it irritated me. I expected it to be in camera mode right off the bat. Neither mouse or camera mode were toggled. When I was finally in camera mode, I could barely move my camera around because it's set to really slow by default. Also the camera overall behaved a bit strange imo. Finally, I decided I would place some objects, so I looked for the object list. Again, the UI is small and the lists are really tiny so it's hard to navigate in. I tried selecting and double clicking the items in the list but nothing would happen. At this point I had no idea what to do.I tried for a few more minutes but I just couldn't figure out how to place objects. When the beta gets released I will give it another try. Hopefully things will be better then. Good luck!
  2. Looking really good so far. Is there going to be custom binds?
  3. Are you supplying the video file through the resource meta? if so, you don't have to worry about it. the resource will only start once the download has finished. Otherwise if the browser is not a local browser then there's no way to know if something has finished downloading.
  4. @sanyisasha, check out bakagaijin: http://anirudh.katoch.me/project/bakagaijin/ I think this is as close you will get to interacting with other scripts in an object oriented way. I've used it before in one of my projects and it worked pretty well.
  5. This is no place for a beggar like yourself. I advice you to look somewhere else.
  6. Very nice Loki! Hopefully this will help out everyone who needs help setting this whole thing up. It's not an easy thing to do if you're completely new to all of this.
  7. You need to make a separate LOD object for every object. https://wiki.multitheftauto.com/wiki/SetLowLODElement Here's an example: local obj = createObject(id, x, y, z, rx, ry, rz) local lodObj = createObject(id, x, y, z, rx, ry, rz, true) setLowLODElement(obj, lodObj) engineSetModelLODDistance(id, 300)
  8. Use https://wiki.multitheftauto.com/wiki/OnClientGUIChanged it will trigger whenever someone is typing in an editbox. If you want to constantly check if someone is typing then use the focus and blur events like MIKI suggested.
  9. When a client triggers a server event a hidden variable called 'client' is passed in the event. triggerServerEvent("blabla", bla) -- server addEvent('blabla', true) addEventHandler('blabla', resourceRoot, function(bla) print(bla, getPlayerName(client)) end)
  10. @SSKE The scrollbar is part of the gridlist, it shows up when there are more items than can be shown.
  11. http://static.cegui.org.uk/static/WindowsLookProperties.html#ForceVertScrollbar guiSetProperty(gridlist, 'ForceVertScrollbar', 'False') I think that should do it.
  12. You can use render targets perfectly fine. They aren't rendered to the screen they are rendered to a new texture at run time. The image is the only thing that's being drawn to the screen. So, you could have a 100 draw functions and render it to a single texture and only draw that texture to the screen with dxDrawImage. The reason your text became blurry with render targets is because you were either stretching the image or the positions/dimensions were off. Take this simple object oriented approach and you'll have an easy to use function. It works similar to the CEGUI functions except that you're responsible for drawing it, although you could make the function handle that as well. function dxCreateFramedText(text, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) local self = {} local rt = dxCreateRenderTarget(width, height, true) self.draw = function(x, y, w, h) dxDrawImage(left, top, width, height, rt) end self.update = function() dxSetRenderTarget(rt, true) dxDrawText(text, 1, 1, width + 1, height + 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, 1, -1, width + 1, height - 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, -1, 1, width - 1, height + 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, 1, 1, width - 1, height - 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, 0, 0, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) dxSetRenderTarget() end self.setText = function(v) text = v self.update() end self.setColor = function(v) color = v self.update() end self.update() return self end local msg1 = dxCreateFramedText("Hello there",222,300,520,140,tocolor(0,255,0),3,'default','left','top',false,false,false) local msg2 = dxCreateFramedText("How are you?",222,400,520,140,tocolor(0,255,0),3,'default','left','top',false,false,false) addEventHandler('onClientRender', root, function() msg1.draw() msg2.draw() end) msg2.setColor(tocolor(0,255,255)) addCommandHandler('c', function() msg1.setColor(tocolor(255,99,0)) end) It may look a little over the top but yeah, it works, and it's fast.
  13. You can pre-render everything with a render target and then draw it with a single dxDrawImage An example: local text = dxCreateRenderTarget(width, height, true) dxSetRenderTarget(text, true) dxDrawText ( message , left + 1 , top + 1 , width + 1 , height + 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left + 1 , top - 1 , width + 1 , height - 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left - 1 , top + 1 , width - 1 , height + 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left - 1 , top - 1 , width - 1 , height - 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left , top, width, height, color , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxSetRenderTarget() addEventHandler('onClientRender', root, function() dxDrawImage(left, top, width, height, text) end) It should be pretty easy to understand. If you need help putting it in an easy to use function let me know.
  14. You can set the alpha property with setProperty: local edit = GuiEdit(200, 200, 200, 30, '', false) edit:setProperty('Alpha', 0.5)
  15. Use this https://wiki.multitheftauto.com/wiki/GuiEditSetCaretIndex with onClientKey
  16. You can make a function on the client side and trigger it using a custom event. Then you trigger another event on the server that receives the ground position. An example: -- client side addEvent('getGroundPos', true) addEventHandler('getGroundPos', resourceRoot, function(x, y, z) triggerServerEvent('onGetGroundPos', resourceRoot, getGroundPosition(x, y, z)) end) -- server side addEvent('onGetGroundPos', true) addEventHandler('onGetGroundPos', resourceRoot, function(groundPos) print(groundPos) -- continue your function here end) The only bad thing about this is that you always need a player nearby to get the ground position but there's no other way around it as far as I know. You may also need an additional check to make sure the server event is only triggered once, if you have multiple players on your server then it gets triggered by every player.
  17. @Randesady I know you fixed it already but your example works if you remove the return false statement and the return true in the else block. When you return something within a loop you'll also break the loop so that's why it never goes past the 1st iteration.
  18. Better optimization. I've tested your script, did the button performance test. 30 fps. Now, realistically you wouldn't really have 1k buttons but I did check overall performance, and it's just not that great imo. I found that it takes up quite a bit of resources and especially on older computers with lower end gpu's it has negative performance impact. Seems that your code is doing lots of calculations each frame when it doesn't have to. You can overcome some of this by using render targets and eliminate any unnecessary calculations by only updating it when a change occurs, like a mouse enter/leave, click, etc. Render targets are great for this, however, real optimizations would still need to be done. Secondly, why didn't you make it object-oriented? That would certainly make your code a lot shorter, more structured and a lot more manageable than it is right now. Especially with inheritance you could probably cut down your code up to 1/3 of what it is now. I can give you a hand in that if you like. Anyway, keep up the work, you certainly have one of the most complete frameworks out there which I applaud you for that.
  19. Probably what you need https://wiki.multitheftauto.com/wiki/ToggleVehicleRespawn
  20. Tails

    vehicle limit

    Do you have multiple colshapes? Instead of root use co4 as the root. addEventHandler("onColShapeHit", co4, checkVehicles) also, you may want to make sure it's a vehicle that's hitting the colshape: if (getElementType(theElement) == "vehicle") then
  21. Tails

    vehicle limit

    I don't see anything that teleports all vehicles to one point, however, you are looping through all vehicles, which is weird considering you're only trying to move one vehicle. Get rid of the loop.
  22. Make it so the indicators stick to the edges of the screen when you face away from them. If you didn't add that already. I couldn't tell in the video.
  23. Set isLocal to false when you're loading the localhost This worked fine with my server local browser = guiCreateBrowser (0, 10, 500, 500, false, false, false) local theBrowser = guiGetBrowser (browser) function setURL() loadBrowserURL (source, "http://localhost:3000") end addEventHandler ("onClientBrowserCreated", theBrowser, setURL)
  24. Just change the address in loadBrowserURL
  25. Edited my post didn't read the comments in the code
×
×
  • Create New...