Oxide Configuration System

D

DC4 | SERGEY

Guest
Good afternoon.
Tell me, please, can I expect to add mod system configuration as in fashion OXIDE?

example

 
D

DC4 | SERGEY

Guest
Why should we need the same stuff as oxide fougerite is already good with this
I just asked - will this be added :) - just this idea is very good in terms of the system of configs

For example, if you want to save a list of vectors - in the ini file you need to output extra keys
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Good afternoon.
Tell me, please, can I expect to add mod system configuration as in fashion OXIDE?

example

INI:
[Settings]
Enabled=True
Disable Some Setting=False

[Data]
List Of Users=Jakkee,DreTaX,RustBuster
VectorOfSomeLocation=296,-55,738

[Messages]
HelpMsg1=--------Help Commands--------
HelpMsg2=/help, /kill, /die, /tp
SomePluginMsg1= {0} does not have permission for command {1}
SomePluginMsg2=Round {0} is starting in {1} seconds
In some ways it's the same,
What are you trying to do? We'll happly help you
 
  • Winner
Reactions: salva
D

DC4 | SERGEY

Guest
INI:
[Settings]
Enabled=True
Disable Some Setting=False

[Data]
List Of Users=Jakkee,DreTaX,RustBuster
VectorOfSomeLocation=296,-55,738

[Messages]
HelpMsg1=--------Help Commands--------
HelpMsg2=/help, /kill, /die, /tp
SomePluginMsg1= {0} does not have permission for command {1}
SomePluginMsg2=Round {0} is starting in {1} seconds
In some ways it's the same,
What are you trying to do? We'll happly help you
Well, for example, I have 5 points for spawn allow in the Arena - how do I put these 5 points in 1 Iniparser? That was compact!

This does n't suit you!

Point1=Vector3
Point2=Vector3
Point3=Vector3
Point4=Vector3
Point5=Vector3

It would be nice if you added a system of configuration files like in oxide :)
 

ice cold

Active Member
Trusted Member
Member
Oct 24, 2016
606
876
43
Canada
Well, for example, I have 5 points for spawn allow in the Arena - how do I put these 5 points in 1 Iniparser? That was compact!

This does n't suit you!

Point1=Vector3
Point2=Vector3
Point3=Vector3
Point4=Vector3
Point5=Vector3

It would be nice if you added a system of configuration files like in oxide :)
then it makes a new cfg file with that spawn points and cords in it
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
577
612
63
Well, for example, I have 5 points for spawn allow in the Arena - how do I put these 5 points in 1 Iniparser? That was compact!

This does n't suit you!

Point1=Vector3
Point2=Vector3
Point3=Vector3
Point4=Vector3
Point5=Vector3

It would be nice if you added a system of configuration files like in oxide :)

Maybe it would be easier for you to use lists, in case handling an ini is more difficult for you.

In the following example I will show you how to spawn players to random zones:

C#:
private String[] lista = { "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", };
public static System.Random rnd;

public void On_Command(Fougerite.Player player, string cmd, string[] args)
        {
            if (cmd == "teleport")
            {
                rnd = new System.Random();
                string locas = lista[rnd.Next(0, 9)]; // 9 number of locations
                Vector3 pos = Util.GetUtil().ConvertStringToVector3(locas);
                player.TeleportTo(pos);
                player.Message( "Spawned at:  " + locas);
            }
        }
Obviously it is an incomplete code, but it is a good example and fully functional. If your goal is to have the file accessible instead of having to edit the code to change the locations .... you just need to import the list from a .txt file to the string, greetings
 
  • Like
Reactions: ice cold
D

DC4 | SERGEY

Guest
Maybe it would be easier for you to use lists, in case handling an ini is more difficult for you.

In the following example I will show you how to spawn players to random zones:

C#:
private String[] lista = { "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", "(6000,450,-3500)", };
public static System.Random rnd;

public void On_Command(Fougerite.Player player, string cmd, string[] args)
        {
            if (cmd == "teleport")
            {
                rnd = new System.Random();
                string locas = lista[rnd.Next(0, 9)]; // 9 number of locations
                Vector3 pos = Util.GetUtil().ConvertStringToVector3(locas);
                player.TeleportTo(pos);
                player.Message( "Spawned at:  " + locas);
            }
        }
Obviously it is an incomplete code, but it is a good example and fully functional. If your goal is to have the file accessible instead of having to edit the code to change the locations .... you just need to import the list from a .txt file to the string, greetings
I think it was all easier - if you added a configuration system with oxide

test.json

Code:
{
{
  "Vector3":{
    6000,450,-3500,
      6001,451,-3501,
      6002,452,-3502
  }
}
}
 

salva

Friendly self-taught developer
Administrator
Jan 31, 2016
577
612
63
I think it was all easier - if you added a configuration system with oxide

test.json

Code:
{
{
  "Vector3":{
    6000,450,-3500,
      6001,451,-3501,
      6002,452,-3502
  }
}
}
Because everyone is worried about using json ?, forget about that ... There are many ways to use a config file (.txt .ini .xml, etc), experiment with new things and do not get stuck in json, open your mind xd
 
D

DC4 | SERGEY

Guest
Because everyone is worried about using json ?, forget about that ... There are many ways to use a config file (.txt .ini .xml, etc), experiment with new things and do not get stuck in json, open your mind xd
It's not that