FOnline Development > Questions and Answers
Get rid of all maps in SDK
Ghosthack:
--- Quote from: wizardmachine 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.
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).
--- End quote ---
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.
wizardmachine:
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: ---[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!
--- End code ---
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.
devis:
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;
}
--- End quote ---
Fixboy guarenteed satisfaction.
Ghosthack:
--- Quote from: wizardmachine on August 27, 2017, 04:35:06 pm ---
--- Code: ---[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!
--- End code ---
--- End quote ---
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: ---0) main : bool start()
--- End code ---
is the topmost, function 1 is called from here and so on.
--- Code: ---[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.
--- End code ---
Hope that helps a bit.
Navigation
[0] Message Index
[*] Previous page
Go to full version