This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] Login Screen M2 Camera  (Read 1258 times)

Rem

  • Registred Member
  • MWCS Enthusiast
  • *****
  • Posts: 2
    • View Profile
[QUESTION] Login Screen M2 Camera
« on: June 14, 2014, 06:47:14 pm »
I've been trying some things after reading ]Mordred's Tutorial but the cameras are driving me mad. There are some wonderful models but they lack of cameras, so when I place it on the Login Screen Via Lua Editing they look copletly wrong... they are always seen from the upside and they move a lot when changing screen resolution.

I've been trying to copy some bytes from another m2 using 010 hex editor (the ones related to camera, like ncameras and "camera structure" and such) but I keep breaking the models with no results. I've also checked the pxr page about cameras (I can't link it >.<) but barely understood anything and It doesn't even mention "camera structure".

Is there a way to copy the camera from a functional m2 (lke an npc) and paste it on a broken m2? The file I want to add cameras to is on "SpellsInstanceNewPortal_Purple.M2".

I've been trying to figure it out for days without a result, so any help would be appreciated.

Edit: Corrected some terrible grammar mistakes D: it was late and my brain wasn't working quite well.
« Last Edit: June 15, 2014, 10:44:45 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Login Screen M2 Camera
« Reply #1 on: June 14, 2014, 08:45:56 pm »
Of course the wiki mentions cameras. http://wowdev.wiki/index.php?tit ... LK#Cameras
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rem

  • Registred Member
  • MWCS Enthusiast
  • *****
  • Posts: 2
    • View Profile
Re: [QUESTION] Login Screen M2 Camera
« Reply #2 on: June 15, 2014, 10:35:55 am »
It does mention "nCameras" and "nCameraLookup" but there's nothing about the table "camera structure". Also, I've tried to copy the "nCameras" table and the "nCameraLookup" from an NPC but the M2 just broke... And I think "camera structure" has to do with it.

I want to know how to copy a funcioning camera from a working M2 to a cameraless one but couldn't figure which data should I copy... I heard it could easily be done with 010 editor but I haven't seen anything about it on the web, and attempts to do it on my own (and blindly xD) have broken the model so far.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Login Screen M2 Camera
« Reply #3 on: June 15, 2014, 11:28:26 am »
I linked directly to "camera structure"... Directly copying will not work due to animation blocks, which are documented there as well.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Chase

  • Registred Member
  • Loreweaver
  • *****
  • Posts: 116
    • View Profile
Re: [QUESTION] Login Screen M2 Camera
« Reply #4 on: June 15, 2014, 03:39:55 pm »
I too was having problems with the cameras on the login screen.

Due to me accidentally forgetting to comment something out, I learned that if you set a model that has the camera you want first, (front facing camera) you can then set the model 2 frames after and it will still use the non existent camera.

With the help of Mordred this is the code we came up with the fight the missing cameras annoyance without hex editing.

First we changed the ModelFFX Frame inside AccountLogin.xml to a frame. Just replace ModelFFX with Frame.

Run the login screen, you'll see a few things pop up as errors. Go to those and comment them out.

Next, this is the code at the bottom of my AccountLogin.lua (minus some of my stuff that wasn't needed like the background.)
Code: [Select]
DivX_AccountLogin_OnLoad = AccountLogin_OnLoad

local timed_update

function AccountLogin_OnUpdate()
if timed_update == true then
DivXSpiritHealer:SetModel("Creature\Spirithealer\spirithealer.mdx")
DivXSpiritHealer:SetModelScale(0.25)
DivXSpiritHealer:SetPosition(0, .025, 0)
DivXSpiritHealer:SetAlpha(0.75)
DivXSpiritHealer:Show()
timed_update = false
elseif timed_update == nil then
timed_update = true
end
end

function AccountLogin_OnLoad(self)
DivX_AccountLogin_OnLoad(self)

CreateFrame("Model", "DivXSpiritHealer", self)
DivXSpiritHealer:Hide()
DivXSpiritHealer:SetAllPoints(self)
DivXSpiritHealer:SetFrameLevel(1)
DivXSpiritHealer:SetModel("Character\Human\Male\HumanMale.mdx")
DivXSpiritHealer:SetCamera(1)

AccountLogin:SetScript("OnUpdate", AccountLogin_OnUpdate)
end

This overrides AccountLogin_OnLoad (but still keeping it intact by setting something else to it.)
It creates a model with our now-a-Frame AccountLogin
It sets the model to HumanMale, which has the camera 1 that you are looking for.
Then it sets a OnUpdate function for AccountLogin, due to some weird bug that you have to wait a bit before you set a model because sometimes it wouldn't work.
Lastly, two frames later with the help of timed_update from Mordred, we set the model back to a Spirit Healer which does not have the camera 1.

Voilà your model is using a camera that no longer exists.

Obviously, edit the variables to your needing, I made this for a server I play on.

[attachment=0:1qubfbhe]Login Screen.png[/attachment:1qubfbhe]
« Last Edit: January 01, 1970, 01:00:00 am by Admin »