Features you'd like to see.

Started by ., Mar 23, 2016, 09:00 PM

Previous topic - Next topic

Mötley

I feel that garages are un-professional. And to remove the door and build it yourself is a little bit on the lame side, compared to the garage sound being synced,

I prefer to use the default usage of the garages like in Liberty Unleashed.

Well since the front page of Liberty unleashed says

QuoteSome of you keen-eyed folks out there may have noticed another person in the developers list the last few days, that person being maxorator, which many of you know is the main developer of VC:MP so let me explain.

Some of you may know that the LU team have had a close relationship with VC:MP for quite some time. We have always been in contact with the developers exchanging ideas and we have created some unofficial addons for the mod (such as the hugely popular VCMP Squirrel server) and after some discussion we decided that it would be in everybodies best interests if we join forces :)   

What does this mean? Simply put it means that the VC:MP team have full access to the LU source and likewise with the LU team. We will all be working on the two projects simultaneously, implementing similar ideas and fixing the odd bugs here and there to ensure that the GTA community get two great multiplayer mods for two different games.

We all hope to be able to show the results of our collaboration soon, either in the form of an LU beta or a VC:MP one. But for now, give Maxorator, Falcon and Bakasan a big hearty welcome!
This should be simple to accomplish I hope, I hope to see this in a future update as well as possibly loading the original game icons in scripting alike LU

karan20000000000

player.AcceptInput()
I suggested this to Stormeus before and I guess he has forgotten. In lame words its something like, server pressing the 't' key for the player and the player just starts typing.
With regards,
KP
------------------------------------------

EK.IceFlake

@KAKAN
RestartServer is for pure restart of the server not the script.
AcceptKeys so if you bind a key, you can choose which players when pressed the key should trigger the function (sorry, too lazy to correct my English here)
@S.L.C
No .exe! I can already do it through batch and system("exit"); but I want to do it on linux

.

#18
@karan20000000000 Already had that discussion with @Stormeus. I can't find the IRC logs but essentially it was like this. The server provided a function like CaptureInput(player_id) and when that function was called on a player all the player input would be streamed to a callback like onPlayerInput(player_id, character). Or a list of characters that is sent in groups to the server every few frames to avoid flooding the server with each individual character. The only key that cannot cannot be captured is the Esc key which can be used by the client to leave the input mode manually. Or automatically by the server with a function like ReleaseInput(player_id). Normally, there should also be callbacks when the user actually enters/leaves input mode since he can leave manually from this mode.

But either way, this is not something that can be implemented by me. So what we're talking here is just an idea.



@NE.CrystalBlue Come on man, restart? Are you serious? What kind of use does that thing have? That thing is implemented in the script that starts the server. Why do you think I asked Stormeus to allow custom exit/shutdown codes so that I can tell that script if I want to restart now,later or simply shut down.



Guys tbh these are some of the most selfish and finical (if it's the right word) features that one could ask. None of these will be useful when it comes to programming. The only thing that made sense was the get file list function which was already planed.

I asked you for good helpers and utilities that save you from repeating code like the built-in command system or other various functions which cannot be easily implemented via script and would help in therms of performance if they were built on the C++ side.

I didn't asked you to pour on me the things that the developers aren't implementing like GUI or NPC or other sh!t that I couldn't possibly implement on a god damn scripting plugin.

I didn't asked for useless features that feel like they've come from the mouth of the most laziest programmer and only "useful" to that person and no one else.

I was tempted to lock the topic because it had no purpose but then I changed my mind and decided to leave it open in the hope that someone actually understood what I meant.



This is what I meant with things that save you from repeating code:

.

ysc3839

I hope VCMP could open source. So we can do everything we want.

.

#20
Quote from: ysc3839 on Mar 25, 2016, 10:27 AMI hope VCMP could open source. So we can do everything we want.

Not completely though! Maybe they could do like MTA did and make it in such a way that allows you to contribute to the client but the network code is closed source. That way people can't troll the f* out of servers. I mean, let's be honest. This is the home of VC:MP. Some of the worst butt-hurt people can be found here. And if you don't do as they please. You're f*ed.

Quote from: ysc3839 on Mar 25, 2016, 10:27 AMSo we can do everything we want.

That's the real scary thing. People always find a way to ruin things. ALWAYS
.

.

#21
Quote from: vito on Mar 25, 2016, 12:29 PM
Quote from: S.L.C on Mar 24, 2016, 05:31 PMGuys come on? MP3 Sounds? This is not something I can possibly implement.
How about looping sounds at last?

Seriously man? Sounds again? If you know your sound is 1 second long. Then just create a routine which repeats that song every 1 second:
SqRoutine(
    /* environment -> */ getroottable()
    /* function to be called -> */, PlaySound,
    /* every 1 second -> */ 1000,
    /* forever... -> */ 0,
    /* arg 1: world id -> */ 0,
    /* arg 2: sound id -> */ 99999,
    /* arg 3: position -> */ Vector3(0.0, 0.0, 0.0)
).SetTag("RepeatSound99999");

// Later if I want to stop it
SqRoutine.FindByTag("RepeatSound99999").Terminate();

Why is this so hard :-\
.

.

@aXXo Here's that example I promised. You need to download the x32 bit server executable because I have't included it (obviously). And if you're wondering why is the DLL so big, is because it's a debug build.

This link expires in about 48 hours: http://expirebox.com/download/a69d4ac23eee91360d4c638fa0b9eab1.html

Basically, it's a simple dummy script that creates 2 pickups. One that can be picked up only by a certain player and one that can be picked up only by players of a certain level. It's a very simple script that tries to demonstrate that the plug-in works best when OOP is used.

Uses the internal player level which is nothing more than e simple integer that tells the level of that player. For example 0 = guest, 1 = user, 2 = frequent user, 3 = vip, 4 = moderator, 5 administrator etc. (you can also implement your own style of checking the authority level of a user)
You have a dummy command there to change your level.

Please note that this is affected by a bug(?) in the server and if you close the server with Ctr+C while spawned you'll get a crash. Dunno where this comes from because it happens in the official plugin as well. Although I'll try to look into it later to see why this happens.
.

EK.IceFlake

What about the acceptkeys one? That'd add efficiency to keys

.

Quote from: NE.CrystalBlue on Mar 25, 2016, 01:02 PMWhat about the acceptkeys one? That'd add efficiency to keys

Can you elaborate?
.

aXXo

Looks great @S.L.C I . I guess you would need to spend a lot of time to document stuff in the wiki because this is very different from the usual coding practices in GTA-MP. Expect a lot of tears ;D

SqCmd.Create("getauth", "i", ["level"], 1, 1)What are the params? Command name, expected typeof args, expected argument description, min arguments, max arguments?



Will this plugin improve error handling?
In previous plugin the syntax error reported for a script which is loaded through dofile() statement was not very expressive, example:

Main.nut consists
Line 1: dofile("A.nut");

Assume there was a syntax error inside A.nut, at line 10.
The server would report the error in Main.nut Line 1: expression expected. It would be cool if it could locate the syntax error inside A.nut with accurate line and column number like it does with the Main script.

There are also some other errors which are not very expressive. I can't recall them exactly right now, but I'll try:
"No overlord match for this argument list found"...something like that occurs when a global function is missing the double semi-colon.
"Invalid parameter passed to function, found instance, expected table".....something like that maybe. I don't remember what or why this occurred, but I remember their was nothing wrong with parameters and it was a pain in the ass to locate the actual error.



Is it possible to have events for player's ping and FPS?
Something like player.onPingUpdate() and player.onFPSUpdate()

or SetPingLimit([int] ping), SetFPSThreshold([float] FPS) that would set the Ping/FPS limit on a server
and player.onPingBreach(), player.onFPSBreach() which will be called everytime a lagger surpasses those limits.
finicky level 8999 :)

Running a routine to calculate the average Ping and FPS of every connected player on the server might not be a good idea performance-wise.

.

#26
@aXXo The command system was briefly explained in the main  topic. Some of the features have changed though and some are new but the concept should be the same.

First argument is the command name.

Second are the command masks for each argument. At the moment it supports the following specifiers:

  • i The argument accepts integer.
  • f The argument accepts floating point number.
  • b The argument accepts boolean.
  • s The argument accepts string.
  • l The argument accepts string which is converted to lowercase automatically.
  • u The argument accepts string which is converted to uppercase automatically.
  • g This argument is a greedy argument. Anything after this argument is captured as a string and no further parsing is done.

And you can combine them if one argument accepts multiple types of values.

Let's say that your command expects integer or float for the first argument, boolean for the second, uppercase string for the third and integer, float or boolean for the fourth. Then your mask should be like:
"if|b|u|ifb"
That way the command system knows how to parse the parameters and what values to expect.

Third argument is the argument names. You don't necessarily need to specify any but it helps a lot if you do. For example, let's say I'm creating a register command with 3 arguments. I'll probably specify ["name", "password", "email"].

The fourth and fifth argument is the minimum and maximum arguments that the command needs. When calling the command you only need the minimum and the rest is optional. You can have up to 16 arguments. I believe that's a fair number.

Because I specified argument names I can enable the .Associate option on the command which instead of giving me an array as the 'args' parameter it sends a table with each argument and the associated value that was extracted from the command.

Which is what this line does:
SqCmd.FindByName("getauth").Associate = true;NOTE: I'm searching for the command because I haven't saved it into a variable or something when I created it like:
cmd_getauth <- SqCmd.Create("getauth", "i", ["level"], 1, 1);
Which is why I'm able to refer to the argument by it's name in the callback function:
player.Authority = args.level;
Instead of:
player.Authority = args[0];
Another nice feature is that if I named the arguments I can use the .Generate() method to generate information about the command based on argument names and  types. This is done automatically when you create the command but can later on be called manually if you modify anything in the command.

Example:
print( SqCmd.Create("test", "is|f|b|g", ["nameorid", "angle", "enable", "message"], 3, 4).Info );
Output:
<nameorid:integer,string> <angle:float> <enable:boolean> <*message:...>NOTE: The '*' means the argument is optional.

Which makes it easy to make an info command that tells information about all other commands for example:
SqCmd.Create("cmdinfo", "s", ["name"], 1, 1).BindExec(this, function(player, args)
{
    // Find the requested command
    local cmd = SqCmd.FindByName(args.name);
    // Does it exist?
    if (cmd == null)
    {
        player.Message("This command doesn't exist");
    }
    else
    {
        player.Message("Command Info: %s %s", args.name, cmd.Info);
    }
});

SqCmd.FindByName("getauth").Associate = true;

And you no longer have to document your commands manually. And a bunch of other features like Failure Callback, Post-Execution Callback, Custom, Authority Callback, Help message (actual text by you telling what the command does), Custom error handling and much more.

Not to mention that you remove a lot of the useless Squirrel code required to extract the arguments which make commands much faster and safer.



Quote from: aXXo on Mar 25, 2016, 11:10 PMWill this plugin improve error handling?
In previous plugin the syntax error reported for a script which is loaded through dofile() statement was not very expressive...

I am still trying to improve that but I believe the generated message is much more clear and gives you a nice trace-back of the function calls back to the root where the first call originated. As well as their call-stack level and the variables that existed on those levels at the time of the exception.




Quote from: aXXo on Mar 25, 2016, 11:10 PMIs it possible to have events for player's ping and FPS?
Something like player.onPingUpdate() and player.onFPSUpdate()

or SetPingLimit([int] ping), SetFPSThreshold([float] FPS) that would set the Ping/FPS limit on a server
and player.onPingBreach(), player.onFPSBreach() which will be called everytime a lagger surpasses those limits.
finicky level 8999 :)

Running a routine to calculate the average Ping and FPS of every connected player on the server might not be a good idea performance-wise.

Those would have to be implemented by the developers. But since it's not a feature needed by too many people I'd say it won't be implemented any time soon. And if I were to implement it then I'd probably make a separate module for them because I don't want to enforce such feature on everyone. Since it adds more stress to calculate and like I said, it's not something critical or needed by most people.
.

EK.IceFlake

Let's suppose you bind key lshift for ultra superman jump
BUT
you only want this to vip members. If every member calls the function = laggg!
so you do for all non vip members
player.AcceptKeys(LSHIFT, false);
tada lag finished

KAKAN

Quote from: NE.CrystalBlue on Mar 26, 2016, 04:42 AMLet's suppose you bind key lshift for ultra superman jump
BUT
you only want this to vip members. If every member calls the function = laggg!
so you do for all non vip members
player.AcceptKeys(LSHIFT, false);
tada lag finished
function onKeyDown( player, key ){
if( player.Level < 2 && vipkeys.find(key) != null ) return;
else{
//TADA!
}
}
vipkeys is an array, and you know what it should contain :)
oh no

KAKAN

Quote from: S.L.C on Mar 25, 2016, 11:56 PMThose would have to be implemented by the developers. But since it's not a feature needed by too many people I'd say it won't be implemented any time soon. And if I were to implement it then I'd probably make a separate module for them because I don't want to enforce such feature on everyone. Since it adds more stress to calculate and like I said, it's not something critical or needed by most people.
Though, I want the onFPSUpdate/Change thingy :D I want to set a FPS limit too.
onPingChange is also a good thing. It can be done by the server using a 0 ms timer, but it would lag the server out too!
oh no