Jump to content

HarryDE

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by HarryDE

  1. 12 hours ago, Tut said:

    I can compile a list of offsets if you note the obj names. 
    (that is, if it isn't the entirety of interior objs)

    I'd appreciate if you could tell me your technique to get these offsets because there are lot of objects that I want to use and it would be a hard work to compile all the offsets. So I would do this hard work instead of you :)

    Thanks in advance!

  2. 17 hours ago, Tut said:

    The most likely cause is the collision of the bed is exported at around -2 offset. This is typically the case for models found in GTA_INT img archive, I don't know why that is.

    I don't know if you're scripting-wise able to center pivot/axis of the collision to the game mesh or if your only option is to remodel the collision. For the latter solution I'm not sure if it's possible to use engineReplaceModel for other archives than gta3. I think not, at least not player.img. @HarryDE

    I have checked this function in the map_editor and these object are buggy in the map editor too. 

    Is there any possibility to check the "offsets" of these elements? Because then I could just set another offset for this objects.

  3. Hello. So I'd want to create an object on the cursor position. I have calculated everything, it works fine but there are some objects that do not fit to the calculation. I think the problem can be that the bounding box of this objects are also buggy and I don't know what should I change in my calculation.

    Calculation: 

    local sx, sy = guiGetScreenSize()
    local relX, relY = getCursorPosition()
    cursorX, cursorY = relX * sx, relY * sy
    local camX, camY, camZ = getCameraMatrix()
    local cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ = getWorldFromScreenPosition(cursorX, cursorY, 1000)
    local hit, hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ = processLineOfSight(camX, camY, camZ, cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ, true, true, true, true, true, true, false, true)

    Picture about it: (The red lines show the bounding box of the object)

    40oqDuT.png

  4. Hello. So I'd want to create an object on the cursor position. I have calculated everything, it works fine but there are some objects that do not fit to the calculation. I think the problem can be that the bounding box of this objects are also buggy and I don't know what should I change in my calculation.

    Calculation: 

    local sx, sy = guiGetScreenSize()
    local relX, relY = getCursorPosition()
    cursorX, cursorY = relX * sx, relY * sy
    local camX, camY, camZ = getCameraMatrix()
    local cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ = getWorldFromScreenPosition(cursorX, cursorY, 1000)
    local hit, hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ = processLineOfSight(camX, camY, camZ, cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ, true, true, true, true, true, true, false, true)
    		

    Picture about it: (The red lines show the bounding box of the object)

    40oqDuT.png

  5. 6 hours ago, Tails said:

    Instead of sending a PM, please clarify it here in this thread, so others can help too such as myself.

     

    I explained him the problem better but actually he couldn't even help. :S

    But I can copy here my explanation that I have written in my PM.

    So I have a wall object that has 4 different textures. As this pictures shows: https://imgur.com/CSJBkSU ( Texture names: la_carp3, la_carp4, la_carp5, la_carp6 ) I checked them with shader_tex_names resource from MTA Wiki. But I'd have to get the name of the texture that I click on. For example, I click on the right side of the wall object then the function gives as result: la_carp3. 

  6. So there is the situation:

    There is a wall object that has 4 different textures applied on different side of the object and I would have to get which side of the wall the player is hovering with the cursor. Is there any solution for it?

×
×
  • Create New...