-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
Shader is a helper in this case but then you don't need .txd but a .png or .dds https://wiki.multitheftauto.com/wiki/Shader_examples - check "shader_tex_names" and use it to get the name of the tshirt you want to replace (you probably know its original name from .txd so it will save you time) This is a simple shader which replaces in-game texture with your image file (eg .png, NOT .txd) texture gTexture; technique replace { pass P0 { Texture[0] = gTexture; } } All you need to script is: txd = dxCreateTexture( "your_texture.png" ); if not txd then txd = nil; -- it's best to nil a variable because it'll waste unnecessary memory return false; end shader = dxCreateShader( "shader_file.fx" ); -- the content of this file should be what I included above if not shader then destroyElement( txd ); txd = nil; return false; end dxSetShaderValue( shader, "gTexture", txd ); -- gTexture is inside the shader file which you want to set with your texture engineApplyShaderToWorldTexture( shader, "name_of_the_texture" ); -- this is the name of texture you want to replace eg. "tshirtwhite" If you want to replace another texture you will have to use the same code as above but with different names/filenames.
-
You either need to use relative size and position or use fixed position but get its new position for different resolution (using relative values). If you test this: local w,h = guiGetScreenSize( ); local x,y = 300, 100; local img = guiCreateStaticImage( x, y, w, h, "logo.png", false ); x, y = guiGetPosition( img, true ); outputChatBox( "Relative coords, x:" .. tostring( x ) .. "; y: " .. tostring( y ) ); You should be able to see its relative coords, then you can use them to display the element at the same position on different resolution.
-
https://wiki.multitheftauto.com/wiki/Res ... otemanager Check its wiki page. There are all the functions you'll need to know about. To call the functions you need to use exports table, like so: exports.votemanager:startPoll( ..... ) -- OR exports["votemanager"]:startPoll( ..... )
-
@qaisjp! I've started making a "visual scripting" sort of thing but that's for 3DS Max. It'd be easy to create custom maps and map specific scripts (starting from viewtopic.php?f=108&t=27406&start=75#p418455). GUI designer - I've thought of that too but with use of DirectX to make sure it displays the same as in MTA with custom themes support but that's far future.
-
So either you haven't opened a file from resource or it simply hasn't opened properly. I don't see any other reason. Can you tell me how to reproduce it? What you do step by step.
-
Does it say "File saved..." at the status bar?
-
https://wiki.multitheftauto.com/wiki/MTA ... _save_file
-
In that case, you can get children of your resource and then remove their data, will work if you're changing data of your resource's children (vehicles, objects, markers, etc. created with your resource). If you're changing player's data then you can set player's parent to your resource when they join your server. There are many options. It's up to you which one you pick.
-
This will only remove data that was set by the resource this code is in. Also, author keeps asking about root element. @DarkLink, you can use getElementChildren to get all the elements and then remove their data with removeElementData
-
Thanks for the reports. It seems like many users have sent the same report during the last couple of days. It seems like a serious issue. BTW, you can edit resources which haven't been created with MTA SE. There is a dropdown box where you can select which resource you want to edit. Once you open a file and change the resource, open another file and then switch to the previously opened file, the resource which the file belongs to will be reopened, so you always know which file from which resource you're editing.
-
Most of these ideas are either done or on to-do list. - When it becomes official, it will be included in the installer as agreed with one of the devs long time ago. - MTA:SE can start/restart resources with a button - just a single click, if I remember correctly it's bound to F10 key but I don't use it because I use a debug version which has this disabled since I use it in Visual Studio while debugging. - I have thought of adding some sort of admin panel where you can see chatbox and chat with players, use commands, etc. But that's for the future. - live syntax checker is already there - the bottom panel of the window shows any Lua errors you made in your script. - Breakpoints - like you said, it'd require modifying MTA code. I think it'd be possible to do with Lua "coroutines" (google it) but I don't think there is a good enough reason to change your script to use coroutines just for breakpoints (too much to code)
-
I'll look into it when I get a chance. It works fine for me even with the same resource name that you showed on the screen. Do you get this error after typing in the name or when you press some button? Also, have you sent the report?
-
Well, irrKlang was used because that was the same library used by MTA so I wanted to make sure the MTA will be able to play your files. Are you saying it crashed after typing some letters in resource name text box in the New resource window? It might be privileges, try running MTASE as administrator if you're on Vista or Win7.
-
Well, I don't know of any crashes since I've had it opened for 2 days and hasn't crashed once. I know it has crashed for others but if you have serious problems like not being able to use it then I'll need more information on how to reproduce the crash. It's harder without dump files. I started scripting again recently and the longer I use it the more ideas I get. No updates anytime soon. Looking for a new job, just moved house, etc. (mostly real life stuff)
-
Thanks for the comments. Forgot to mention there is a command to show/hide the drift meter: /showdriftmeter for those who don't want to see it.
-
Tested? Why don't you try and see? The best way to learn is to try. People learn by trial and error. "Learning doesn't happen from failure itself but rather from analyzing the failure, making a change, and then trying again."
-
To everyone saying "generate lua code", for camera animations the code would be longer then it's needed. I suggest to export the animation path data to a file and export a function so that you can just load a file and play the animation instead. Would make scripts cleaner and smaller in size. Nice looking tool ZenoS, I have thought of creating camera resource with many features eg. creating a path/curve so camera can follow it.
-
It is normal as this is a bug because I didn't do any check if the vehicle is travelling in reverse. Will fix it. You can try the map I tested the script with "race-drift" and I hope someone will make more drift maps.. Thanks for the comments guys and your report Roma.
-
I could export some functions to let you check if vehicle is drifting, like isVehicleDrifting but MTA doesn't have a native function for it. NOS can't be controlled by default but the way I did it was to remove NOS from vehicle to stop it and add it when player presses and holds the button. Follow the links that Solidsnake posted or check your server resources because my race_nos resource comes with MTA installer.
-
Hi there, I've been messing with maths and created some vector classes but then I wanted to use them somewhere so I decided to create a drift resource where there is some maths involved. So here it is: Download: https://community.multitheftauto.com/index.php?p= ... ls&id=5078
-
Something like this? I made it couple of days ago. I will release it tomorrow.
-
You don't have to do it on every frame. Just disable collision after creating the object.
-
Stop this nowhere-leading conversation already. Topic says, "save visual damage vehicle".. It says it all. If you want to talk about whether you want to save the health or not, PM yourselves. Besides, door doesn't always fall off, as far as I know if the car is locked you can keep hitting the doors and they won't fall off; the car will start burning.
-
Try to fix the script first (my post above, 1-3) and ignore my last point for the time being. Once you get it shooting, test it with somebody to see it it's synced. It might be synced.
-
No problem. Keep it up. I get to like maths more and more everyday, even though I've always like it.