Jump to content

RaceXtreme

Members
  • Posts

    99
  • Joined

  • Last visited

Everything posted by RaceXtreme

  1. thanks, I like this game (Sonic) Yeah! Me 2 I'm just thinking about make maps in Sonic's Style that's remind his own stages and extreme speed! At this point i'm making something similar with 'Game Land' from Sonic Colors with cubes flying in the sky, oh lovely stage... But i got stuck with modeling . I converted some models from the Wii game but it got stange with lighting and some disappear bug :0... Somehow i will fix this... *.*
  2. Just didnt understood a thing... return type(name)=="string" and string.gsub(name, "#%x%x%x%x%x%x", "") or name -- what is this? is like "if" structure? how this works in lua scripting? ... local _getPlayerName = getPlayerName -- this is a hook of getPlayerName? how this works? its to dosent call the costum function below? function getPlayerName(player) -- we can make a function with a native MTA one? Thanks in advance
  3. Yes! Omg... finaly! ^^ Great job guys... really great job... congratulations
  4. Yes, nobody will just work hard to make everything that you are imagining for free.
  5. And what should be the 4th element? ;D Cus the 1 to 3 is the position one ^^ + 1 * matrix[4][1] + 1 * matrix[4][2] + 1 * matrix[4][3]
  6. Hmmm, yea a BIT dificult ;P I think that this is verry used in the 3DS max. Do you have a idea how a loopgenerator works? I notice that it use a lot of trigonometric stuff. In the MTA Looop generator i just understood the angle calculation: angle = ((360/pieces)* newpi) -- oh i made something like that in a script file and it made a exactly 360 rotation with 30 objects. Awsome... ;P >But what about the position? I know that we use the x,y,z values, use the offset and radius. i know what everything means and how they will work, but noo idea how to make a calculation with positions, mainly ;P I will try to make a draw and after show you what i got ;D
  7. Hmmm, got the idea. Thx too much (: Oh, i relember now... do you know something about matrix? It hard to get a idea how it works? off: if im asking to much... say it for me!!
  8. Off: One, two, three, four ... days and no post. Wow my topic got old fast! It means that there are a lot of guys scripting in MTA... oh nice thing... (: --- Hmmm.... Oh... i got understood, you just reduce the calculation... ;D Hmm, but in with situation this resource will be needed? Cus is much easier to work with the 2D values in a lot of situations ;D
  9. Off: Oh NeXTreme i relember you from FFS Racing Server, brother (if im not wrong, of course ) -- A lot thx guys, now i just got the idea that i didnt get a long time ago ( I was trying to see how this 90 degree triangle works on a game ) Huum, now just some another questions The squareroot works like (x)^0.5 because 0.5 is the half of the whole number? Hmm, to calculate the distance between points 3D we use: distance=( (x1-x2)^2 + (y1-y2)^2 + (z1+z2) )^0.5 ) -- but the 3º element is what in the Pythagoras theorem? ( a²+b²+c² ) -- Its the "a" one? ( x = a²+b²+c² ) and what is this x? About NeXTreme said, "A good example of using these functions is in a loop generator". I opend the code and get a doubt: -- its correct my analysis? newx = orx + radi*math.sin(radians)*math.cos(rota)+(offset/2)*math.cos(radians/(2*loops))*-math.sin(rota) --newx = is the sum of the original x with the calculation of one side of a 90 degree triangle? (; Thanks in advance (:
  10. Oh sorry, i didnt read carefuly x) Ok ok ^^ Lets see the 2nd expression: distance=( (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2 ) ^ 0.5 --^0.5 works same as squareroot, and if its 2D, not 3D, remove the Z1 & Z2 part > ook lets make an exemple... We want to get the distance between 2 points 2D, where the 1st one is a cube object thats is x1=20,y1=60 and the 2nd one is x2=50,y2=10. distance=( (x1-x2)^2 + (y1-y2)^2 ) -- this i understood (x1-x2 > thats get the distance between those 2 objets) but the "^2" i didnt. Why we use the squareroot if we already get the this distance between those 2 objects? (: distance=( (20-50)^2 + (60-10)^2 ) -- lets test it : D distance=( (-30)^2 + (50)^2 ) distance=( (-30)*(-30) + (50)*(50) ) distance=( (900) + (2500) ) distance=( 3400 ) -- correct? (: >Now lets do it! 3400*0.5 = 1700! --Hmmm... 0,5 is to reduce this value... 0,5 is mainly for what? --1700 is the distance between those points... Its possible to see this distance is meters to make things easier like in map editor? Thx in advance
  11. Oh karlis, you tooo fast ;D So, where you found those expressions? You've learned in school? (:
  12. MTA is the best GTA multiplayer ever ( i play since MTA Race 0.5 ) Ok guys, idk why nowofresh wrote that in his post.... but anyway lets back to our sense (: About the frist math script... setElementPosition( theObj2,x1-(x2-x1),y1-(y2-y1),z1-(z2-z1) ) >to make the object mirror to another you use this mathematical expression "a1-(a2-a1)" where's a1 and a2 are the position values. > How did you tought in that expression? Its geometry default one? Or did you "invite" it? thx ;D P.S: If you guys (Karlis, Solidsnake14 and others guys that are reading the topic) dosent understand my question dont forget to ASK me!!! (:
  13. " My sugestion is about you guys , Mta developers , Translate the wiki for Portuguese (Brazilian) too. " I understood that you was suggesting/asking to MTA developers translate the wiki for Portuguese. Thats the reason that i mention about me to advise that you have to do by yourself. I wasent trying to show that i am better then you, i was trying to give some advises. (: Ye sleny, i thought that you doesnt know how to speak english because you wasent understanding what were the real meaning of the sentences that Citzen wrote. Yes... i wrote "Portugese" and "dosent" cus i was typing in a touch phone keyboard and i didnt notice these mistakes. And you is learning english? Nice, why dont you pratice and try to translate the wiki from english, not spanish? (;
  14. Great Karlis ^^! Simplest code is easier to discuss about (: umm, i understood what is script here You made an mathematical expression to calculate the positions of 2 objects that result that the 2nd object gets mirror against the 1st one. Ok... now lets give some values and see the script works x1 = 10, y1 = 20, z1 = 5 >> object 1 Position! x2 = 30, y2 = 10, z2 = 15 >> object 2 Position! local x1,y1,z1 = getElementPosition(theObj1) -- get the position of the frist one local x2,y2,z2 = getElementPosition(theObj2) -- get the postion of the second one setElementPosition( theObj2,x1-(x2-x1),y1-(y2-y1),z1-(z2-z1) ) -- Now lets make the calculation below! -> 1 ( theObj2, 10-(30-10),20-(10-20),5-(15-5) ) -> 2 ( theObj2, 10-(20),20-(-10),5-(10) ) -> 3 ( theObj2, -10,30,-5 ) -->> Ok... first doubt is: Why it given 30 as value? : D. It shouldn't be -20? Something wrong with mine math? Edit: I tested on MTA! it gave the same values ( -10,30,-5 )
  15. He used google translate, i can see clearly some english mistakes and what he understood about Citizen post Im a Brasilian too, but i didn't ask anyone to translate the wiki for portuguese ( obviously that English people dont know how to speak portugese! ) to learn scripting. I just learned to speak English. So it dosent make sense you ask for English people to translate the wiki for portuguese. What you should do now? Learn english. It has many ways to learn: -You have english classes in your school. -You can do a english course. If you cant pay for english course, it has many and many ways to do it on the INTERNET. Do it with yourself, dont wait to the others do for you.
  16. Oh right you guys is saying exactly what i want Ok karlis and SDK can you give me just a simple exemple using math (can be trigonometry ;D that is more hard for me) in position element? Then i you guys can help me in some points...
  17. Yea, it really has some good tutoriais that can show me good basics of it ( i was looking for since March ). But can you just show me a idea how do you notice that you will have to use those math stuff in your scripts?
  18. Oh thanks you man (you're too fast!) x) There's 2 resources that can get me a nice idea (why i didnt thought that was so "simple") Ok about the 3º question... Im trying to understand how you (and more programmers) use the trigonometric stuff to calculate things to get values. Like: "x = ( math.sin(60) + math.cos(40) )/360" (im inventing this thing okey? ) And you just get the correct value of the X position for a object based in main values. -So...? Then im trying to leran how to think in that way and when i will need use this in my scripts! -What I want? To learn how to make those scripts and get notice when i will need to make those type of calculation. Theres tutorials in the internet to help me with this? if no, what i should do? That its Thx man for the attention.
  19. Hey guys Im RaceXtreme and i script a long time ago, but now im stuck in a part of it (mainly maths and physical one). And i want to make 3 questions for you guys... and there we go: 1 - Its possible to brake some gravity physics in MTA? > Follow the situation below with the pic The black square is my car. The green arrow is the gravity of the game. The red/yellow arrow means that the car is running like a speed of 0.6 (speed of the game). The brown line is the ground (some carshades (ID: 3458 ) can be as exemple) and the 20 number means that the objects are 20m of the water. The blue line obviously means the water that is 0m high. And the situation is that: My car is running forward and the carshades objets are rotating in the y axis and finaly my car gets upsidedown. Obviously it will fell to the water. !! But the question is... can i avoid that this happen without affecting the gravity element? It has some functions that can support this? 2 - Its possible to rotate a bike in 360º while playing? > Follow the picture for reference (: Ok, the black rectangle is my bike/motobike. The red/yellow means that my bike/motobike is running. And the brown line is the ground, 0 in the y position. The 2º situation is that: My bike is running and quickly it jump in a ramp. I press the "down" button and my bike starts to spin. And theres is my problem! My bike just stop to spin in the ~90º degrees and it spin in a way that back to ~0º rotation. !! So, its possible to build a script that makes that the motobike rotate the hole 360º in both directions (forward and backward)? 3 - What About using trigonometry to help to calculate things? > Picture below... x) Follow my situation... -Why we use those sin, cos, tg, rad and those maths in scripting? To calculate the given values to find the answer! -But how i can use that? Just start to learn math. -I learned what is those terms but i still dont know how to use it and when is necessary to apply it. Stuck here. !!So there is a way to learn with some tutorials and exemples? If yes, where i can find those stuff? If no, what to do now? Yeea guys... to much things to read... thanks to read this big text (of course if you read ) and if you could answer my questions i will be verry grateful! Regards, RaceXtreme. P.s: Sorry for some english mistakes . If you dont understand me, ask please!
  20. I wanna to leran lua 2 ;D Need more logic experience õ/ Edit: Lol too late... I just wanna learn some maths that i REALLY CANT understand how to make them '-' Exemple: math.sin(blablabla) ( i know why they use this but how i can use... idk to use those functions )
  21. Thats anything wrong on my code? ( Only to be sure ) And thx Another thing... I tryied to run this code on race resource but it didnt work, bacause when i hit the marker dont happend nothing. On the server side works but on client i tryied the same code but with some changes. The marker creats but when i hit it dont happend anything. function markerHit ( thePlayer ) if (thePlayer==getLocalPlayer()) then outputChatBox ( "Hello?" ) -- This happend local veh = getPedOccupiedVehicle( player ) setVehicleGravity ( veh, 734.1802, -3325.3698, 339.8891 ) -- But this no. And it is on client-side. end end addEventHandler( "onClientResourceStart", resourceRoot, startclient ) I want that the car runs on the wall but it dosent works.
  22. Here: https://wiki.multitheftauto.com/wiki/SetVehicleGravity
  23. Hey gice, im new here in the forum. Who dont know me im RaceXtreme and i play MTA about 3.5 years. So... Im trying to do a server-side script that change the gravity of the car when the player hits the marker. When this happend the player will run on the wall of the build. I did a code here and i want to know if it is correct: local Marker = createMarker ( 724.4444, -3318.2453, 322.6392, "cylinder", 5, 255, 140, 0, 255 ) function MarkerHit ( player ) local veh = getPedOccupiedVehicle(player) if (veh) then setVehicleGravity ( veh, 734.1802, -3325.3698, 339.8891 ) end end addEventHandler( "onMarkerHit", Marker, MarkerHit ) Thx gice
×
×
  • Create New...