Author Topic: Get rid of all maps in SDK  (Read 6180 times)

Get rid of all maps in SDK
« on: August 20, 2017, 03:35:18 am »
Hi all,

I'm trying to set up some sort of modding environment out of the Fonline SDK with just one single map where the players will all spawn.

I deleted all of the maps in maps folder except for NCR and modified Locations.cfg to get rid of all areas except for one for NCR:
Code: [Select]
[Area 1]
name=NCR
size=24
visible=1
auto_garbage=0
geck_visible=0
map_0=ncr*0
entrance=$0 0, 0 10, 0 11, 0 12
#@IsTown=1
#@IsTCTown=1
#@IsPublic=1

However, when starting up the server, it can't load it:
Code: [Select]
[13:710] Load location and map prototypes...
[13:711] MapManager::LoadLocationProto - Can't parse data in location<NCR>, map index<0>.
[13:711] Load location<1> fail.
[13:723] Load location and map prototypes fail, errors<1>.
[13:723] Initialization fail!

I'm guessing probably something's wrong in the definition of [Area 1]

I appreciate any help!
« Last Edit: August 21, 2017, 09:44:10 pm by wizardmachine »
Best,
wizardmachine

Re: Get rid of all maps in SDK
« Reply #1 on: August 20, 2017, 05:31:58 pm »
Fix this line:
Code: [Select]
map_0=ncr*0

Re: Get rid of all maps in SDK
« Reply #2 on: August 20, 2017, 06:17:05 pm »
Thanks for the reply.

Could you elaborate what's wrong with that line?
Best,
wizardmachine

Re: Get rid of all maps in SDK
« Reply #3 on: August 20, 2017, 10:11:30 pm »
Space missing after *

Re: Get rid of all maps in SDK
« Reply #4 on: August 20, 2017, 10:52:51 pm »
I guess you mean something like this:

Code: [Select]
map_0=ncr* 0
That produces the same output, though.

Could it be something wrong with the stuff I have inside the maps folder? Maybe I deleted too many files or something like that.
http://imgur.com/a/HQxBj
Best,
wizardmachine

Re: Get rid of all maps in SDK
« Reply #5 on: August 21, 2017, 04:25:01 am »
try mapindex greater than 0 maybe it has problem with zeros

Re: Get rid of all maps in SDK
« Reply #6 on: August 21, 2017, 09:43:01 pm »
Hi,

Thanks for the suggestion. Now at least the error message changes:

Code: [Select]
[13:439] Load location and map prototypes...
[13:462] MapManager::LoadLocationProto - Entire<11> not found on map<0>, location<NCR>.
[13:462] Load location<1> fail.
[13:477] Load location and map prototypes fail, errors<1>.
[13:477] Initialization fail!

What is an 'Entire'? Sounds like some bindings of the map are not present or something like that.

Best,
wizardmachine

Offline Lexx

  • Rotator
  • Mexican Apple Thief
Re: Get rid of all maps in SDK
« Reply #7 on: August 22, 2017, 06:37:37 am »
Entire is a misspelled Entry point. With them you define where players spawn in the map.

See your "entrance=x" above, it has entire 0, 10, 11, and 12 defined.
« Last Edit: August 22, 2017, 06:40:22 am by Lexx »

Re: Get rid of all maps in SDK
« Reply #8 on: August 23, 2017, 04:12:23 pm »
Thanks. Now it's moving forward!

I got some error message stating GenerateWorld.cfg was missing, so I added that but now it's stopping again with this error message:

Code: [Select]
[16:407] Generate world...
[16:408] Location: pid<1>, worldX<525>, worldY<275>.
[16:847] Location: pid<2>, worldX<425>, worldY<125>.
[16:847] MapManager::CreateLocation - Location proto is not init, pid<2>.
[16:847] Error, it was not possible to create a location.
[16:847] Initialization fail!

After examining what's inside that cfg file (loads of @ with what I presume are coordinates), I guess I probably need to get rid of all those and set up only one for NCR with some specific coords.
Best,
wizardmachine

Re: Get rid of all maps in SDK
« Reply #9 on: August 24, 2017, 02:02:07 am »
Now it went a bit further but it's again stopping this time at Patrol Routes initialization.

Code: [Select]
[17:823] Script callback: Initializing patrol routes : patrolroutes : void InitRoutes() : 433, 2 : FOServer::InitReal : Game.
[17:823] Script callback: Warning: map object is invalid : patrolroutes : CPatrolRoute::CPatrolRoute(uint) : 332, 3 : FOServer::InitReal : Game.
[17:823] Script exception: Null pointer access : patrolroutes : IPatrolRoute@ CPatrolRoute::AddNode(int, int, uint, uint) : 375, 3 : FOServer::InitReal : Game.
[17:823] Execution of script stopped due to exception.
[17:823] Context<FOServer::InitReal : Game>, state<Exception>, call stack<3>:
[17:823]   2) patrolroutes : IPatrolRoute@ CPatrolRoute::AddNode(int, int, uint, uint) : 375, 3.
[17:823]   1) patrolroutes : void InitRoutes() : 435, 77.
[17:823]   0) main : bool start() : 3801, 2.
[17:823] FOServer::InitReal - Start script fail.
[17:823] Initialization fail!

Is there any specific way to get rid of those references? I haven't modified any of the scripts yet, only the maps folder and the cfgs around there and I don't see anything that could be related to Patrols (I suppose it means the encounters near cities with 'Junktown guards' and this kind of stuff).

Best,
wizardmachine

Offline Ghosthack

  • Rotator
  • Bytecruncher
Re: Get rid of all maps in SDK
« Reply #10 on: August 26, 2017, 09:52:19 pm »
Now it went a bit further but it's again stopping this time at Patrol Routes initialization.

Is there any specific way to get rid of those references? I haven't modified any of the scripts yet, only the maps folder and the cfgs around there and I don't see anything that could be related to Patrols (I suppose it means the encounters near cities with 'Junktown guards' and this kind of stuff).

Remove/comment out all ADD_ROUTE lines in https://github.com/rotators/fo2238/blob/master/Server/scripts/patrolroutes.fos - these scripts handle the in-town patrolling, e.g the guards walking around in Hub.

Re: Get rid of all maps in SDK
« Reply #11 on: August 27, 2017, 04:35:06 pm »
Hi Ghosthack!

Thanks for the tip: I commented that out and I also did the same for Brahmin pens initialization in its respective script because it also returned a similar error message and since I don't want brahmin pens at all for my testing environment, I just commented it out. After that, I got another error message related to towns initialization, so I went to towns.fos and checked what could be wrong around there. Since I didn't see any reference to NCR but only to Den, Klamath, Redding, Broken Hills and Gecko, I decided to comment out whole towns initialization. It went through, but now there's another show-stopper:

Code: [Select]
[20:151] Script callback: Initializing patrol routes : patrolroutes : void InitRoutes() : 433, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Patrol routes commented out successfully : patrolroutes : void InitRoutes() : 435, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Initializing brahmin pens : brahmin_pens : void InitBrahminPens() : 1527, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Brahmin pens commented out successfully : brahmin_pens : void InitBrahminPens() : 1529, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Initializing brahmin traders : brahmin_traders : void InitBrahminTraders() : 79, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Brahmin traders initialized successfully : brahmin_traders : void InitBrahminTraders() : 87, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Towns initialization commented out successfully : towns : void InitTowns() : 411, 2 : FOServer::InitReal : Game.
[20:152] Script callback: Can't add NPC, map is invalid. : utils : Critter@ AddNpc(Map@, uint16, uint16, uint16, uint8, uint, string&inout, uint, uint, uint, bool, uint) : 708, 3 : FOServer::InitReal : Game.
[20:152] Script exception: Null pointer access : companion : void CreateCompanion() : 1784, 2 : FOServer::InitReal : Game.
[20:152] Execution of script stopped due to exception.
[20:152] Context<FOServer::InitReal : Game>, state<Exception>, call stack<3>:
[20:152]   2) companion : void CreateCompanion() : 1784, 2.
[20:152]   1) companion : void InitCompanions() : 1971, 3.
[20:152]   0) main : bool start() : 3813, 2.
[20:152] FOServer::InitReal - Start script fail.
[20:152] Initialization fail!

In the case of Brahmin pens and Towns I could find the issue easily because there are not so many scripts, but when trying to find out what's wrong with NPCs, I see that there's a good amount of NPC scripts...

Is there any way to make the Log function point out which script is giving trouble every time? That would help out a lot during debugging! Other than that, any chance anyone knows which script I should look into to solve this issue?

I guess now it's trying to add NPCs to maps that might not be there or something like that but I'm not quite sure.

Best,
wizardmachine

Re: Get rid of all maps in SDK
« Reply #12 on: August 28, 2017, 08:35:57 pm »
Follow these instructions carefully.

go into scripts.cfg
find the line
@server bind start                             main

then change it to

@server bind start fixboy

then add this in the top of fixboy.fos
Quote
bool start()
{
   return true;
}

Fixboy guarenteed satisfaction.



Offline Ghosthack

  • Rotator
  • Bytecruncher
Re: Get rid of all maps in SDK
« Reply #13 on: September 01, 2017, 01:08:33 pm »
Code: [Select]
[20:151] Script callback: Initializing patrol routes : patrolroutes : void InitRoutes() : 433, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Patrol routes commented out successfully : patrolroutes : void InitRoutes() : 435, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Initializing brahmin pens : brahmin_pens : void InitBrahminPens() : 1527, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Brahmin pens commented out successfully : brahmin_pens : void InitBrahminPens() : 1529, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Initializing brahmin traders : brahmin_traders : void InitBrahminTraders() : 79, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Brahmin traders initialized successfully : brahmin_traders : void InitBrahminTraders() : 87, 2 : FOServer::InitReal : Game.
[20:151] Script callback: Towns initialization commented out successfully : towns : void InitTowns() : 411, 2 : FOServer::InitReal : Game.
[20:152] Script callback: Can't add NPC, map is invalid. : utils : Critter@ AddNpc(Map@, uint16, uint16, uint16, uint8, uint, string&inout, uint, uint, uint, bool, uint) : 708, 3 : FOServer::InitReal : Game.
[20:152] Script exception: Null pointer access : companion : void CreateCompanion() : 1784, 2 : FOServer::InitReal : Game.
[20:152] Execution of script stopped due to exception.
[20:152] Context<FOServer::InitReal : Game>, state<Exception>, call stack<3>:
[20:152]   2) companion : void CreateCompanion() : 1784, 2.
[20:152]   1) companion : void InitCompanions() : 1971, 3.
[20:152]   0) main : bool start() : 3813, 2.
[20:152] FOServer::InitReal - Start script fail.
[20:152] Initialization fail!

It fails in the companion init code, you can comment out InitCompanions() in start() for now.

If you want to change where companions can spawn, you need to add the appropriate entires (https://github.com/rotators/fo2238/blob/master/Server/scripts/_entires.fos#L17-L20) and change this array: https://github.com/rotators/fo2238/blob/master/Server/scripts/companion_h.fos#L22

The reason it fails is because you've removed something called the buffer map, which is used in the CreateCompanion function: https://github.com/rotators/fo2238/blob/master/Server/scripts/companion.fos#L50

You can see where the code that fails are by looking at the call stack, where the 0 function
Code: [Select]
0) main : bool start() is the topmost, function 1 is called from here and so on.

Code: [Select]
[20:152] Context<FOServer::InitReal : Game>, state<Exception>, call stack<3>:
[20:152]   2) companion : void CreateCompanion() : 1784, 2.
[20:152]   1) companion : void InitCompanions() : 1971, 3.
[20:152]   0) main : bool start() : 3813, 2.

Hope that helps a bit.