Vice City: Multiplayer

Vice City General => Videos & Screenshots => Topic started by: Luis_Labarca on May 25, 2017, 07:36 PM

Title: .::SkyNet.Real.Life::. Video #2
Post by: Luis_Labarca on May 25, 2017, 07:36 PM
https://youtu.be/8FDHAz_G3uM
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: Sebastian on May 25, 2017, 09:45 PM
Nice fire department !
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: Luis_Labarca on May 26, 2017, 11:03 PM
Quote from: sseebbyy on May 25, 2017, 09:45 PMNice fire department !
Thanks bro :D
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: SAzEe21 on May 27, 2017, 03:45 AM
Nice fire station :)
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: luchgox on May 27, 2017, 05:14 AM
WOW,GOOD WORK!
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: KAKAN on May 29, 2017, 04:37 PM
Great work.
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: Luis_Labarca on May 31, 2017, 01:23 AM
Quote from: luchgox on May 27, 2017, 05:14 AMWOW,GOOD WORK!


Thanks bro ;)
Quote from: Zeeshan.Bhatti on May 27, 2017, 03:45 AMNice fire station :)
Thanks bro ;)
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: EK.IceFlake on May 31, 2017, 05:36 AM
Quote from: Luis_Labarca on May 31, 2017, 01:20 AM
Quote from: EK.IceFlake on May 27, 2017, 02:59 PMYour server is awesome but your client side script is absolutely terrible.
Try using some tables.
I think that if my client-side is terrible, it's not your problem, everyone makes their clien-side as best you can? I do not know that I think One has his ways of how to do it :P

And I do not know what is your problem with me and you have been saying the same thing with my other things for a long time :P
This is not a problem I have with you and this is not meant to belittle you or degrade you (or your client-side scripts) or anything as such. It's just advice to you.
Even my client-side scripts were absolutely terrible and now they've improved but they're still no match for some other people's scripts like @Drake 's.

I'll give you a few recommendations.

1:
Instead of creating many related items like this:
RelatedItemAbc <- null;
RelatedItemDef <- null;
RelatedItemGhi <- null;
Try doing this:
RelatedItems <-
{
    "Abc": null,
    "Def": null,
    "Ghi": null
}

2.
Splitting your client-side script into different files would help, too.

3.
This is more of a continuation to 1. You can nest your tables as well:
GPS <-
{
    "Disk":
    {
        "Ring": null,
        "North": null
    },
    "Map": null
}

GPS.Disk.Ring
GPS.Disk.North
GPS.Map

4.
This is a very serious point. Indent your code.
Not this:
if(Something=="Else")
{
DoSomething();
}
But:
if (Something == "Else")
{
    DoSomething();
}
Notice how cleaner this looks? It also helps a lot when you have a missing brace and for readability overall.

5.
How clean does this look:
        this.LabelNameTeam     <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Team: ")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE | GUI_FFLAG_BOLD)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Float(FloatLocation.BottomRight)
            .Offset(VectorScreen(-256, -128));
(This is taken off a client-side script of mine)

Try making a kind of library which would help with such things. I can't release mine at the moment because it has a lot of bugs which I discover whenever I try to use a new feature.

6.
Use tables for GUIs (this makes creating and cleaning them up a lot easier)
Here's an example (although I've misused classes as tables for whatever reason which I myself don't know. this is a non-instantiable class in case anyone points me out for using the new slot operator here):
class SpawnScreenLabel
{
    LabelNameTeam     = null;
    LabelNameSkin     = null;

    LabelValueTeam    = null;
    LabelValueSkin    = null;

    function Create()
    {
        this.LabelNameTeam     <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Team: ")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE | GUI_FFLAG_BOLD)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Float(FloatLocation.BottomRight)
            .Offset(VectorScreen(-256, -128));
       
        this.LabelNameSkin     <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Skin: ")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE | GUI_FFLAG_BOLD)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Insert(InsertLocation.Below, this.LabelNameTeam)
            .Offset(VectorScreen(0, 4));
       
        this.LabelValueTeam    <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Unknown")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Insert(InsertLocation.Right, this.LabelNameTeam)
            .Offset(VectorScreen(4, 0));
       
        this.LabelValueSkin    <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Unknown")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Insert(InsertLocation.Right, this.LabelNameSkin)
            .Offset(VectorScreen(4, 0));
    }

    function Destroy()
    {
        this.LabelNameTeam     <- null;
        this.LabelNameSkin     <- null;

        this.LabelValueTeam    <- null;
        this.LabelValueSkin    <- null;
    }
}
Now look at this:
SpawnScreenLabel.Create();SpawnScreenLabel.Destroy();Much more expressive and extensible.

7.
Use enums.
Instead of
if (Language == "EN")use
if (Language == Language.English)and define it at the top:
enum Language
{
    English,
    Espanol
}
This is a much more efficient method of accomplishing the same task.

8.
Use post-increment.
When you don't care about what ++ returns, add it before the variable.
for (local i = 1; i < 10; i++)Change it to:
for (local i = 1; i < 10; ++i)This is slightly faster.

9.
Switch cases.
if (element == Something)
{
    ...
}
if (element == SomethingElse)
{
    ...
}
if (element == SomethingEvenElse)
{
    ...
}
It is much more readable and efficient with switch statements:
switch (element)
{
    case Something:
        ...
        break;
    case SomethingElse:
        ...
        break;
    case SomethingEvenElse:
        ...
        break;
}

That's enough for now.
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: Thijn on May 31, 2017, 02:25 PM
@vito1 : a bit of offtopic is fine. I don't ignore reports, I look at them and act accordingly. In this case, there's not much I see completely wrong.
Yes, there's a bit of off topic but as long as we don't go too far off, stick to the server in question and keep it friendly I let it go.
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: Luis_Labarca on Jun 07, 2017, 12:47 AM
Quote from: EK.IceFlake on May 31, 2017, 05:36 AM
Quote from: Luis_Labarca on May 31, 2017, 01:20 AM
Quote from: EK.IceFlake on May 27, 2017, 02:59 PMYour server is awesome but your client side script is absolutely terrible.
Try using some tables.
Ok thanks for your suggestion I thought you had some problem with me I will create another server and I will start practicing the functions this way because I never do it
I think that if my client-side is terrible, it's not your problem, everyone makes their clien-side as best you can? I do not know that I think One has his ways of how to do it :P

And I do not know what is your problem with me and you have been saying the same thing with my other things for a long time :P
This is not a problem I have with you and this is not meant to belittle you or degrade you (or your client-side scripts) or anything as such. It's just advice to you.
Even my client-side scripts were absolutely terrible and now they've improved but they're still no match for some other people's scripts like @Drake 's.

I'll give you a few recommendations.

1:
Instead of creating many related items like this:
RelatedItemAbc <- null;
RelatedItemDef <- null;
RelatedItemGhi <- null;
Try doing this:
RelatedItems <-
{
    "Abc": null,
    "Def": null,
    "Ghi": null
}

2.
Splitting your client-side script into different files would help, too.

3.
This is more of a continuation to 1. You can nest your tables as well:
GPS <-
{
    "Disk":
    {
        "Ring": null,
        "North": null
    },
    "Map": null
}

GPS.Disk.Ring
GPS.Disk.North
GPS.Map

4.
This is a very serious point. Indent your code.
Not this:
if(Something=="Else")
{
DoSomething();
}
But:
if (Something == "Else")
{
    DoSomething();
}
Notice how cleaner this looks? It also helps a lot when you have a missing brace and for readability overall.

5.
How clean does this look:
        this.LabelNameTeam     <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Team: ")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE | GUI_FFLAG_BOLD)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Float(FloatLocation.BottomRight)
            .Offset(VectorScreen(-256, -128));
(This is taken off a client-side script of mine)

Try making a kind of library which would help with such things. I can't release mine at the moment because it has a lot of bugs which I discover whenever I try to use a new feature.

6.
Use tables for GUIs (this makes creating and cleaning them up a lot easier)
Here's an example (although I've misused classes as tables for whatever reason which I myself don't know. this is a non-instantiable class in case anyone points me out for using the new slot operator here):
class SpawnScreenLabel
{
    LabelNameTeam     = null;
    LabelNameSkin     = null;

    LabelValueTeam    = null;
    LabelValueSkin    = null;

    function Create()
    {
        this.LabelNameTeam     <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Team: ")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE | GUI_FFLAG_BOLD)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Float(FloatLocation.BottomRight)
            .Offset(VectorScreen(-256, -128));
       
        this.LabelNameSkin     <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Skin: ")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE | GUI_FFLAG_BOLD)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Insert(InsertLocation.Below, this.LabelNameTeam)
            .Offset(VectorScreen(0, 4));
       
        this.LabelValueTeam    <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Unknown")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Insert(InsertLocation.Right, this.LabelNameTeam)
            .Offset(VectorScreen(4, 0));
       
        this.LabelValueSkin    <- GUILabel(VectorScreen(0, 0), Color(255, 255, 255), "Unknown")
            .SetTypeface("Consolas", 19, Color(255, 255, 255), GUI_FFLAG_OUTLINE)
            .CRemoveFlags(GUI_FLAG_SHADOW)
            .Insert(InsertLocation.Right, this.LabelNameSkin)
            .Offset(VectorScreen(4, 0));
    }

    function Destroy()
    {
        this.LabelNameTeam     <- null;
        this.LabelNameSkin     <- null;

        this.LabelValueTeam    <- null;
        this.LabelValueSkin    <- null;
    }
}
Now look at this:
SpawnScreenLabel.Create();SpawnScreenLabel.Destroy();Much more expressive and extensible.

7.
Use enums.
Instead of
if (Language == "EN")use
if (Language == Language.English)and define it at the top:
enum Language
{
    English,
    Espanol
}
This is a much more efficient method of accomplishing the same task.

8.
Use post-increment.
When you don't care about what ++ returns, add it before the variable.
for (local i = 1; i < 10; i++)Change it to:
for (local i = 1; i < 10; ++i)This is slightly faster.

9.
Switch cases.
if (element == Something)
{
    ...
}
if (element == SomethingElse)
{
    ...
}
if (element == SomethingEvenElse)
{
    ...
}
It is much more readable and efficient with switch statements:
switch (element)
{
    case Something:
        ...
        break;
    case SomethingElse:
        ...
        break;
    case SomethingEvenElse:
        ...
        break;
}

That's enough for now.
Ah I thought that you had something against my pardon and thanks for your suggestion I will start putting it into practice because I have never tried it that way
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: Luis_Labarca on Jun 07, 2017, 12:54 AM
Quote from: Drake on May 31, 2017, 02:01 PM
Quote from: EK.IceFlake on May 31, 2017, 05:36 AMEven my client-side scripts were absolutely terrible and now they've improved but they're still no match for some other people's scripts like @Drake 's.

Which means you have seen XE's client-side scripts too :-X

Not happy about it but oh well, nothing could be done until recently. Well at least you said you did, because I'm sure their are other people out there who did the same thing, would never admit they did and I know one guy but mentioning him would be a disaster.

Don't know if you still have those scripts or not, but I will make it sure that you won't get hands on it again :P

I am not happy I realized after several weeks that I had misplaced the name of the script to hide I put was Main_men.nut instead of Main_mem but hey no matter what you can do nothing :(
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: PunkNoodle on Jun 07, 2017, 01:49 AM
Quote from: Luis_Labarca on Jun 07, 2017, 12:54 AMI am not happy I realized after several weeks that I had misplaced the name of the script to hide I put was Main_man.nut instead of Main_mam but hey no matter what you can do nothing :(
_mem!!! Neither _man nor _mam but _mem. "mem" here is a shortening for "memory".
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: Luis_Labarca on Jun 07, 2017, 02:38 AM
Quote from: PunkNoodle on Jun 07, 2017, 01:49 AM
Quote from: Luis_Labarca on Jun 07, 2017, 12:54 AMI am not happy I realized after several weeks that I had misplaced the name of the script to hide I put was Main_man.nut instead of Main_mam but hey no matter what you can do nothing :(
_mem!!! Neither _man nor _mam but _mem. "mem" here is a shortening for "memory".
I was wrong I was Main_men and I know it's Main_mem.nut
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: EK.IceFlake on Jun 07, 2017, 08:06 AM
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FMdhb0Cp.png&hash=9e2c760ad63fc5e0d8b3406a2232e605a533a1b6)
Title: Re: .::SkyNet.Real.Life::. Video #2
Post by: kennedyarz on Jun 07, 2017, 03:22 PM
A example

Testing<-
{
window = null
Test1 =  null
Test2 = null
Test3 = null
Test4 = null
}

function script::OnScriptLoad()
{
SetMouseEnabled(true);
Testing.window = GUIWindow(VectorScreen(sX * 0.200, sY * 0.100), VectorScreen(sX * 0.600, sY * 0.700), Colour(20, 20, 20, 400), "Example.com", GUI_FFLAG_BOLD | GUI_FLAG_TEXT_TAGS);
Testing.Test1 = GUIButton(VectorScreen(sX * 0.01, sY * 0.01), VectorScreen(sX * 0.100, sY * 0.05), Colour(75, 75, 75), "HI1", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
Testing.Test2 = GUIButton(VectorScreen(sX * 0.01, sY * 0.14), VectorScreen(sX * 0.100, sY * 0.05), Colour(75, 75, 75), "HI2", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
Testing.Test3 = GUIButton(VectorScreen(sX * 0.01, sY * 0.19), VectorScreen(sX * 0.100, sY * 0.05), Colour(75, 75, 75), "HI3", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
Testing.Test4 = GUIButton(VectorScreen(sX * 0.01, sY * 0.24), VectorScreen(sX * 0.100, sY * 0.05), Colour(75, 75, 75), "HI4", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
Testing.window.AddChild(Testing.Test1); Testing.window.AddChild(Testing.Test2);  Testing.window.AddChild(Testing.Test3); Testing.window.AddChild(Testing.Test4);
}

function GUI::WindowClose(window)
{
    if ( window == Testing.window) SetMouseEnabled(false);
        }

function GUI::ElementRelease(element, mouseX, mouseY)
{
if (element == Testing.Test1) Console.Print("Hello x1")
        else if (element == Testing.Test2) Console.Print("Hello x2")
        else if (element == Testing.Test3) Console.Print("Hello x3")
        else if (element == Testing.Test4) Console.Print("Hello x4")
        }
::) ::)