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: [TUTORIAL]How to create a Loginscreen with Lua & XML editing  (Read 59322 times)

Mordred

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 57
    • View Profile
[TUTORIAL]How to create a Loginscreen with Lua & XML editing
« on: April 03, 2012, 10:05:09 pm »
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!DON'T USE THIS ANYMORE!! THERE IS A NEW VERSION OF THE LOGINSCREEN!!!
Here is the link: Easy Loginscreen

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Hey guys!

today I wanna show you how to make a Login screen by only editing the Glue Lua and XML files.

all you need for this tutorial you can find in this link:
filebeam
file-upload


Code: [Select]
1. Setting up your WoW
2. Customize your Loginscreen
2.1 Background
2.2 Music
2.3.1 Buttons
2.3.2 Positions
3. Add M2 models
4. Example


---------------------------------------------------------------------------------------------------




1. Setting up your WoW

At first extract the .rar file in your WoW-directory.
Congrats! First step done!






2. Customize your Loginscreen

2.1 Background

To set the background you just have to create a 1024x1024 .png file
which will have to be at least 75% of the 1024 pixels (768px height) to fill the entire screen.

Once you have finished editing your file save it in your directory:
WoWInterfaceLoginScreen

and name it:
Background.png

Now all you have to do is drag and drop the .png file onto your BLP Converter
and remove the .png file out of the directory.



2.2 Music

To set your background music all you have to do is find your music you like
and put it into the directory under:
WoWInterfaceLoginMusic

and name it:
LoginScreen.wav

After doing that open your music file with any musicplayer
and write down the length of the song (IN SECOUNDS!!!)
eg.: 2:25 -> 145

Now open the vx_vars_init.lua
(WoWInterfaceGlueXML)
press CTRL + F and search for:
VX_MUSICTIMER = GetTime() + <SECOUNDS>;

and remove the <SECOUNDS> with your song lenght.




2.3.1 Buttons

For the Buttons you have to create 5 files:

Code: [Select]
Glues-BigButton-Up   -> the normal button
Glues-BigButton-Down   -> the button pressed
Glues-BigButton-Highlight   -> the button while your mouse is over it
Glues-BigButton-Glow   -> the glow around the button
Glues-BigButton-Rays   -> the pulsing rays when your mouse is over it

You have to save these files as .png files in your directory:
WoWInterfaceGLUESCOMMON

with the names above and then just drag and drop then onto your BLP Converter.
Now remove the .png files out of your directory and your done.




2.3.2 Positions

Now to set up the positions of your buttons you have to open the AccountLogin.XML
in your directory:
WoWInterfaceGlueXML

Press CTRL + F to search for:

Code: [Select]
name="AccountLoginAccountEdit"          -> editbox for entering your accountname
name="AccountLoginPasswordEdit"         -> editbox for entering your password
name="AccountLoginLoginButton"          -> Login button
name="AccountLoginExitButton"           -> Quit button
name="OptionsButton"                    -> Options button
name="AccountLoginManageAccountButton"  -> Manage Account button
name="AccountLoginCommunityButton"      -> Official Site button
name="AccountLoginSaveAccountNameText"  -> Save Account name checkbox text + checkbox

Now to move these you have to look out for these eg.:

Code: [Select]
<Anchor point="BOTTOM">
       <Offset>
       <AbsDimension x="..." y="..."/>
       </Offset>
</Anchor>


with the Anchor point you can set the anchor to a specific destination
eg.: "TOP"  ;  "BOTTOMLEFT"  ;  "RIGHT";  "CENTER"  ;  ...

and with the AbsDimension x and y you can set the x & y - coords from this destination.






3. Add M2 models

At first open your vx_vars_init.lua...

The lines 4 - 9 lines are the definitions of the model.
The model gets added to the Modelframe at the last 3 lines.

In these lines you can change the lines 5 - 9 with the description behind
(SetHeight and SetWidth only if you want to stretch your model, or cut of a piece of the model)

If you want more than one model on your loginscreen, you have to copy the lines 4 - 9 and change every Mod1 in your copied block to Mod2 (if more than two then Mod3, ...)
also you have to add a new "table.insert" behind (with a space and ; between) or under the first "table.insert"
in there you have to write: table.insert(M , Mod<YOUR MODEL NUMBER!>);
eg.: table.insert(M, Mod2);
if you don't add the model to the table "M", the model will reset it's position on logout and returning to the AccountLogin screen.

Now to set the model you have to start your WoWModelViewer and find a model with only 1 skin (else they are white)
then enter your full path of the model into the 2nd last line with double \ and .m2 at the end


PS.: try to set the position of the model in Z+1, most of the time it helps to see the model.

PPS.: keep in mind that every model has different usage of the SetPosition command
     eg.: some use the x and y axes to move in a 2D field and some use the y and z axes to move in a 2D field






4. Example

Here is an example of how you can make your Loginscreen:
[youtube:3i9ibrmo]http://www.youtube.com/watch?v=PzxRd59HdOQ[/youtube:3i9ibrmo]

PS.: I used "World\Kalimdor\silithus\passivedoodads\ahnqirajglow\quirajglow.m2" to do the light effects.

[youtube:3i9ibrmo]http://www.youtube.com/watch?v=F-YwXsLiRmI[/youtube:3i9ibrmo]

[youtube:3i9ibrmo]http://www.youtube.com/watch?v=10m7XDuaMxI[/youtube:3i9ibrmo]


also you should check out alborq's amazing tool for placing models:

Quote
Hello,First of all I thank yours has to be Mordred fantastic job.From my side I studied a little code, then I develop a small application to simplify the placement of 3D model that can happen complicate

So I develop a small application that is used to position the models

Insights api: LINK

Little tutorial:
1) Set the path to your model in the EditBox
2) Click on Add
3) If you do not see your model then increase the size as needed, so you will be close to or one is your model (off-screen)
4) Change the position with XYZ button
5) change the scale with two button above to be more precise
6) meet the position indicate on a notepad
/!  They are not kept for the next time!
7) Completer position in the configuration file:
Mod1: SetPosition (pos_x, pos_y, pos_z);
Mod1: SetModelScale (scale);
Mod1: SetFacing (facing);

8) Enjoy

Download link: http://depositfiles.com/files/x085iqjpw

Special thanks to:
vxsw -> GlueXML AShell
(dunno if it's not his, so don't blame me.)
alborq -> for his tool to place 3D models more easily.


~Mordred
« Last Edit: January 02, 2015, 09:11:38 pm by Admin »
Burn in fire of righteousness!
Easy Loginscreen

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #1 on: April 05, 2012, 07:39:37 pm »
Very nice tutorial. Thansk :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Mordred

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 57
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #2 on: April 05, 2012, 08:37:30 pm »
UPDATE:

added my Login screen for demonstration purposes:
LINK

~Mordred
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Burn in fire of righteousness!
Easy Loginscreen

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #3 on: April 05, 2012, 11:21:18 pm »
Thanks again and hey don´t drink so much ... you are still blue ;)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

Shadowjesper1

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 41
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #4 on: April 06, 2012, 10:57:29 pm »
Do you know how to edit the CC-logo?  or in your case, the wotlk logo atop in the left corner. I have tried doing everything, same size, I am trying to edit it with a nefarian head with the writings <Heartwing>.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Eluo

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 509
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #5 on: April 07, 2012, 12:32:28 am »
wow awsome thanks!

Quote
Thanks again and hey don´t drink so much ... you are still blue ;)
Lol steff :D
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
One is a genius, the other\'s insane!

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #6 on: April 07, 2012, 04:44:53 am »
Just have a look at the code. The logos are just graifc layers. The easyest way is just to swap the original logo. But thn this one is cahnged everywhere. Just creat a new BLP file and search the logo in the .xml file. There you can change tha path.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

phucko1

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 523
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #7 on: April 07, 2012, 04:45:51 am »
Hmm I can't figure out how to add the models :S
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Mordred

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 57
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #8 on: April 07, 2012, 07:59:24 am »
It has a lot to do with testing and trying.

Some models don't work and some has no texture.

All I can say about it is:
try to get something on  your loginscreen,
if it's white, it has no texture,
if it's a blue-white checkered box, it has a wrong pathname.

try to set the z axis to +1 for testing, most of the time it will show a part of the model.

A little bit of Lua knowledge is needed for the model adding section :/

~Mordred
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Burn in fire of righteousness!
Easy Loginscreen

phucko1

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 523
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #9 on: April 07, 2012, 02:07:56 pm »
What would X Y Z be for in the middle of the screen?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

phucko1

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 523
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #10 on: April 07, 2012, 02:30:41 pm »
Also its not possible to make an MPQ instead of placing them in my WoW-directory/interface folder?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Mordred

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 57
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #11 on: April 07, 2012, 03:39:17 pm »
X Y Z is like

Y -> left and right
Z -> up and down
X -> forward and back (only a little bit or else the model disappears)


And yes, it's possible to make it as a patch
just put all the files into a MPQ with
Interface/...
and it should work.

~Mordred
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Burn in fire of righteousness!
Easy Loginscreen

Shadowjesper1

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 41
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #12 on: April 07, 2012, 03:42:29 pm »
Quote from: "Mordred"
It has a lot to do with testing and trying.

Some models don't work and some has no texture.

All I can say about it is:
try to get something on  your loginscreen,
if it's white, it has no texture,
if it's a blue-white checkered box, it has a wrong pathname.

try to set the z axis to +1 for testing, most of the time it will show a part of the model.

A little bit of Lua knowledge is needed for the model adding section :/

~Mordred

Mine is green. Even though it is the same dimensions with the logo atop of the corner.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

phucko1

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 523
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #13 on: April 07, 2012, 03:49:52 pm »
Tried with MPQ and it bugged the crap out of the loginscreen xD
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

phucko1

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 523
    • View Profile
Re: [TUTORIAL]How to create a Loginscreen with Lua & XML editing
« Reply #14 on: April 07, 2012, 08:39:50 pm »
Can I add other animated m2s then creatures? Like flames, portals, etc.
Also can't I just take X.m2 + XSkin00.skin and rename to Y.m2 and YSkin00.skin and it will be the same creature but only 1 skin?
Can I also make them use different animations? Like attack etc.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »