Jump to content

Puma

Members
  • Posts

    240
  • Joined

  • Last visited

Everything posted by Puma

  1. Small work-in-progress screenshot, plus Lakitu:
  2. Well I use the player that shoots it as calculator: I trigger a clientside event, get the position and rotation and send that info back serverside by triggering a serverevent.
  3. I got it fixed a day ago already .
  4. When you create a vehicle and move it to x,y,z without a player sitting in it (so using setElementVelocity), the position of that vehicle does not change serverside, since the server doesn't render the game and its physics.
  5. Ah, I know the problem: A vehicle that's created using createVehicle can't change position serverside without setElementPosition, since the server doesn't render the game and the game's physics: the moves of the vehicle are rendered clientside .
  6. Ohai, I'm doing a script in which I attach an object to a vehicle, created using createVehicle on position x, y, z. When I let the vehicle 'drive' to a new position using "setElementVelocity", the position (x, y, z) stays the same. Pretty weird, seen that the position of the vehicle itself DID change (I output the position right after it checks it, which happens to stay the same while the vehicle is driving away from me). Why am I doing this? I want to change position of a colshape that belongs to the vehicle. Since it isn't possible to attach colshapes to elements, I request the position and rotation of the vehicle every 50 ms. Problem is that the position of the colshape stays the same: where it was created. My script: -- SERVERSIDE -- -- SERVERSIDE -- -- SERVERSIDE -- function bindGreen ( p, green ) bindKey ( p, "lctrl", "down", shootGreen, green ) end function shootGreen ( p, a, b, green ) unbindKey ( p, "lctrl", "down", shootGreen ) local v = getPedOccupiedVehicle ( p ) local x, y, z = getElementPosition ( v ) local rx, ry, rz = getVehicleRotation ( v ) local greenV = createVehicle ( 441, x, y, z, rx, ry, rz ) local col = createColSphere ( x, y, z, 5 ) setElementData ( col, "green", green ) setElementData ( col, "greenV", greenV ) setElementData ( greenV, "col", col ) setElementData ( greenV, "green", green ) setElementData ( greenV, "gdist", 0 ) setElementData ( greenV, "gpos", {x, y, z} ) setElementData ( greenV, "rot", { rx, ry, rz } ) setElementData ( col, "source", v ) checkGreen ( p, col, green, greenV ) end function checkGreen ( p, col, green, greenV ) if isElement ( col ) and isElement ( green ) and isElement ( greenV ) then local x, y, z = getElementPosition ( greenV ) local rx, ry, rz = getVehicleRotation ( greenV ) setElementPosition ( col, x, y, z ) setElementRotation ( col, rx, ry, rz ) setElementData ( greenV, "greenHit", 0 ) driveGreen ( p, col, green, greenV ) end end function killShell ( col, greenV, green ) destroyElement ( green ) destroyElement ( greenV ) destroyElement ( col ) end function driveGreen ( p, col, green, greenV ) triggerClientEvent ( p, "onDriveGreen", greenV, p, col, green ) end function boostGreen ( p, col, green ) local v = source local rot = getElementData ( source, "rot" ) local rx = rot[1] local ry = rot[2] local rz = rot[3] setVehicleRotation ( source, rx, ry, rz ) local vx, vy, vz = getElementVelocity ( v ) setElementVelocity ( v, 0.5*math.sin(math.rad(360-rz)), 0.5*math.cos(math.rad(360-rz)), vz ) setTimer ( checkGreen, 50, 1, p, col, green, source ) end addEvent ( "onBoostGreen", true ) addEventHandler ( "onBoostGreen", getRootElement(), boostGreen ) -- CLIENTSIDE -- -- CLIENTSIDE -- -- CLIENTSIDE -- function driveGreen ( p, col, green ) triggerServerEvent ( "onBoostGreen", source, p, col, green ) end addEvent ( "onDriveGreen", true ) addEventHandler ( "onDriveGreen", getRootElement(), driveGreen ) There's a lot more in the functions, these are just the relevant parts. I bind a key, when it is pressed I create a vehicle and do some shit with it. The colshape changes position to the position of the created vehicle, a clientside event is triggered and then a serverside event is triggered, in which the created vehicle get's a boost. 50 ms later the whole process, from changing the position of the colshape, repeats untill a part of the script breaks it (I left that part out, because it isn't relevant). In short: local x, y, z = getElementPosition ( greenV ) setElementPosition ( col, x, y, z ) .. in "checkGreen" doesn't change the col's position. And yes, the elements that are checked do exist. So... whut should I do?
  7. Ohai, I'm busy doing a ?-pickups script for MTA, just like the ?-boxes in Mariokart. This version of the resource is made for Balloon Battle maps: each player get's 3 balloons and using the items obtained by the ?-pickups, you can destroy other player's balloons until only 1 player remains. A lot of scripting, some custom models and some other shizzle. There's still quite some stuff to do, like the red and green shells (which will be pretty hard to script so it looks proper ingame). Resource is exclusively for the Party and Co server, so there won't be a download. Done so far: thunderstruck, bananas (1 or 3), fake box, star-mode, bomb, boost, balloons, boxes + itemreel, plus some 'animations' and small details.
  8. Got a problem: "onMarkerHit" isn't triggered when something hits a marker that is attached to a vehicle. Same problem with colshapes: I attach the colshape to a vehicle, but when you drive through that vehicle with another vehicle (using ghostmode, d'oh), "onColShapeHit" is not triggered. I've had this problem before and I do think that the ability of attaching markers/colshapes to vehicles and let them trigger events could come in very helpful sometimes. The only option left for me is using a timer with a 50ms interval to check the distance between all players and do something if the distance is smaller than x... But that's like driving a Ferrari in the Desert because you can't get the doors open of your Range Rover... Anyone got a better solution than my solution, or a solution for the whole problem: "onMarkerHit" or "onColShapeHit" is not triggered by hitting a marker or a colshape that is attached to a vehicle?
  9. Maarten told me on Xfire that the stuff I posted here worked...
  10. Ah, the "p" shouldn't be there in the parameters of the ramp1 function: since the script is clientside (no keypresser defined in "bindKey") the keypresser can only be the local player: p = getLocalPlayer() function ramp1() local v = getPedOccupiedVehicle ( p ) -- get the player's vehicle if v then -- does the player's vehicle exist (is he in a vehicle?) local x, y, z = getElementPosition ( v ) -- get the vehicle's position local rx, ry, rz = getVehicleRotation ( v ) -- get the vehicle's rotation createObject ( 1632, x, y, z+10, rx, ry, rz ) -- create the object using the vehicle's position and rotation end end bindKey( "1", "down", ramp1) Also, the function in "bindKey" wasn't present in the script (it was "ramp2" and that should have been "ramp1"). As for creating an object in front of something, you should check out "getElementMatrix": https://wiki.multitheftauto.com/wiki/GetElementMatrix
  11. A player only has a Z-rotation, since it can't be rotated along the Z- or Y-axis. Since it's a ramp, I assume that the player is in a vehicle. You gotta check if the player is in a vehicle and if he is, you get the position and rotation of that vehicle: function ramp1(p) -- open a function with "p" defined as the player local v = getPedOccupiedVehicle ( p ) -- get the player's vehicle if v then -- does the player's vehicle exist (is he in a vehicle?) local x, y, z = getElementPosition ( v ) -- get the vehicle's position local rx, ry, rz = getVehicleRotation ( v ) -- get the vehicle's rotation createObject ( 1632, x, y, z+10, rx, ry, rz ) -- create the object using the vehicle's position and rotation end end bindKey( "1", "down", ramp2) I don't know why you want to create a ramp 10 meter above the player's vehicle, but that's your side of the story.
  12. You're wrong. if hunterFound then maptype = "DM" else maptype = "DD" end You're checkin if hunterFound is nil. It can only be false or true (since it is defined as false and maybe defined as true later in the script), so you should be checking: if hunterFound == true then maptype = "DM" else maptype = "DD" end
  13. Puma

    SKC Customs

    Looking very, very good. You guys seem to know how to create decent looking, low definition maps. Texturing looks good too, which can be a real killer for a good model (texturing sucks in SketchUp ). I wish you guys good luck with the whole project, I actually did expect that you'd do something like this sometime . I'll come by sometime .
  14. Fcking shit music in that video, quit watching it because of the music.
  15. One thing that's not part of the handling, but would be cool to change, is a vehicle's wheel size. This can be altered 'single-player-wise' in the next- and second-to-last digits of a vehicle's line in "vehicles.ide" found in the data folder. Also, changing weapon's specifications would be cool (weapon.dat), such as the range, strength etc. Wait, maybe I've gone too far now
  16. Just a tip that might come in very handy. You can add those objects as a seperate resource. Just create a new resouce/folder and name it "tunnelmodel" for example. That'll be the name for your resource. In this resource, you put the models, script and the meta.xml. BUT: you don't include a race map etcetera, and you change the type of the resource in meta.xml to "script", instead of "map". This is your 'models' resource. In the meta.xml of you map's resource, you put a line . This means that the resouce that you filled in must be started when this map starts. Why should you do it this way? Well, you can use this resource over and over again, and the players will only have to download this stuff once. Secondly, you can use those models over and over again, even in the map editor. How? Just don't start the 'map editor' in the main menu, but run a local server, join it by quick connect, stop the running gamemode ("/stop race" for example for the race gamemode) and type "/start editor" to start the editor. Now, you just type "/start nameofyourmodelsresource", and you can just map objects that use your skin! This works a lot easier, in my opinion. Just an example: Meta.xml: <?xml version="1.0" encoding="utf-16" ?> <meta> <script src="replace_models.lua" type="client" /> <info type="script" name="cityobs" author="Puma" /> <file src="1.col" /> <file src="2.col" /> <file src="3.col" /> <file src="3_2.col" /> <file src="4.col" /> <file src="5.col" /> <file src="1.dff" /> <file src="2.dff" /> <file src="3.dff" /> <file src="3_2.dff" /> <file src="4.dff" /> <file src="5.dff" /> <file src="tex.txd" /> </meta> replace_models.lua : function replace () local o1 = 1830 local o2 = 1831 local o3 = 1832 local o3_2 = 1833 local o4 = 1834 local o5 = 1835 local txd = engineLoadTXD('tex.txd') if txd then engineImportTXD(txd, o1) local col1 = engineLoadCOL('1.col') engineReplaceCOL(col1, o1) local dff1 = engineLoadDFF('1.dff', 0) engineReplaceModel(dff1, o1) engineImportTXD(txd, o2) local col2 = engineLoadCOL('2.col') engineReplaceCOL(col2, o2) local dff2 = engineLoadDFF('2.dff', 0) engineReplaceModel(dff2, o2) engineImportTXD(txd, o3) local col3 = engineLoadCOL('3.col') engineReplaceCOL(col3, o3) local dff3 = engineLoadDFF('3.dff', 0) engineReplaceModel(dff3, o3) engineImportTXD(txd, o3_2) local col3_2 = engineLoadCOL('3_2.col') engineReplaceCOL(col3_2, o3_2) local dff3_2 = engineLoadDFF('3_2.dff', 0) engineReplaceModel(dff3_2, o3_2) engineImportTXD(txd, o4) local col4 = engineLoadCOL('4.col') engineReplaceCOL(col4, o4) local dff4 = engineLoadDFF('4.dff', 0) engineReplaceModel(dff4, o4) engineImportTXD(txd, o5) local col5 = engineLoadCOL('5.col') engineReplaceCOL(col5, o5) local dff5 = engineLoadDFF('5.dff', 0) engineReplaceModel(dff5, o5) else replace() end end addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()), replace ) Hope you get what I mean, if you got more questions just ask !
  17. Looks very good. The only thing you might change is the ambience: maybe some sky/water colors or changing colors. I'm just wondering what the total, unpacked, size of the map is at the moment..?
  18. Can't fix that, that problem's caused by mta's not-moving-but-repositioning moving objects system...
  19. Puma

    Puma's MTA Maps

    Simplicity is the key though.
  20. Puma

    Puma's MTA Maps

    I know, Johnline is a great modeler/modder/mapmaker ! I don't think you must compare my maps with his maps, because he makes crazy wipeout maps and I do a lot stuff by script too. His models are also way better than mine, because he's a better modeler and he's got the opportunity to use them: the most servers I make maps for, are slow servers which almost crash if a map is started that is bigger in size than 100 kb...
  21. Puma

    Puma's MTA Maps

    Thanks all New map coming up, "Hunted by objects 2"...
  22. Puma

    Puma's MTA Maps

    Okay, the moment you waited for: all maps are now downloadable from GTAGarage.com! Also, there are more maps on that page than you can find in this topic, plus info, so be sure to check that page out. Link: http://www.gtagarage.com/mods/show.php?id=11149 Have fun and drop a comment, I'd like it!
×
×
  • Create New...