
Ace_Gambit
Members-
Posts
569 -
Joined
-
Last visited
Everything posted by Ace_Gambit
-
And this is good because that makes those servers unique because those scripts would replace freeroam in many servers... I can't entirely agree with you on that. I believe in the principle of "sharing is caring" . People could really learn from other scripts and it also speeds up the scripting of new game modes by the community. And servers can still remain unique even after sharing their game mode.
-
Ok, I will promise to stay loyal to the MTA format for the next release. Hail the great leaders .
-
Correct me if I am wrong but doesn't the function do exactly what it's supposed to do? What you're basically saying with the brackets is "give me a match with all occurrences that include the pattern ps". I am not familiar with LUA pattern matching but what you want is a match with the pattern "[PS]" and not "ps". If this function works like I think it does you will have to find a way to make the brackets part of the pattern (most languages have something like backslash to escape special characters) and a switch to ignore lowercase.
-
It keeps spilling out errors when I try to upload it. This is kind of my own fault for not sticking to the default MTA map format.
-
I've added a mirror in the first post. I hope it works for you.
-
Yes. But that was kind of before I figured I could not finish a lot of the planned features (moving carriers and subs). With the current script you can easily create a map that has nothing to do with naval war. That's why it seemed more logical to rename the mode.
-
I don't think that is a GTA model. Look for dff and txd (possibly even col) files in your stealth game mode folder. It is probably a custom model that replaces the one in the GTA engine.
-
POW:Prisoners of War (Unfinished) After careful consideration I've decided to stop all development regarding a game mode I was working on for the past couple of weeks. I release the script source for others to use in their mode and for educational purposes. I was hoping I could finish the mode but I want to graduate by the end of June and much of my effort went into learning LUA. Maybe I'll come back and finish the job but I have other priorities at the moment. When I have graduated and DP3 is released I want to rewrite the mode in the correct format (using element tree structures and resource calls). This mode was mainly started to learn LUA but things got out of hand and I ended up spending more time scripting than working on my thesis. Screenshots and info at: http://mtasascripting.blogspot.com Download URL (game mode): https://community.multitheftauto.com/index.php?p= ... ils&id=126 Due to incompatibility issues (my fault) I could not upload the map to MTA community. Download URL (map): http://rapidshare.com/files/109182884/p ... a.zip.html Map (mirror): http://www.mediafire.com/?c1j2gi1juga Map features: Teams: 2 Spawn points: 32 Squads: 4 per team Roles: 4 per team Vehicles: rustler and patriot Primary weapons: shovel, katana, 9mm, rifle, sniper, m4, ak47, flame thrower, rocket launcher, satchel bombs, grenades, tear gas, molotovs Vehicle weapons: barrage shells, recon flares and bunker buster bombs Defence systems: sam, ssm and barrage Vehicle repair: yes Vehicle fuel: yes Warfactory: yes Missions: no Respawn: yes Known map issues: - Pickups are not rendered (bug) WARNING This game mode is experimental. As part of this experiment I tried to play around with the possibilities of implementing custom fonts and such. Players may experience extensive loading times and FR drops on slow computers. Server admins are advised not to run this game mode on a public server. Don't say I didn't warn you! I also recommend not running the default scoreboard and killing messages resource. This game mode has its own. Running both resources at the same time may cause conflicts. Lastly keep in mind that most GUI coordinates are not relative! You will have to make it work yourself for resolutions other than 800x600 (my test mode). Features: - 32 slot team selection - Role selection (engineer, grenadier, marksman and medic) - Squad selection (alpha, bravo, charlie and delta) - Campaign selection (assault and recon) - Custom scoreboard - Custom kill messages - Projectile system (surface-to-air, surface-to-surface and barrage) - Vehicle weapons (recon flares, barrage shells and bunker buster bombs) - Vehicle damage system - Vehicle fuel system - Warfactory (unfinished) - Object animation control (looped animation and lift triggers) - World boundery control Controls: - LSHIFT for vehicle weapons (only after choosing a campaign at the warfactory) - MOUSE1 (left mouse)/MOUSE2 (right mouse) for rotating vehicle turret (patriot in assault mode only) Markers: - Yellow marker: carrier lifts - Spray can marker: vehicle repair - Blue marker: vehicle fuel - Purple marker: warfactory - Orange marker/corona: vehicle ammo reload (only after choosing a campaign at the warfactory) Known issues: - Extensive loading time (should be fixed when MTA:DM starts shipping with descent font support) - Objects created on the fly not showing correctly (this is due to MTA:DM bugs) - Instruction text not disappearing - Projectile desync (MTA bug) Unfinished features: - Match rounds (players are always able to join or respawn during the game) - Team balance - Warfactory (modshop) * - Timers are not stopped ** * Important notice regarding the warfactory feature. The player is teleported to a fixed location in the default dimension! This means that you can not have multiple players in the warfactory at the same time. This was on the TODO list untill I stopped all development. ** When a player quits some timers remain active causing nil errors. This was also on the TODO list to fix. Credits to the MTA team
-
I agree on that. It's the same old boring free roam story on most servers with a few exceptions. And the servers who do host original game modes usually keep the script source to themselves.
-
LOL, Duck Hunt FTW!!! Nice .
-
The easiest method is to create a routine in the element stream in/out call back that checks if the element is a vehicle and toggles an attached radar blip on or off. If you want to create a permanent radar blip it is better to directly use the "create attached blip to" function.
-
Yes but this sample is not very practical to begin with. I just wanted to show that you can create pretty neat stuff if you think outside the box once in a while. My advice is to play around with this if you want but wait to implement object dynamics in your script until they have released DP3.
-
But it lacks a setPedTask or setPedSimplestTask. What this could mean is that peds can interact in the GTA world like in SP (peds talking to each other or fighting over turfs) but can not be forced to attack "real" players. But this is just a speculation based on what is on the wiki right now. Most functions are "getting" instead of "setting".
-
I've seen a possible solution posted by someone in the bugs forum a while ago. It seems that you can not set the camera position and make it look at something in the same frame. The solution posted (not sure if it is working) toggled to fixed/player mode and set a timer to either set the camera or make it look at a target after a short timeout.
-
Here's a code snippet that shows how to fake GTA world physics on objects. This is one of the earlier versions that I am using in my game mode. It demonstrates the faking of a dropping bomb with correct velocity over x, y and z axis. Unlike most falling bomb scripts this does not use the moveObject function which in turn allows it to follow more accurate trajectories (curved falling direction). It also does not take the altitude/distance to ground parameter into account to determine when to detonate. This sample tries to simulate a bomb that detonates when: 1) Velocity over z becomes greater than or equal to zero (bomb hit or bounced off of object) 2) Velocity over x, y, and z is equal to zero (bomb stopped moving) The benefit of this method is that the bomb is able to interact with custom world objects. And it creates a cool effect when the bomb is bouncing off before exploding. How does it work? It's very easy. Objects in MTA DM are static by default and you can not set its velocity. Vehicles however are perfectly capable of handling GTA's world physics. To fake the physics of my bomb I've attached a vehicle to the bomb model . And it works ^ lol. Be aware that this code snippet is a rather dirty solution to overcome the missing feature of making objects dynamic. DP3 will probably offer full support for dynamic objects (altering velocity and such) rendering this sample useless. But it may be useful to people who want to create dynamic objects in a different way than regular script have done so far. Please do not ask me to make this a resource because I am too lazy to do it . Anyway, this is what it could look like: And this is the code snippet server.lua local root = getRootElement() local bomber = false function callbackspawn() if (spawnPlayer(source, 0, 0, 5)) then fadeCamera(source, true) if (bomber == false) then bomber = createVehicle(476, 5, 5, 5, 0, 0, 360) setVehicleColor(bomber, 44, 44, 44, 44) end setPlayerSkin(source, 61) end end addEventHandler("onPlayerJoin", root, callbackspawn) client.lua local root = getRootElement() local player = getLocalPlayer() local reloadspot = false local bombs = {} local objects = {} local armedtimer = false function inrustler() if (isPlayerInVehicle(player)) then return (getVehicleID(getPlayerOccupiedVehicle(player)) == 476) end return false end function callbackreload() if (getElementType(source) == "player" and inrustler(source)) then loadbomb() end end function callbackspawn() reloadspot = createColTube(30, 20, 2.0, 6.0, 100) createMarker(30, 20, 2.0, "checkpoint", 12.0, 17, 80, 31, 75) createBlip(30, 20, 0, 5) -- some random world settings -- just forget it if you don't care resetSkyGradient() setWeather(10) setTime(12, 0) end -- arm the bomb function armbomb(playerName, armed) local vX, vY, vZ = 0, 0, 0 local x, y, z = 0, 0, 0 if (not armed) then playSoundFrontEnd(42) detachElementFromElement(objects[playerName]) setTimer(setElementCollisionsEnabled, 500, 1, bombs[playerName], true) setTimer(armbomb, 2500, 1, playerName, true) outputChatBox("* Bomb is armed") else -- velocity check over z-axis vX, vY, vZ = getElementVelocity(objects[playerName]) -- check if bomb bounced off (vZ becomes positive) or stopped moving if ((vZ > 0) or (vX == 0 and vY == 0 and vZ == 0)) then x, y, z = getElementPosition(bombs[playerName]) -- detonate bomb destroyElement(bombs[playerName]) blowVehicle(objects[playerName], true) destroyElement(objects[playerName]) -- create explosion at bomb position createExplosion(x, y, z, 10, true, 1.0, true) -- create mini-flares createProjectile(player, 21, x, y, z, 1.0, nil, 0, 0, 0, -(math.random(2, 5) / 10), math.random(2, 5) / 10, math.random(1, 5) / 10) createProjectile(player, 21, x, y, z, 1.0, nil, 0, 0, 0, math.random(2, 5) / 10, -(math.random(2, 5) / 10), math.random(1, 5) / 10) createProjectile(player, 21, x, y, z, 1.0, nil, 0, 0, 0, math.random(2, 5) / 10, -(math.random(2, 5) / 10), math.random(1, 5) / 10) createProjectile(player, 21, x, y, z, 1.0, nil, 0, 0, 0, -(math.random(2, 5) / 10), math.random(2, 5) / 10, math.random(1, 5) / 10) else armedtimer = setTimer(armbomb, 50, 1, playerName, true) end end end -- create bomb model function createbomb() local bomb = bombs[getPlayerName(player)] if (bomb ~= nil and bomb ~= false) then -- destroy object destroyElement(bomb) end -- create actual bomb model bombs[getPlayerName(player)] = createObject(3786, 0, 0, 0) setElementCollisionsEnabled(bombs[getPlayerName(player)], false) end -- drop the bomb (not armed) function dropbomb() local vehicle = false local object = objects[getPlayerName(player)] if (inrustler(player) and #getAttachedElements(getPlayerOccupiedVehicle(player)) > 0) then createbomb() if (object ~= nil and object ~= false) then -- destroy object destroyElement(object) end -- create rc vehicle objects[getPlayerName(player)] = createVehicle(441, 0, 0, 0) setElementAlpha(objects[getPlayerName(player)], 0) vehicle = getPlayerOccupiedVehicle(player) if (vehicle ~= false and getVehicleController(vehicle) == player) then attachElementToElement(bombs[getPlayerName(player)], objects[getPlayerName(player)], 0, 0, 0, 0, 0, -90) -- attach to player vehicle attachElementToElement(objects[getPlayerName(player)], vehicle, 0, 0, -1.2, 0, 0, 0) setTimer(armbomb, 500, 1, getPlayerName(player), false) end end end -- attach bomb to airplane function loadbomb() if (inrustler(player) and #getAttachedElements(getPlayerOccupiedVehicle(player)) == 0) then playSoundFrontEnd(46) if (armedtimer ~= false) then killTimer(armedtimer) end createbomb() attachElementToElement(bombs[getPlayerName(player)], getPlayerOccupiedVehicle(player), 0, 0, -1.2, 0, 0, -90) outputChatBox("* Bomb is attached") outputChatBox("* Press LSHIFT to drop the bomb on target") end end function callbackKeyFunc(key, keyState) if (key == "lshift") then dropbomb() end end addEventHandler("onClientPlayerSpawn", player, callbackspawn) addEventHandler("onClientElementColShapeHit", root, callbackreload) bindKey("lshift", "down", callbackKeyFunc) Use this code if you want but don't keep scripts to yourself. Give other people the opportunity to learn as well.
-
Actually creating any kind of mini-game that involves or requires dynamic objects (basketballs, pool balls, rocks etc.) is rather hard if not impossible to script in DP2. The reason for this is that objects that are supposed to be dynamic (like in MTA Race) remain static in MTA DM. You can try it for yourself. Create a basketball and bump into it. Unlike in MTA Race the basketball will stay in place. And since we can't set velocity of objects it will be very hard to script mini-games like playing basketball or pool.
-
I've experienced de-syncing when I test projectiles as well. When I create an air bomb projectile and launch it using velocity parameters the other player sees it as directly falling to the ground. Same goes for rockets. The other player can see the rocket but its trajectory is completely off. The spot of impact is correct for all spectators though.
-
This is confirmed by me as well. Sometimes object created with createObject do not show for some players even though others can clearly see them. After reconnecting the invisible object become visible to the player who didn't see them the first time. Also removing objects is buggy at times (old object still showing after I destroyed them).
-
Can you post the entire code snippet?
-
I've had similar issues with the camera not being properly set for a newly joined player. The camera would just get stuck at 0, 0, 0 like you already mentioned. It has to do with the fact that a player is not fully spawned (or at least in my experience it is). The problem occurs only and only when a player joins for the fist time. I solved it by setting a timer (runs only once when a player joins the server) that loops for n times for the duration of n seconds positioning the camera in each tick event (10 recursions with an interval of 1000ms did the job for me). After that the camera works fine.
-
Erm, ped support is exactly what they say it is...pedestrians walking around like in SP. Only this time you can control behaviour/trigger events by querying/setting states and actions/tasks of peds.
-
I have no problems even with Firefox...