Recent posts

#91
Snippet Showroom / Re: Relative position (in 3d)
Last post by PSL - Jan 30, 2024, 10:32 AM
Thank you for sharing
#92
Hi bro, Can you tell me how you port forward please ?, because i try it but not success please tell me, Are port forward show server in masterlist or not ?
#93
Snippet Showroom / [clientside] 3d line (like las...
Last post by vitovc - Jan 26, 2024, 01:35 PM

This script can be helpful in development to draw npc paths, visualize raytrace or just for laser rifle feature.

::line3d <- {
  "list" : {},
  "del" : function(id){
    if(::line3d.list.rawin(id)){
      return ::line3d.list.rawdelete(id);
    }
  },
  "set" : function(id, color, from, to){
    if(::line3d.list.rawin(id)){
      return ::line3d.update(id, from, to);
    }
    local item = {
      "id" : id,
      "pos" : {
        "from" : ::Vector(0, 0, 0),
        "to" : ::Vector(0, 0, 0)
      },
      "dist" : 0
      "raw" : []
    }
    for(local j = 0; j < 4; j++){
      local ca = ::GUICanvas();
      ca.Colour = color;
      ca.Position = ::VectorScreen(0, 0);
      ca.Size = ::VectorScreen(1, 1);
      ca.AddFlags(GUI_FLAG_BACKGROUND | GUI_FLAG_3D_ENTITY);
      ca.Position3D = ::Vector(0.0,0.0,0.0);
      ca.Rotation3D = ::Vector(0.0,0.0,0.0);
      if(j < 2){
        ca.Size3D = ::Vector(0.01, 0.01, 0.0);
      } else {
        ca.Size3D = ::Vector(0.01, 0.01, 0.0);
      }
      item.raw.push(ca);
    }
    ::line3d.list.rawset(id, item);
    return ::line3d.update(id, from, to);
  },
  "update" : function(id, from, to){
    if(::line3d.list.rawin(id)){
      local item = ::line3d.list.rawget(id);
      item.pos.from = ::Vector(from.X, from.Y, from.Z);
      item.pos.to = ::Vector(to.X, to.Y, to.Z);
      item.dist = ::line3d.dist_3d(from.X, from.Y, from.Z, to.X, to.Y, to.Z);

      local lp2 = item.pos.from;
      local lp = item.pos.to;
      local fp = ::Vector(lp2);
      local fp0 = ::Vector(lp);

      for(local j = 0; j < 4; j++){
        if(0 == j){
          local rot = ::line3d.rotate1(lp.X, lp.Y, lp.Z, lp2.X, lp2.Y, lp2.Z);
          rot.X += -1.570796;
          item.raw[j].Rotation3D = ::Vector(rot);
          local pitch = rot.X;
          local yaw = rot.Z;
          local rel_y = 1;
          local reloffset = sin(pitch) + 1;
          local X = fp.X + -0.005 * cos(yaw) - ((rel_y * -2) + rel_y + reloffset) * sin(yaw);
          local Y = fp.Y + -0.005 * sin(yaw) + ((rel_y * -2) + rel_y + reloffset) * cos(yaw);
          local Z = fp.Z + 1 + cos(pitch) * -1;
          item.raw[j].Size3D.Y = item.dist;
          item.raw[j].Position3D = ::Vector(X, Y, Z);
        } else if(1 == j){
          local rot = ::line3d.rotate1(lp.X, lp.Y, lp.Z, lp2.X, lp2.Y, lp2.Z);
          rot.X += 1.570796;
          item.raw[j].Rotation3D = ::Vector(rot);
          local pitch = rot.X;
          local yaw = rot.Z;
          local rel_y = 1;
          local reloffset = sin(pitch) + 1;
          local X = fp0.X + -0.005 * cos(yaw) - ((rel_y * -2) + rel_y + reloffset) * sin(yaw);
          local Y = fp0.Y + -0.005 * sin(yaw) + ((rel_y * -2) + rel_y + reloffset) * cos(yaw);
          local Z = fp0.Z + 1 + cos(pitch) * -1;
          item.raw[j].Size3D.Y = item.dist;
          item.raw[j].Position3D = ::Vector(X, Y, Z);
        } else if(2 == j){
          local rot = ::line3d.rotate2(lp.X, lp.Y, lp.Z, lp2.X, lp2.Y, lp2.Z);
          rot.X += -1.570796;
          item.raw[j].Rotation3D = ::Vector(rot);
          local pitch = rot.X;
          local yaw = rot.Z;
          local rel_y = 1;
          local reloffset = sin(pitch) + 1;
          local X = fp.X + -0.005 * cos(yaw) - ((rel_y * -2) + rel_y + reloffset) * sin(yaw);
          local Y = fp.Y + -0.005 * sin(yaw) + ((rel_y * -2) + rel_y + reloffset) * cos(yaw);
          local Z = fp.Z + 1 + cos(pitch) * -1;
          item.raw[j].Size3D.X = item.dist;
          item.raw[j].Position3D = ::Vector(X, Y, Z);
        } else if(3 == j){
          local rot = ::line3d.rotate2(lp.X, lp.Y, lp.Z, lp2.X, lp2.Y, lp2.Z);
          rot.X += 1.570796;
          item.raw[j].Rotation3D = ::Vector(rot);
          local pitch = rot.X;
          local yaw = rot.Z;
          local rel_y = 1;
          local reloffset = sin(pitch) + 1;
          local X = fp.X + -0.005 * cos(yaw) - ((rel_y * -2) + rel_y + reloffset) * sin(yaw);
          local Y = fp.Y + -0.005 * sin(yaw) + ((rel_y * -2) + rel_y + reloffset) * cos(yaw);
          local Z = fp.Z + 1 + cos(pitch) * -1;
          item.raw[j].Size3D.X = item.dist;
          item.raw[j].Position3D = ::Vector(X, Y, Z);
        }
      }
    }
  },
  "dist_2d" : function (x, y, x2, y2){
    return ::sqrt((x - x2)*(x - x2) + (y - y2)*(y - y2));
  },
  "dist_3d" : function (x, y, z, x2, y2, z2){
    return ::sqrt((x - x2)*(x - x2) + (y - y2)*(y - y2) + (z - z2)*(z - z2));
  },
  "rotate1" : function(x1, y1, z1, x2, y2, z2){
    local rotx = ::atan2(z2 - z1, ::line3d.dist_2d(x1, y1, x2, y2));
    rotx = rotx - 1.570796;
    local rotz = -1 * ::atan2( x2 - x1, y2 - y1 );
    if(rotz < -3.141592){
      rotz = rotz + 6.283184;
    }
    return ::Vector(rotx, 0,rotz);
  },
  "rotate2" : function(x1, y1, z1, x2, y2, z2){
    local rotx = ::atan2(z2 - z1, ::line3d.dist_2d(x1, y1, x2, y2));
    local rotz = -1 * ::atan2( x2 - x1, y2 - y1 );
    rotz = rotz + -1.570796;
    if(rotz < -3.141592){
      rotz = rotz + 6.283184;
    }
    local roty = ::atan2(z2 - z1, ::line3d.dist_2d(x1, y1, x2, y2));
    rotx = rotx - roty;
    return ::Vector(rotx, roty,rotz);
  }
}

::line3d.set("test", ::Colour(255,0,0,200), Vector(-29.2778, -1342.03, 12.3133), Vector(-36.4452, -1342.45, 10.3133));
#94
Snippet Showroom / Relative position (in 3d)
Last post by vitovc - Jan 26, 2024, 01:08 PM
I'd wanted to share some functions from my vc-mp archive.

This function will find relative position based by z_angle (vertical angle) and relative X and Y distance from base point.
rel_pos2d <- function(z_angle, pos_x, pos_y, pos_z, rel_x, rel_y, rel_z){
  local rX = pos_x + rel_x * ::cos(z_angle) - rel_y * ::sin(z_angle);
  local rY = pos_y + rel_x * ::sin(z_angle) + rel_y * ::cos(z_angle);
  local rZ = pos_z + rel_z;
  return ::Vector(rX, rY, rZ);
}

This function will find relative position based by z_angle (vertical angle), y_angle (horizontal angle) and distance.
rel_pos3d <- function(dist, pos_x, pos_y, pos_z, y_angle, z_angle){
  local rX = dist * ::cos(y_angle) * ::cos(z_angle);
  local rY = dist * ::cos(y_angle) * ::sin(z_angle);
  local rZ = dist * ::sin(y_angle);
  return ::Vector(pos_x + rX, pos_y + rY, pos_z + rZ);
}
#95
Videos & Screenshots / Re: TOMORROWLAND
Last post by Sebastian - Jan 16, 2024, 06:34 PM
 :o  :o

Damn, I really need to fix that Remmington vehicle handling haha.  ;D

PS: Sorry for being late. I don't get how I didn't see this.
#96
Tutorials / Create / Export collision file...
Last post by Sebastian - Jan 12, 2024, 08:03 PM
Here is a short tutorial about how to create/export collision file using Blender 2.x.x

To be able to import the .dff files, I'm using @maxorator 's plugin:
https://gtaforums.com/topic/522492-rel-blender-dff-io-for-iiivcsa/

There is another plugin based on maxorator's, made by @PerikiyoXD :

https://github.com/PerikiyoXD/io_scene_dff

Also, COL Editor:
https://www.gtagarage.com/mods/show.php?id=1154


As a bonus, I'm explaining in there how to decrease the number of polygons an object has, through 'Decimate' modifier.

What I'm presenting here is just a quick way to create a collision, by using a .dff.
The problem is .dff files represent the visual part, which must be pleasant for our eyes, so the objects will always be detailed and good looking.
Collisions, on the other side, must be very light-weight but to cover the whole surface of an object.
It's invisible after all, so the less polygons the better.

https://www.youtube.com/watch?v=fsVMe8uZt5I

Just to remember, a good collision file means something like this:
- low number of polygons
- cover only the exterior which the player can interact with


Take the beach ball as an example. It has a very round form in game, but the collision itself is not that round.
Why? Because we don't need 100 polygons for Tommy Vercetti to interact with.
Every 10 polygons could be simply replaced by 1 polygon, as Tommy Vercetti will anyway not reach a small polygon between 3 big polygons. So that will be useless polygon.

Same happens for the polygons which are inside a collision object. If they cannot be reached, they lose the point of being called a 'collision', so don't need to be part of a .col file. Just remove them. Keep the ones on surface only.

PS: This tutorial was made by request.
#97
Custom Content Releases / Re: [GTA:VC] Vice City Redux m...
Last post by H.a.S.a.N - Jan 09, 2024, 08:47 AM
Nice mod
#98
Script Showroom / (Java) MTA 0.5 Remake
Last post by Gulk - Jan 08, 2024, 05:45 PM
I wont be giving any support on this, just use IntelliJ and you should be fine.
Database needs postgres.
Builds with maven.

http://homepage.eircom.net/~Gulk1990/mtavcdm(java).zip

It's old and not up-to-par but I'm sure it can be useful or fun.
#99
Custom Content Releases / Re: [GTA:VC] Vice City Redux m...
Last post by Gulk - Jan 08, 2024, 05:03 PM
I see the weapon icons got blurred and lost original details and the radar ring original intention seems to have been to have short of a sheen or glimmer, and the time,money,health would be cool to recreate the dirt effect which is lost and Ken Rosenberg looks very weird without facial definition.

I know these things are pretty obvious and not exactly simple to recreate.


Other than that it seems good.
#100
Custom Content Releases / [GTA:VC] Vice City Redux mod.
Last post by VerC - Jan 06, 2024, 04:29 PM

Hello there!


Vice City Redux is a small modification, which I've been recently working on. Mod brings up fresh and brand new look on in-game interface.
Mod contains:
> High resolution loading screens
> Remastered HUD
> Visually improved menu

Installation guide:
Open your GTA:VC directory and drop there downloaded files.

Additional information about the mod:
 While working on  this modification, I was trying to keep the original look of the game. Most of the GTA:VC "remastered" mods looks really odd and they ruin original feel of the game.
To create that modification I've used textures from other mods, few of them were created and given to me by my friend Xenon and some of them I had to made from the scratch.
However, every single texture I've taken from other mod I've had to edit. Some of the textures were slightly edited, while other were totally remade.
In the readme file I've posted links for the mods I've taken resources from.
Screenshots are posted at the bottom, so you can see how the mod presents.
Note: Mod contains only texture files, so you don't have to worry about viruses. It's completely safe; it contains no malware at all.

Download link: https://drive.google.com/file/d/1zTAUVmib0XalrvJ9RmbxVT2ILEpKArzu/view


I hope you will enjoy the mod. Feel free to share your opinion on it.