Spawn buyable raidbases at spawnfile (spawns)Solved
hello, is it possible to add a config option to let spawn buyable bases only in the config added spawnfiles? for example
if i change "Distance To Spawn Bought Raids From Player" to 0 it will use the added spawnfile "Spawns Database File (Optional)" ?

and one more question why u dont recommend to use shop/reward plugin to buy raidbases?
yes, you can do that. make sure to put the filename in "Spawns Database File (Optional)"

the reason its not recommended is in the plugin documentation :p
hmm somthing is wrong with adding spawnsfile wit the latest version.  if i use the 1.5.2 version i see it load the spawns
04:44 [Info] [Raidable Bases] Blocked spawn points in 5 zones.
04:44 [Info] [Raidable Bases] Loaded 11 manual spawns.
04:44 [Info] [Raidable Bases] Loaded 11 scheduled spawns.
04:44 [Info] [Raidable Bases] Loaded 11 maintained spawns.
04:44 [Info] [Raidable Bases] Loaded 11 buyable spawns.
04:44 [Warning] Calling 'OnServerInitialized' on 'RaidableBases v1.5.2' took 142ms
04:44 [Info] Loaded plugin Raidable Bases v1.5.2 by nivex
04:45 [Info] RaidableBases was compiled successfully in 2188ms​

but if i use the latest version 1.5.311 i see just this one

04:50 [Info] [Raidable Bases] Blocked spawn points in 5 zones.
04:50 [Info] Loaded plugin Raidable Bases v1.5.311 by nivex
04:50 [Info] [Raidable Bases] Grid initialization completed in 44 seconds and 27 milliseconds on a 5500 size map. 13678 locations are on the grid.

im pretty sure i have a spawnfile and addet it to the new config :o
"Spawns Database File (Optional)": "raidbases"

and raidbases spawn random on the map

ok will check it out. also buyable spawns should have its own spawn file if you want only usable for bought raids
na, i use before just the scheduled with spawnfile and all was good for now i want add buyable raidbases with the last version, and i test it but it spawns always in front of the player this is why i do this suggestion but now i see it dont work anymore for scheduled raidables too :o
I found the bug

Replace

if (!file.Contains(Path.DirectorySeparatorChar))​

With

if (file.Split(Path.DirectorySeparatorChar).Length == 0)​

in RaidableBases.cs and it will load the spawns again
ok it will now load the spawnfiles, but it says "No valid buildings have been configured. Raidable Bases > Building Names in config."
how i need config this ? how it would look? i have for now it empty like this
  "Raidable Bases": {
    "Buildings": {}
  },​

i have for example a profile in oxide\data\RaidableBases\Profiles named RaidEasy need i add it like this

  "Raidable Bases": {
    "Buildings": {"RaidEasy"}
  },

or something else

leave that empty in the config. it'll be removed soon as it's only used for converting to the new datafile system.

all profiles load from oxide\data\RaidableBases\Profiles\ and yours should be there already ...
to show all profiles that are loaded, type in server console or in-game: rb.config list

you must set their difficulty Difficulty (0 = easy, 1 = medium, 2 = hard, 3 = expert, 4 = nightmare)
and change Distance To Spawn Bought Raids From Player to something like 30

honestly there's no reason you should have to edit any of this. if custom spawns works in 1.5.2 for you then it'll work in 1.5.311. i suggest restoring the backup of your config, and let it convert to the new system again. 

the backup file looks like this: RaidableBases.backup_old_system.2020-11-20 01-18-41.json
just rename it to RaidableBases.json
and reload plugin
it'll convert again and should start spawning bases like it does in 1.5.2
hello, i got it now. the problem was here now for me, if i use your fix above they dont want spawn RaidBases. so what have I done now.
i let the old hook to check & spawn RaidBases and create a second one with your new fix above for check the spawnsfile. this help me for now.

this works for spawn raidbases and not for check spawnfile
        public static bool FileExists(string file)
        {
	    if (!file.Contains(Path.DirectorySeparatorChar))
            {
                return Interface.Oxide.DataFileSystem.ExistsDatafile($"copypaste/{file}");
            }

            return Interface.Oxide.DataFileSystem.ExistsDatafile(file);
        }​

and this for check spawnfile and not for spawn raidbases

        public static bool FileExists2(string file)
        {
            if (file.Split(Path.DirectorySeparatorChar).Length == 0)
            {
                return Interface.Oxide.DataFileSystem.ExistsDatafile($"copypaste/{file}");
            }

            return Interface.Oxide.DataFileSystem.ExistsDatafile(file);
        }

 

Yea, I found that out later. I figured out why it was bugged and it'll be fixed in the next update
Locked automatically