
DefiniteIntegral
Members-
Posts
35 -
Joined
-
Last visited
Everything posted by DefiniteIntegral
-
It is probably not this but... are you running GTA or MTA in a compatibility mode by chance? Assuming vista even supports compatibility, I have no idea. I run GTA single in win98 mode otherwise my mouse doesnt work. But for MTA, I have to run GTA and MTA in winNT mode to work. Sometimes I forget to set GTA back to NT compat after using 98 for single player. That will cause the runtime error crash before reaching the main menu in MTA for me. If you aren't using any compat modes, then I have no idea.
-
Well yes, obviously. I just assumed he was competent enough to apply that function to all players on the server, and compare the returned angle with some predetermined limiting factor, say a 45 degree angle. function getAllPlayersWithinAngleRangeOfSource(sourcePlayer, angleLimit) local returnPlayerList = {} for i,player in pairs(g_Players) do if findAngle(sourcePlayer, player) <= angleLimit then table.insert(returnPlayerList, player) end end return returnPlayerList end Can you return tables in this manner? I forget. This should cover all users regardless of distance. Anyway something like this is kind of basic, if a scripter can't even figure that out what chance does he really stand making something good anyway? Oh well everything learned is progress on the way I suppose
-
A dot product might be a bit easier and faster perhaps, as it only requires a few lines of code. Here is an example for finding the angle between two players relative to source rotation. This is 2d only as requested by opening poster. function findAngle(sourcePlayer, targetPlayer) local sourceX, sourceY, sourceZ = getElementPosition(sourcePlayer) local sourceRotX, sourceRotY, sourceRotZ = getPedRotation(sourcePlayer) local targetX, targetY, targetZ = getElementPosition(targetPlayer) -- get relative position local relativePosX = targetX - sourceX local relativePosY = targetY - sourceY -- get distance local distance = math.sqrt(relativePosX*relativePosX + relativePosY*relativePosY) -- normalize relativePosX = relativePosX / distance relativePosY = relativePosY / distance -- get source angle vector. should already be normalized. I might have sin and cos the wrong way around.. local sourceVecX = math.sin(math.rad(360-sourceRotZ)) local sourceVecY = math.cos(math.rad(360-sourceRotZ)) -- use dot product to find cos of angle between vectors local dotProduct = (sourceVecX * relativePosX) + (sourceVecY * relativePosY) -- return acos of dot product. convert angle to degrees before returning. return math.deg(math.acos(dotProduct)) end This function will return a value between 0 and 180 representing angle away from the direction the admins player model is facing. Of course it might be more convenient for the admin to use camera angle instead of ped angle.
-
Boost : Gamemode + Maps [Update: Bugfixes]
DefiniteIntegral replied to DefiniteIntegral's topic in Showroom
The jump pickups themselves are configurable. The modification is like this: new velocity = old velocity * pickup multiplier + pickup addition So they can be configured to set a specific velocity, or just modify the existing one. Both vehicle velocity and turn velocity can be controlled this way. The result being the difference between an automatic jump, and one that actually requires skill. To answer your question though, in boost-rooftop and boost-sky, yeah they pretty much do it for you. Most checkpoints set a specific velocity, but leave rotation velocity to the player. A couple of difficult points control rotation also. I set it up that way for the sake of demonstration. I was considering making a 'hard' version which would rely on a lot more player control. I do think many of the maps could be made harder. These maps evolved from a number of LAN games where we screwed around a lot, so they are generally pretty easy. Hard versions would actually have time limits for example. In the case of maps like boost-highwaysuper and boost-fierroslide, the velocity modification is not done by pickups. It is calculated on the server every 150 ms for every vehicle. Controlling vehicles in these maps relies entirely on the player, as the server only applies acceleration or braking to the vehicle according to user input. -
Can i install MTA:DM and Race on my PC?
DefiniteIntegral replied to GTA-FREAK[Ger]'s topic in Support
Can you give me a link to that thread? All the searches I have done on the matter only give me threads about not being able to use the editor in race 1.1.1, or using offedit etc in DM. -
Boost is a modified version of arc_'s race mod for DM. It aims to fix existing bugs, and add new functionality. It does NOT aim to turn DM race into a duplicate of race 1.1.2 as some may wish for. The main feature of this mod is the ability to use map options to control various aspects of a vehicles handling. Modifiable characteristics include speed, acceleration, braking, hand-braking, steering and down-force. For boats, buoyancy can be added. Other options for controlling vehicle health have also been added. These include health regeneration over time, specifying the level of flip and water damage, damage proofing or just dent-proofing. It is also possible to set a vehicle to explode below a certain height, or speed. Vehicles can also be configured to drive on water, or under water. There are also some default options to control checkpoint size and color, and starting vehicle. Maps The maps that come with Boost are easy maps designed for crazy fun, not serious racing. boost-underwater : A race on the bottom of the river north of Los Santos. boost-collector : Collect as many checkpoints as you can in 1 hour to win, while driving an amphibious vehicle. Press fire to do a small jump. boost-banditobomb : Race on dirt tracks near Los Santos in a bomb rigged bandito. boost-cometbomb : Race through San Fierro in a bomb rigged comet boost-country : Race in the countrisde near Los Santos in a modified vortex that has increased speed, handbrake and can survive underwater. boost-desert : Race around area 69 in a bandito with increased speed and acceleration. boost-fierroslide : This vehicle has deliberately slippery handling. boost-freeroam : Features a ludicrously fast nrg500. Has amphibious and jump capabilities. boost-handbrake : A long race in a banshee with boosted acceleration and more powerful braking. boost-highwaybomb : A long highway race in a bomb rigged turismo. boost-highwaysuper : The same highway race, in a modified bullet. boost-monster : Race from the mine pit to area 69 in a more powerful monster truck. boost-pcj600bomb : A bomb rigged pcj race from the petrol station to the radar dish. boost-river : A race around the rivers of SA in a fast sea craft, includes some jumps. boost-rooftop : A very short race demonstrating some jumps. boost-sanchezjump : Jump across some rooftops and rivers from Los Santos to Las Venturas. boost-sky : A crazy map, featuring jumps across skyscrapers. boost-supernrg : A very fast country road race in a nrg500 modified to travel about twice normal speed. Videos: http://au.youtube.com/watch?v=gTTUt0zAz_E : boost-underwater http://au.youtube.com/watch?v=WWeTZ0C-Q24 : boost-collector http://au.youtube.com/watch?v=37IUraPNRdw : boost-sanchezjump http://au.youtube.com/watch?v=WavMDVwzFX0 : boost-supernrg http://au.youtube.com/watch?v=saRMKYJXvOk : boost-freeroam http://au.youtube.com/watch?v=Q2BDFdYrAuo : boost-country : boost-sky : boost-river : boost-highwaysuper : boost-fierroslideDownload: http://rapidshare.com/files/167477122/boostpack20081126-2.zip Just unzip this file into server\mods\deathmatch\resources This mod requires the same acl.xml modification as arc_'s race mod: Update [26 November 2008]: Added cruise control to boost-collector. Fixed some bugs. If you have an older version from before 05 November, please delete all boost content before unzipping.
-
Can i install MTA:DM and Race on my PC?
DefiniteIntegral replied to GTA-FREAK[Ger]'s topic in Support
It is possibly to use both with a little messing around. I just install race first, then back up the contents of the GTA directory and MTA install directories. Next, install DM. Make a second set of backups for GTA directory and MTA install directory. Then just paste into the GTA and MTA directories the versions that you want to use each time. There is no need to actually reinstall each time as long as DM was installed second, race will still work with DM registry entries. That is the method I use to utilize the race editor for making DM race maps. I assume that is what the batch files mentioned do anyway. Of course you don't need to backup the entire GTA directory, just the files in the root directory and the MTA subdirectory. -
I think gamesnert was asking; what specifically are you trying to do? I say that because 'what the client is doing' is a pretty vague response. Most important information is already available to the server.. synced player controls, player and vehicle health, transform and velocity info, etc. I can't imagine what you are trying to do that requires so many updates, since most information regarding 'what the client is doing' is already available to the server anyway. The only thing I can think of is that perhaps you are trying to compare the client and server side data as a form of anti cheat but I highly doubt that is realistically achievable through event calls, considering latency and the slowness of lua.
-
That is exactly what I was looking for, thanks. For the convenience of anyone else who searches for it, the vector the car is facing is different from eXo|Mr.Hankey's camera vector by -90 degrees around X axis. local vx = math.cos(math.rad(rx)) * math.sin(math.rad(360-rz)) local vy = math.cos(math.rad(rx)) * math.cos(math.rad(360-rz)) local vz = math.sin(math.rad(rx))
-
I have a similar query to so I thought this thread would be a good place to post it. I have gotten rusty after several years without using any trigonometry, so I am not really sure what I am doing. I want to find the vector which would result from the transform described by getVehicleRotation. Specifically, I want the vector describing the direction the vehicle is facing, which I guess is obtained from X and Z rotations, ignoring roll. local rx, ry, rz = getVehicleRotation(vehicle) local vx = cos(math.rad(360-rz)) local vy = sin(math.rad(360-rz)) local vz = 0 That is the 2d vector representing direction, right? What should I use to obtain 3d vector? My problem is not knowing how to get correct vx and vy. Should I just get vz based off x rotation then normalize the vector, or can I rotate vx and vy using sin or cos?