George Felix
Forum Replies Created
-
Thank you, but I was looking something more general to have.
Basically I’m looking for a command that would test if a variable exists or not. If it is defined or undefined. Each variable will corresponds to a specific location on the field. If it exists, then its composition’s opacity will be 100% and will show. If the variable does not exists, then the composition’s opacity will be 0%
One way of doing this is in my data file (text file) in the first lines I would zero out, all of the variables. Later on I could the ones that correspond to the players position a value. I would then do a test to see if the value is zero on not, but really don’t want to go that way.
Thank you
George -
George Felix
July 7, 2017 at 4:49 pm in reply to: Change value of a field in a different composition.I don’t know how to thank you!!!!!!
It works great!!!!
Thanks
George
-
George Felix
July 7, 2017 at 2:46 pm in reply to: Change value of a field in a different composition.I would like to be able to make a loop counter .
I’m making a game clock which will run for 45 minutes. I figured to have the scored change automatically when the clock reaches the time that a goal is scored.
Originally the goals scored of team A is 0.
At 10:05, they score a goal.
This time is at the frame of (10*60 + 5) = 605 seconds and if we have 30 frames per second, then at frame 18150, the score should change from 0 to 1.At frame 31150 they score a second goal, then the 1 should change to 2. Every time a frame is reached that a new goal is scored, the value displayed should change by 1.
Is their a work around.
We know how many goals will be scored in the half, and the frame that they are scored upon.
Any help will be greatly appreciated.
George
-
I have finished this portion of the project. Below is the finished code.
Thank you for your help!!
You have saved me hours of work!!!
George
str = "+00:17";
extraTime = 45;
frameRate = 1/thisComp.frameDuration;
sp = str.slice(0,1);
if(sp == "+") {strA = str.slice(0);
timeArray = strA.split(":");
numFrames = ((timeArray[0]+extraTime)*60*frameRate) + (timeArray[1]*frameRate);
Math.round(numFrames);} else {
timeArray = str.split(":");
numFrames = (timeArray[0]*60*frameRate) + (timeArray[1]*frameRate);
Math.round(numFrames);
} -
I figured it out
str = “+05:17”;
sp = str.slice(0,1);if( sp == “+” ) {
1 } else { 0}
-
Thank you very much!
You just saved me hours of work. It works excellent.
I am writing a soccer program and the output files of the program will be used to create the after effects graphics.
I have one more question,
The times that I had given you was when a goal was scored. Sometimes a goal will be scored in extra stoppage time, where the string will have a format of
+02:36
The “+” represents that the time is after the 45th minute mark, or the 90th minute mark, or the 105th minute mark or the 120th minute mark where the 02 is in minutes and the 36 is in seconds.
How do I remove the first character to test if it is a “+”. Is there a function that I can just get the first character and test it as a character ? And what is the format of the if else statement?
George
-
Thank you
One more questions, can you read data from a MS Access database with expressions and if so, what would the code be.
George
-
Yes, the same file, just change the extension from “.prn” to “.txt” but it does not work.
-
An other question, would it be possible to link the data file on a web server and have a path like
https://www.inkarpathos.gr/program/user1/data.txt
in the script?
-
Variable to be imported for soccer graphics. Below is the variables which their are about 125 different ones.
The same file gets imported if the extension is a “.prn” instead of a “.txt”
var TeamH = ["test1","test1","test1"];
var GoalieH = ["test1","test1","test1"];
var RbackH = ["test1","test1","test1"];
var CRbackH = ["test1","test1","test1"];
var CLbackH = ["test1","test1","test1"];
var LbackH = ["test1","test1","test1"];