botanist
Members-
Posts
613 -
Joined
-
Last visited
Everything posted by botanist
-
The SA:MP forums had a coder called Y_Less (Previously a programmer of SA:MP too) which made an amazing tutorial on improving Pawn code. Now, Lua is way more flexible so a lot of that tutorial does not count for Lua. But maybe there's something like that about Lua too? http://forum.sa-mp.com/showthread.php?t=57018 Also, I know the official Lua website ofcourse. But that website is a lot of times unclear for me. They sometimes use words I don't recognize. Or they use words like "chunk". First tell me what a chunk is, then use the word. Not elsewise.
-
Maybe a nice idea to add a tutorials subforum in the scripting forum. Many people will only read the MTA forums for scripting, and not the Wiki. Also, the Wiki is slightly less common to create tutorials on, and is less easy to use than the forums. So I think a tutorials subforum would be very useful.
-
They're beginner tutorials. If you've read them yourself, you'd know that. And, even, the third link uses a lot of inefficient code.
-
Resolution has nothing to do with shadows
-
Since I've learned almost everything about "general" coding, and LUA is still my favorite and most used language, I would like to know the utmost from LUA. I recently found out myself what unpack() does, but I want to know much more in less time. I only know this function now since I had no other efficient way to achieve what I wanted. I hope someone knows some great references for me, about every native LUA function with explanation, and how to get the best speed of my code. Tnx in advance
-
As earlier said: They're on a good way now, but there still needs to be done a lot. So, watch the roadmap which I posted in my previous link, and watch the google code page for every update.
-
Objects do not have shadows at all. The lightning they have, is done in 3DSMax with Pre-Lighting. The shadow you see there is generated by ENBSeries. And of the car: that one is actually dynamic indeed, so that one should change with a new DFF if I'm not wrong. But vehicles have also shadows embedded as Diego says. These shadows aren't reflected on the road, or they're used to reflect on the road. Not sure. What I do know, is that the shadow sort of smoothens the polys of your car. You get THIS effect if you scale the model, but not the shadowmodel.
-
Thnx I'm busy with the save/load/import functions now. I'll do reset later, since I need ALOT of config for that. But those save/load/import functions should be done tomorrow. The GUI of them has almost finished, and the creating script too. So, tomorrow is gonna be a great day
-
Sure, here it is. Notice the help button and the top of the GUI
-
Read my other replies: So, I'm just using setElementData now
-
Already did that.
-
No, they aren't implemented. Otherwise you could just download the latest nightly to have them I've got a custom build, from the handling branch. The handling branch isn't included in any of the nightlies, like every branch is. And tell me when you do have time, maybe we can arrange something that fits you EDIT: Update on the utilities bar: Main script is complete! It's working like Windows does! Can't get script it better and smaller too, so no improvement needed. Maybe I merge the scriptfiles into other existing ones to avoid messy code, but that's not needed now at all. Gonna script the click handlers now. I'll let you know when that's completed. EDIT2: I've mistaken. The itemselection needs a lot of cleanup. And I think that's gonna be the most annoying one from the whole editor. Damnit!
-
You might want to test this with a custom build of MTA, which I can link if you want. That has already the full functionality of the handlingfunctions, except for some little things. I would appreciate every tester And a little update on the new layout and utilities bar: Every menubutton is working again, I only need to fill the help and test menu. They're still empty And about the utilities bar, this is going very well! I though this will need several days, but in fact, I'm almost finished. There are 2 big things to do: Hover effects, and correct click handlers. After that, I'll script the stuff that needs to be inside the click handlers. But let's get them working first After that, the non-GUI part starts finally. I'll add the save&load functionality then! I'm getting closer and closer to a stable V2.0 resource!
-
Because button 1 is just slightly different than button 2. So, if-elseif will create a mess in my code. I just need to know which group is clicked to get maximum functionality. Example: Here's your script SolidSnake: addEventHandler("onClientGUIClick",getRootElement(), function () if (source == button1) then DoSomething ( 1 ) -- Yes, this can litterally contain 1, or something else that's predefined. elseif (source == button2) then DoSomething ( 2 ) -- Almost the same, only the argument has changed! end end ) Imagine I want a new button. I need to create it, add a new elseif, and a third DoSomething. Now to the grouped script. addEventHandler("onClientGUIClick",getRootElement(), function () if (source == group1) then for k,v in ipairs ( button ) do if source == button[k] then DoSomething ( buttonValue[k] ) end -- that's all to check as much buttons as I want. end end end ) That's all the code I need then. If I want to add a new button, I'll just have to create on new button, and add a value for it. So easy is that. But I can't use that technique without grouping..
-
Client. As most of my scripts. I'm trying to avoid every serverside thing as much as possible
-
How do people do this? I'm doing this, but that doesn't work. key1 = "a" key2 = "b" function whenResourceStarts ( ) bindKey ( key1, "down", onKey ) bindKey ( key2, "down", onKey ) end function onKey ( key ) if key == key1 and getKeyState ( key2 ) ~= "down" then return elseif key == key2 and getKeyState ( key1 ) ~= "down" then return end -- If the above is passed, go on, but it won't for some reason end
-
Since all 4 (in the example) are buttons, and need to be handled separately. Otherwise I will need a lot of sh*tty code, or the eventHandler will be called twice for one button. I could use setElementData, but that's slower afaik. Or will thise cause no problem, if setElementData is done once for all buttons?
-
Yes, it is. In fact, I just wanted to announce a little update Thnx That sounds like a really good idea. I could make some adminpanel for such things, which might be added to later versions. Afaik XML files can only be saved serverside. Never worked with clientside XML files, so cmiiaw. But, if it's possible, I'm not sure if I will save the XML's clientside. It's easier for admins to manage handlings if they're stored serverside. Well, now my little update. I've done some more code cleanup, and more and more is going to work. CenterOfMass seems to work now, so only the animgroups needs to be added now. Also, I did some changes to the GUI itself. I've removed the 4 little Save/Load/Import/Reset buttons, and replaced them with a help button. At the top of the GUI, you will see some windows-like buttons. File, Options, View and such things. A list: Stuff in the file menu: New Handling [Thus, will reset your current handling] Open [Open a saved handling] Import [import a handling.cfg line] Export [Export the current config to a handling.cfg line] Save [save the current handling config to your folder] Close [Close the window] [*]View [Will show you some GUIs and menus to enable or disable [*]Options [Will let you choose your current template, language, and more] Ofcourse such a menu is harder to create than a few buttons, but I've got the time. MTA 1.1 will not be out that soon
-
That's gonna be around 20-30 eventHandlers then. No, that's not code improvement at all O_O
-
Very good chance that that's the problem. But, just tried onClientClick and even that doesn't get triggered. Tried that too, negative result. And tried "gui-button", which is a valid gui-element, too.
-
Hi, i've tried to give buttons their own parent, but this doesnt seem to work. Atleast, not what I'm doing. Imagine I have 4 buttons, 2 menu buttons, and 2 others. I want to use them in the same GUI-window, but in another eventHandler. function whenResourceStart ( ) window = guiCreateWindow ( blahblah ) button1 = guiCreateButton ( blahblah, window ) button2 = guiCreateButton ( blahblah, window ) button3 = guiCreateButton ( blahblah, window ) button4 = guiCreateButton ( blahblah, window ) -- So I've create a window with 4 buttons. -- Now I'll give them their own parent. parent1 = createElement ( "parent1" ) -- First parent parent2 = createElement ( "parent2" ) -- Second parent setElementParent ( button1, parent1 ) setElementParent ( button2, parent1 ) setElementParent ( button3, parent2 ) setElementParent ( button4, parent2 ) -- Seems to be good, but, those eventHandlers won't work. addEventHandler ( "onClientGUIClick", parent1, onClickParent1 ) addEventHandler ( "onClientGUIClick", parent2, onClickParent2 ) -- And that's weird, because addEventHandler ( "onClientGUIClick", window, onClickParent1 ) will work! end
-
That's so perfectly neat. How did you made it? It's fantastic!
