-
Posts
822 -
Joined
-
Last visited
-
Days Won
86
Everything posted by The_GTA
-
which key? which graphics?
-
I think that by "main editor" you mean the UI and the map editing logic. These are split between the editor_main and the editor_gui resources. Before editing any resources I recommend that you unzip them. You just have to create a folder with the same name in the same location as the .zip resource. Then the folder has a higher priority than the archived resource. To take a look at the world editing logic, you could open the "editor_main/client/main.lua" file. Inside of this file you can find the world clicking implementation. For anything related to the fancy UI of the editor search inside the "editor_gui" resource. I do not recommend editing the editor resource as a beginner in MTA development. You should first learn the basics of the Lua programming language, learn from good examples to get in touch with best practices and work your way up in programming skill. Advanced resources like the MTA editor tend to pack in a lot of complexity in as few lines of code by making use of advanced software models (class systems, Lua file modularity, shared functions, etc). The only recommendable thing for you is to get inspired, in a light way, by things possible but done in your own way.
-
You're welcome! A wise man has told me that there are no stupid questions. Believe in yourself. The MTA editor is solely a map editor, not a script editor. Thus you should create a companion resource for your map. The (probably) smartest way to do that is to make use of the mapmanager events for map loading and unloading detection. You could of course put the scripts into the same resource as the map file itself. But splitting away the scripts from the map allows you to use the same scripts for multiple maps! I think you might find the documentation of the meta.xml file interesting. This file describes the layout of the to-be-loaded resource to the MTA server and is located in the root directory of every resource. You have to get used to writing these by hand if you want to start MTA development. ?
-
Hello rikicecchi, I think you are looking for the npchlc_traffic and npchlc_traffic_editor resources. They were created by @Reyomin, previously known as CrystalMV, a highly reputable member inside of our MTA community. You can see the node editor in action in this video: There does not appear to be any documentation on the MTA wiki regarding this resource. You should try following the regular MTA wiki editor plugins documentation for getting the traffic plugin to work. If you are facing any difficulty, feel free to ask!
-
The issue does not seem to originate from the code you provide. Please respond to my other two points.
-
Hello BraFaz, I recommend you to use a second computer, either in the form of a virtual machine or a laptop, as another concurrent client for MTA testing. The old GTA SA game was not made to be running twice on the same Windows OS. I am not sure whether there are workarounds on Linux but I won't go into that topic.
-
If you are adding an event handler for a button, please either check that the event source is exactly the GUI edit element or use propagate = false while setting the base-element for the addEventHandler to the GUI edit element.
-
Helo Grzanek, how about adding debug output using the outputDebugString function at the start of the registerAccount function? For example you could query for the parameters that were put into the function, like this: outputDebugString("login: " .. tostring(login) .. ", email: " .. tostring(email) .. ", ref: " .. tostring(reference)); have you tried inspecting the contents of your SQL database for any conflicting login information? I recommend you to use the NaviCat Lite software. I am not familiar with the query-construction of your SQL resource. Are you sure that you have properly implemented it using dbPrepareString?
-
Use the string.sub function with parameters 1 and 2 to get the first two letters of a string. Then you can compare the result with your own specified two letters.
-
Have you tried connecting to your server, logging in as admin and typing in "/debugscript 3"? This might give you more debug messages that you would otherwise miss. There are several potential errors in your script but you are not providing all the necessary details to analyze the problem. I am noticing a spelling mistake "querry" compared to "query" but I don't want to support this thread any further. I invite you to find somebody else to finish the resource(s) for you. ?
-
No, the problem has a different cause. Are you sure there is no other text inside the debug console?
-
float4 color = float4(0, 0, 0, 0); Your shader is not putting out anything (a completely translucent space of nothing). Are you sure you put in meaningful values inside of the shader? To me it looks like you put in garbage values in the hopes to receive any visible result! To be fair, I have no expertise in the kind of math that you provide in your shader example (picked from that Russian website). I would try setting the color to (1, 0, 0, 1) to specify complete red and then mess around with the other variables. Please follow any leads that you get from the creator of the shader.
- 13 replies
-
- shader
- shader hlsl
- (and 3 more)
-
Please do not create textures or shaders every onClientRender event call (put the shader creation outside of the drawing routine) Make sure you put dxDrawImage and related drawing functions inside of an onClientRender event handler (dxCreateTexture is not considered a drawing but a resource allocation function!) Have you put the .jpg file into your meta.xml file so it gets downloaded by connected clients?
- 13 replies
-
- shader
- shader hlsl
- (and 3 more)
-
Hello Grzanek, have you tried putting outputDebugString to find out what is going wrong in your code? It seems like you are not expecting an error condition.
-
Hello Mario222, have you taken a look at the documentation of the dxscoreboard resource? You need to assign a number to the "Points" element data key for each player so that it is displayed inside of the scoreboard. For example... setElementData( thePlayer, "Points", 42 ) Also, you need to have a gamemode started in order for the points to be visible in the scoreboard. There could be a logical error in the following line... addEventHandler('onGamemodeStart', g_ResRoot, Did you really mean to put g_ResRoot? Are you aware that you have to put the script into the same map resource? You could try using g_Root instead. (the documentation is vague so I could be wrong, please try for me to be sure)
- 1 reply
-
- 1
-
-
I am glad to have helped you! Come back to this forum if you have any further questions.
-
Why would you think so? The wiki page says the following: Do you read anywhere in the above text that the function does not work for you?
-
Well, he seems to have issues writing HLSL in general. @Krokara You are missing the { at the following construct... ... float4 PS_Electricity(float2 texCoord: TEXCOORD) : COLOR { // HERE float2 t = float2(speed * time_0_X * 0.5871 - vertNoise * abs(texCoord.y), speed * time_0_X); ...
- 13 replies
-
- shader
- shader hlsl
- (and 3 more)
-
You are passing too many parameters into the respawnVehicle function. What you are describing sounds like you want to use the fixVehicle function. It repairs the vehicle without changing the position of it.
-
You are asking questions that go beyond this Lua support forum. You are asking me whether you are typing correct HLSL syntax. The language documentation itself is very vague about what data types it does support and what the feature-set looks like for every version. Try looking at the error message and typing the shader correctly. You have left out the exact form of the error message but that does not matter much. Are you aware that we are working with Direct3D 9 version HLSL? You may be using syntax that is available in Direct3D 10+ HLSL.
- 13 replies
-
- shader
- shader hlsl
- (and 3 more)
-
Take a look at the following HLSL construct by you: sampler Noise = sampler_state { Texture = ; }; You seem to have forgotten to type the texture variable name and have left a blank instead. If you want to make use of a sampler, then I recommend you to feed the shader with an actual texture to sample from, like this: texture noiseTex; sampler Noise = sampler_state { Texture = noiseTex; }; Then you can assign a texture to the shader using the "noiseTex" shader variable (dxSetShaderValue function).
- 13 replies
-
- shader
- shader hlsl
- (and 3 more)
-
Could you show me your code? It is hard to judge if you give me nothing.
-
It looks like you can create "Normal GUI" with your "geditor" resource and then automatically convert it to dgs using a built-in dgs tool. I think that @xLive or @thisdp could assist you fully in this regard. There even are example commands on the wiki page. Would you mind trying it out?
-
If you are drawing rectangles on screen using dxDrawRectangle family of functions then there is no element for it. While a rectangle is visible on screen then you can check click coordinates inside of an onClientClick event handler that match the bounding box of the drawing rectangle. For each drawing rectangle you can then manually assign an on-click handler function. Most importantly, you have to do this all by hand.
-
Have you tried the onDgsMouseClick event? I don't see why you are mentioning DGS because you have not shown any code that is using DGS. If you have no experience in math or the layout logic in general then I recommend you to use pre-made systems like DGS. I heard of many people who use DGS and it appears to be really well documented. Otherwise, you would have to check quite some coordinates on every onClientClick event + make your own clickable regions registration. In your code above, to hide the DX UI you can simply do... panel = nil