Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 7:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Using a Fork syntax
PostPosted: December 9th, 2009, 9:55 pm 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
Hi is there someone who can help me out with a script to move a set of frames using a fork syntax

So far I hav the following script

function startForkingl()
{
for (num=1; num<=3; num++)
{
eval("FrameFork"+num +".Show();");
wait(1);
//the next two actions I want to set as a fork syntax
eval(fork+"FrameFork"+num+".Scale(1,1,4,true);");
eval(fork"FrameFork"+num+".Move( 50, -50, 2, true );");
///no more fork here

wait(5);
eval("FrameFork"+num+".Scale(-0.95,-0.95,4,true);");
}
}

Thanks in advance for any help given

BR

Jim


Top
 Profile  
 
 Post subject:
PostPosted: December 9th, 2009, 11:17 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Jim,

Your syntax for forking makes little sense. You need to read the opus help manual - search fork in the index.


The fork function accepts a user function at the simplest level.

fork(runAnimation)

You cannot pass parameters! However, you can pass an object which is accessible within the function using the keyword 'this'.

fork(runAnimation, myObject)

In your example, the scale / move would be in their own functions and the objects FrameFork would be passed.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 10th, 2009, 2:26 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
I have used fork to run simultaneous loops...
here's a basic example, just three loops running counters...

/********************************************/
v1 = 0; v2 = 0; v3 = 0;

function f1() {
while(true){
wait(0.5);
v1++;
}
}

function f2() {
while(true){
wait(0.05);
v2++;
}
}

function f3() {
while(true){
wait(0.005);
v3++;
}
}

// start up the counter loops..

fork(f1);
fork(f2);
fork(f3);

/*******************************************/

Paul


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 39 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group