Author Topic: Pathcam won't work in gamemode.  (Read 14528 times)

I put the code in my gamemode and have it execute like this:
Code: [Select]
// load the internal addon files
// these are in the gamemode because people might not have these addons
exec("./Script_PathCam/server.cs");
exec("./Event_PathCam/server.cs");

With the files being organized like this:
Code: [Select]
My gamemode
Script_PathCam
PathCam.cs
server.cs
Event_PathCam
PathCam.cs
server.cs

I also removed this from the event's coding, as it already exists in the gamemode itself:
Code: [Select]
%force = forceRequiredAddon("Script_PathCam");

if(%force == $Error::AddOn_NotFound)
{
error("Script_PathCam not found!");
return;
}

How come it won't work? This method is working for other addons. I have setplayertransform's code in the same way.

We can't really help you unless you show us the actual part of the console output where your gamemode is executing.

Code: [Select]
Loading Add-On: GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP (CRC:-711415486)
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/server.cs.
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Script_PathCam/server.cs.
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Script_PathCam/PathCam.cs.
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_PathCam/server.cs.
Executing Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs.
WARNING: RTBR_ServerControl_Hook.cs has moved. Please alter to use hooks/serverControl.cs
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_PathCam/PathCam.cs.
Activating package: EventCam
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_onRelay/server.cs.
Activating package: onRelay
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_setPlayerTransform/server.cs.
Executing Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_setPlayerTransform/Event_SetPlayerTransform.cs.
Activating package: RotSetTransformOverwrite
4 datablocks added.

Code: [Select]
Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_PathCam/PathCam.cs (226): Unable to find object: '' attempting to call function 'setControlObject'
BackTrace: ->ProjectileData::OnCollision->ProjectileData::Damage->ShapeBase::Damage->[BotHolePackage]armor::Damage->armor::Damage->[EventCam]armor::onDisabled


Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_PathCam/PathCam.cs (226): Unable to find object: '' attempting to call function 'setControlObject'
BackTrace: ->ProjectileData::OnCollision->ProjectileData::Damage->ShapeBase::Damage->[BotHolePackage]armor::Damage->armor::Damage->[EventCam]armor::onDisabled


Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_PathCam/PathCam.cs (226): Unable to find object: '' attempting to call function 'setControlObject'
BackTrace: ->ProjectileData::OnCollision->ProjectileData::Damage->ShapeBase::Damage->[BotHolePackage]armor::Damage->armor::Damage->[EventCam]armor::onDisabled


Add-Ons/GameMode_Blockland_Turmoil_-_Episode_IHAVENOTGIVENUPIHAVENOTGIVENUP/Event_PathCam/PathCam.cs (226): Unable to find object: '' attempting to call function 'setControlObject'
BackTrace: ->ProjectileData::OnCollision->ProjectileData::Damage->ShapeBase::Damage->[BotHolePackage]armor::Damage->armor::Damage->[EventCam]armor::onDisabled

Does this help?

Here's the entire console:

Don't package the mods in your game mode. Just make a link for everybody to download them separately.

I'd rather not force people to download add-ons to use my gamemode. If I make the gamemode plug and play, people might be more interested in it.

How about have the server.cs files of the add-ons, inside the gamemode, looks like you did that, but have them not in a different folder, just inside the zip/folder, like for the gamemode server.cs,
Code: [Select]
exec("./Script_PathCam.cs");
exec("./Event_PathCam.cs");
exec("./Event_SetPlayerTransform.cs"); //this is a rename of the server.cs file for the addon.
If that doesn't help, I tried.

Im 95% sure the pathcam add-ons didn't work, or were extremely glitchy to the point of crashing servers. Looking at the errors, it would seem that the problem is within the add-on itself.

Im 95% sure the pathcam add-ons didn't work, or were extremely glitchy to the point of crashing servers. Looking at the errors, it would seem that the problem is within the add-on itself.
It worked perfectly when i was making and testing the build in custom gamemode. I'm just trying to put the addon in the gamemode itself so people wont have to download it.

Okay I looked into this problem deeper and it seems bricks loaded by the gamemode can't start a pathcam, but when i build bricks and have them start the pathcam it works. I've tried changing the brick owner to the host's and that did not work. I did solve that console spam I stated above though. The bricks do have the events, so I have no idea why it's not working.

Perhaps the bricks are loaded in public ownership?

try to load as yourself