Author Topic: Path Camera Mod [V.1]  (Read 18230 times)

I'm having some trouble with /pathcamstart actually starting the camera. Anybody else? How often is /pathcamgo required to be used?

I'll submit to RTB probably sometime tonight.
« Last Edit: February 26, 2011, 09:39:39 PM by lilboarder32 »

I'm having some trouble with /pathcamstart actually starting the camera. Anybody else? How often is /pathcamgo required to be used?

I'll submit to RTB probably sometime tonight.
Same, every time.

Also, read my reply on the Gallery topic.


I found a typo in the script that was causing the camera not to start upon calling /pathCamStart. Will upload to RTB now, V1 will stay on Dropbox until it's approved on RTB.

I tested this today on a terrain build I had a while ago and got this: http://www.youtube.com/watch?v=0iz_MOTJ-58

I don't think anybody realizes how beautiful the argos would look with this


I don't understand what you are doing diffirently causing yours to work.
Code: [Select]
function gameConnection::cameraxBegin(%this, %unpause) {
if((%cam = %this.getCamerax()).sequenceLength < 1)
return;
%cam.setTransform(%cam.sequenceData[0, "position"] SPC %cam.sequenceData[0, "rotation"]);
%this.setControlObject(%cam);
if(!%unpause) {
%cam.setPosition(1);
%cam.setTarget(0);
}
%cam.setState(backward);
}

I don't understand what you are doing diffirently causing yours to work.
Code: [Select]
function gameConnection::cameraxBegin(%this, %unpause) {
if((%cam = %this.getCamerax()).sequenceLength < 1)
return;
%cam.setTransform(%cam.sequenceData[0, "position"] SPC %cam.sequenceData[0, "rotation"]);
%this.setControlObject(%cam);
if(!%unpause) {
%cam.setPosition(1);
%cam.setTarget(0);
}
%cam.setState(backward);
}
I don't know the context if your script. As in I have no clue what you defined the sequence data whatevers as.

Code: [Select]
function gameConnection::cameraxAdd(%this, %pos, %rot, %spd, %type, %path) {
if(%spd <= 0) {
commandToClient(%this, 'messageBoxOK', "Notice", "The path node could not be added because the speed is invalid.");
return;
}
switch$ (%type) {
case "Normal":
case "Position": %type = "Position Only";
case "Kink":
default:
commandToClient(%this, 'messageBoxOK', "Notice", "The path node could not be added because the type is invalid.");
return;
}
switch$ (%path) {
case "Linear":
case "Spline":
default:
commandToClient(%this, 'messageBoxOK', "Notice", "The path node could not be added because the path type is invalid.");
return;
}
%cam = %this.getCamerax();
%cam.pushFront(%pos SPC %rot, %spd, %type, %path);
if(%cam.sequenceLength < 20) {
%id = %cam.sequenceLength;
%cam.sequenceData[%id, "position"] = %pos;
%cam.sequenceData[%id, "rotation"] = %rot;
%cam.sequenceData[%id, "speed"] = %spd;
%cam.sequenceData[%id, "type"] = %type;
%cam.sequenceData[%id, "path"] = %path;
%cam.sequenceLength++;
}
else if(%cam.sequenceLength > 19) {
%cam.sequenceLength = 20;
for(%i=1;%i<20;%i++) {
%cam.sequenceData[%i - 1, "position"] = %pos;
%cam.sequenceData[%i - 1, "rotation"] = %rot;
%cam.sequenceData[%i - 1, "speed"] = %spd;
%cam.sequenceData[%i - 1, "type"] = %type;
%cam.sequenceData[%i - 1, "path"] = %path;
}
%cam.sequenceData[19, "position"] = %pos;
%cam.sequenceData[19, "rotation"] = %rot;
%cam.sequenceData[19, "speed"] = %spd;
%cam.sequenceData[19, "type"] = %type;
%cam.sequenceData[19, "path"] = %path;
}
if(%cam.sequenceLength > 19 && !%this.sequenceLengthWarned) {
%this.sequenceLengthWarned = true;
commandToClient(%this, "Warning", "You have reached the limit of 20 path nodes. Every node added from now on will erase a node at the start of the path.");
}
}

I didn't see anything specifically wrong in that segment that would affect the outcome, but I still don't know the whole context if your creating it correctly, typing in the function args correctly when calling it.
Maybe take it to Coding Help or take my script and try to complicate it into yours. What exactly doesn't work about yours?

Also on the setPosition method, your argument is going to be greater than 1, it's going to be the total number if knots/nodes in the path in your case.
« Last Edit: February 27, 2011, 04:29:48 AM by lilboarder32 »

Odd, the official documentation says that the arguments for pathCamera::setPosition are the following:
Code: [Select]
position
    A integer between 0.0 and 1.0 telling how far on the path the position is.

Odd, the official documentation says that the arguments for pathCamera::setPosition are the following:
Code: [Select]
position
    A integer between 0.0 and 1.0 telling how far on the path the position is.
I know, but either they updated it or wrote down false information, because .setPosition(0) takes you to the first knot, (1); to the second, (2); to the third, etc..

I don't really know how to use this..someone can explain me? :S

I don't really know how to use this..someone can explain me? :S
K.

All you need to know about PathCameras in 7+ steps
1) Spawn your player wherever you want.
2) Type in /createPathCam
3) Go to where you want your journey to start and type /setPath (Get into admin orb for this, if you are in player form the knot drops at your feet)
4) Go to the next place you want to visit and type in /setPath again (It would be useful to copy and paste it each time)
5) You can continue setting "Knots" until you are done, 20 maximum.
6) Now that you are done setting up, type /pathCamStart. This may take a while, if it's your first time.
7) When the path camera loads, you should become the camera, and it should start moving forward, thanks to the new fix (If it doesn't, type /pathCamGo and it should start moving).
     - Now you will move through all the knots you created
     - Type /pathCamStop to stop the camera where it is, and /pathCamGo to start it again.
     - Type /pathCamHelp to find out more advanced commands



Feel free to use this in OP, lil