DLC Super Yacht - Variations

Hey all, So i have recently been playing around with the offices and various other parts from the DLC’s that have been released over time. However i now am stuck with the Yachts, Does anyone know how to change the type, lighting and names of them? I have tried looking all over the internet with no luck other than one scripthook script but no source or github for it.

Any ideas or directions to point me in?

SetObjectTextureVariant

for lighting and names you probably have to do some research in decompiled R* scripts (am_mp_yacht for example).

Thank you dude, though it is proving difficult to locate the yacht object amongst some other issues. Still no luck.

Does anyone have any other ideas on how to get this working, i know loading the yacht objects them selves is done by IPL but i cannot get anything else to function. i have tried adding them as interior props.

I have got the textures working now though thanks to @f2b97065a36c532a7113 's reply

Okay now just flags, names and lighting to get to work.

Lighting now working:

Jacuzzi also now working well the texture atleast. (You dont get wet…?)

2 Likes

thats pretty cool man

thank you dude, Im trying to get the last two pieces working which is the flags and then the names on the yachts.

I just used the function below but it does not work.
How to do ?

if not HasModelLoaded(GetHashKey("apa_mp_apa_yacht"))then 
			RequestModel(GetHashKey("apa_mp_apa_yacht"))
		end
		mocIntCarMod = GetClosestObjectOfType(-1995.725, -1523.694, 5.42997, 10.0, "apa_mp_apa_yacht", 0, 0, 0)
		SetObjectTextureVariant(mocIntCarMod, 4)

Okay since i seem to be getting a few people messaging me about this but of research i thought i would just share my initial findings and hopefully as a collective we can figure the full way to get all of this working. Below you will find a function which you should be able to call on on the player spwaned event. This will create a yacht in the top left corner of the map near to the land (ish). Please do not come complaining of something not working as this was experiment and research only and not a release. Use at your own risk. For anyone interested i will make this into a resource soon so that most people can use it. Check back soon for that and anyone interested in assisting please feel free to make a PR. https://github.com/Starystars67/FiveM-Galaxy-Super-Yacht/tree/master

function SetUpYacht()
  Citizen.CreateThread(function()
    --YACHT_NAME()
    --INITIALISE(100)
    --SET_YACHT_NAME("YTGN", false, "gb")
  	RemoveIpl("apa_yacht_grp12_1")
  	RemoveIpl("apa_yacht_grp12_1_int")
  	RemoveIpl("apa_yacht_grp12_1_lod")
  	RemoveIpl("apa_yacht_grp12_2")
  	RemoveIpl("apa_yacht_grp12_2_int")
  	RemoveIpl("apa_yacht_grp12_2_lod")
  	RequestIpl("apa_yacht_grp12_3")
  	RequestIpl("apa_yacht_grp12_3_int")
  	RequestIpl("apa_yacht_grp12_3_lod")
  	RemoveIpl("apa_ch2_superyacht")

    local interiorId

  	interiorId = GetInteriorAtCoords(-381.77390000, 6946.96000000, 5.42995500) --GetInteriorFromEntity(GetPlayerPed(-1))

  	local items = {
  		[1] = GetHashKey("apa_mp_apa_yacht_radar_01a"),
  		[2] = GetHashKey("apa_mp_apa_yacht_option3"),
  		[3] = GetHashKey("apa_mp_apa_yacht_o3_rail_a"),
  		[4] = GetHashKey("apa_mp_apa_yacht_launcher_01a"),
      [5] = GetHashKey("apa_mp_apa_y3_l2b"),
      [6] = GetHashKey("apa_mp_apa_yacht_jacuzzi_ripple1")
  	}
  	for i=1,#items do
  		RequestModel(items[i])
  	end

    local loading = true
    while loading do
      Wait(0)
      loading = false
      for i=1,#items do
        if not HasModelLoaded(items[i]) then
          loading = true
        end
      end
    end

  	RefreshInterior(interiorId)
    DisplayHelpText(interiorId)

    for i=1,#items do
      local x = GetClosestObjectOfType(-381.77390000, 6946.96000000, 5.42995500, 100.0, items[i])
      SetEntityAsMissionEntity(x, true, true)
      DeleteEntity(x)
    end

    local e = GetClosestObjectOfType(-381.77390000, 6946.96000000, 5.42995500, 0.1, GetHashKey('apa_mp_apa_yacht'))


    Wait(1000)
    for i=1,#items do
      local pos = GetEntityCoords(e)
      local h = GetEntityHeading(e)
      local o
      if i == 1 then
        o = CreateObject(items[i], pos.x+1.715, pos.y-1.05, pos.z+13.05, true, true, true)
      elseif i == 3 then
        o = CreateObject(items[i], pos.x, pos.y, pos.z-7.225, true, true, true)
      elseif i == 5 then
        o = CreateObject(items[i], pos.x, pos.y, pos.z-4.05, true, true, true)
      elseif i == 6 then
        o = CreateObject(items[i], pos.x-13.9, pos.y-49.0, pos.z-0.9, true, true, true)
      else
        o = CreateObject(items[i], pos.x, pos.y, pos.z-5.227, true, true, true)
      end
      SetEntityHeading(o, h)
    end
    SetObjectTextureVariant(e, 9)


    DrawEmptyRect("apa_prop_ap_name_text", "apa_prop_ap_name_text")
    while true do
      Wait(0)
      DrawYachtName(name)
      ModifyWater(-396.0, 6892.68, 5.0, 0.0)
      --SetRainFxIntensity(0.0)
      --SetWavesIntensity(0.0)
    end
  end)
end
1 Like

Not sure if it will work but have your tried to make it print an output of what textures aren’t loading? The print function helps me with a lot of debugging myself

Hi @ryz0o , Who are you in reply to there?

I don’t know why you mean by that?

You said the above and im not sure who you have written that too. Is it directed towards my self or MrGeorayman200?

If it was meant for me then thank you but my code that i shared works with the exception of flags and text to name the yachts.

Edit i think i have answered that there my self possibly. Sorry for being a little slow if it was not for me, its really early for me.

No no, I’m saying if you make a print, and give it an output you may be able to find the code for the flags and text. I didn’t mean to discredit your work haha was simply trying to help.

PS; if you tell me how you’re finding all the stuff you already are, I can dig with you and maybe help find it for you.

Oh right, i see sorry, it was very early for me at the time and i have a lot going on. If you check the github you can find the current work and where i am digging to find various bits of info relating to it. The help would be appreciated.

as you can see in there i have a markdown file that has various functions relating to possibly doing the name and flag related things using scaleforms but im not sure if these would be correct as of yet.

I would imagine the flag needs to be an object that then has a texture variant applied.

Any updates on this? Would be great to have yachts that we can spawn in and customize!
I found some lua code here: https://repl.it/repls/KlutzyFrankPenguin
not sure if it can be used / not

Sorry i took time off and forgot about this. That what you have just sent is amazingly helpful. Thank you!
I will look at coming back to this sometime this week! Feel free to help out on the github with it too.

1 Like

I’m glad it was helpful!
I think this plugin would be widely used if we can get it to work properly :slight_smile:
I am not as experienced with coding as you may be!
Let me know how it goes!

Will do

any updates?