Grim_Wizard Posted December 16, 2021 Report Share Posted December 16, 2021 Hey all,  I'm working on a custom freeplay script to spawn vehicles. I have looked around and found that several mods use fp.freeplay.script to spawn vehicles and turn door occlusion off. When the game starts the script should execute two debug lines into the log file  bool OnLoad() { start(); System::SetEnv("e4_doocclusion", 0); Process::Kill(); return true; System::LogFile("At least the script file loaded"); } void start() { GameObjectList spawnerList("SCSpawner"); GameObject spawner = spawnerList.GetObject(0); Game::ExecuteCommand("SpawnVehicles", &spawner); System::LogFile("It's working dingus"); };  When executing SpawnVehicles an additional debug line is logged. SpawnVehicles works fine on its own, however I can tell that the script is not being executed as there is no debug line in the logfile. I have looked around, but I cannot figure out if I have to link the script file in the editor or do any additional work. I have also looked through the spec xmls to make sure that I'm not missing a file path and couldn't find anything. Any help? Quote Link to comment Share on other sites More sharing options...
Firequi Posted December 16, 2021 Report Share Posted December 16, 2021 I believe it should be System::Log instead of LogFile Quote Link to comment Share on other sites More sharing options...
Grim_Wizard Posted December 16, 2021 Author Report Share Posted December 16, 2021 2 hours ago, Firequi said: I believe it should be System::Log instead of LogFile They both print to the log file, and my other scripts register the debug information to the logfile with System::LogFile Quote Link to comment Share on other sites More sharing options...
The Loot Posted December 17, 2021 Report Share Posted December 17, 2021 Quick idea is to check that the map object is named correctly, and that it has no flags/properties that would allow it to be interacted with in any way (I had a flag set that would allow a crane to pick up an object I used when I first added Limited Water to my personal mod). Can also try these lines GameObjectList spawnerList("SCSpawner"); if (spawnerList.GetNumObjects()>0) { GameObject Obj=spawnerList.GetObject(0); Game::ExecuteCommand("SpawnVehicles",&Obj); System::Log("Freeplay: Vehicle Spawns Started"); } else System::Error("Freeplay: Vehicle Spawner Not Found"); Â Quote Link to comment Share on other sites More sharing options...
Grim_Wizard Posted December 17, 2021 Author Report Share Posted December 17, 2021 I fixed the issue. This mission folder had a spelling mistake in it Quote Link to comment Share on other sites More sharing options...