Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Stopping a loop action part way through.
PostPosted: November 20th, 2007, 7:06 pm 
Offline

Joined: November 7th, 2004, 2:49 pm
Posts: 20
Location: England
Hey there,
I am currently developing a game engine in Opus Pro XE 5.5 and after coming across many wierd obstacles in the coding, I have come to one which I have no idea how to solve.
At the moment I have a variable called speed. When the variable is "0" a multiframe displays frame 17 and when the variable is "1" the multiframe cycles through frames 1-8 at a certain speed using:
Code:
Variable Changed <speed>
- If (speed = 1) then
- - Loop while speed = "1"
- - - Go to a specific frame MultiFrame 1
- - - Delay 0.20
- - - Go to a specific frame MultiFrame 1
- - - Delay 0.20
etc...

When the variable is "2" it does another loop using the same coding as "1" but with different delay times
When I preview and change the variable number the loop has to finish before changing or sometimes it speeds up to go to the next loop. Is there a way I can switch between the loops immediately?

I can attach the imp if you need to have a further look at the coding.

Also, if you can help me out I'll put you in the credits as a Special Thanks. :D


For this message M-One has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 20th, 2007, 7:36 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
You can break out of a loop with "break" -- no quotes.
If that's not what you want it will be easier to help if we can see what the script looks like.

Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 20th, 2007, 7:54 pm 
Offline

Joined: November 7th, 2004, 2:49 pm
Posts: 20
Location: England
paul wrote:
You can break out of a loop with "break" -- no quotes.
If that's not what you want it will be easier to help if we can see what the script looks like.

Paul


I have put the break in before each loop action but it does not work... I shall attach the imp and required resources so you can have a gander.

Note: The actions for each loop are found in Page 1's actions
When you preview the publication, move the mouse over the red and yellow areas on the right side and then back the the middle to change the speed variable number
dark red = speed 0
red = speed 1
yellow = speed 2
the code for the other bars have not been implemented yet.


Please do not download this file for your own personal use without asking and crediting me for the hours I have spent coding this, Thank you.


You do not have the required permissions to view the files attached to this post.


For this message M-One has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Urgent
PostPosted: November 21st, 2007, 5:42 pm 
Offline

Joined: November 7th, 2004, 2:49 pm
Posts: 20
Location: England
Umm... I don't know if the bumping rules have changed since I registered in 2004, but I'm gonna post a sneaky bump as a matter of urgency, as I'm running to a tight deadline.


For this message M-One has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 21st, 2007, 8:13 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Sorry, I assumed that when you said "Game engine" you meant that you would be working in script and not mixing short scripts with a lot of built in actions.
In a project like this I would put everything into a script object as it is much easier to follow the logic flow.
Maybe someone else can help.

Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject: To Opus Script I go!
PostPosted: November 21st, 2007, 8:25 pm 
Offline

Joined: November 7th, 2004, 2:49 pm
Posts: 20
Location: England
I still have time, I might be able to convert what I have in actions to make them one big script. I might need to look up some commands but I should be able to figure it out.
Thanks again for you time and advice, Paul. :)

To opus script I go!


For this message M-One has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 21st, 2007, 9:00 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
break won't work because each action will complete before returning to the condition check.

I've changed the MF advances into a simple script but am not sure what you are trying to achieve so you'll need to hack it, but I hope its a start.

Mack


You do not have the required permissions to view the files attached to this post.

_________________
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


Last edited by mackavi on November 21st, 2007, 9:08 pm, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 21st, 2007, 9:04 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I don't understand how it all works, but why do you repeat the same thing in the loop??
Go to multiframe 1, then delay...repeated 8 times why not just do it once in the loop, since the loop repeats until the condition is false....so I must be missing something??

A 'Loop while' will test the condition (speed=1) then it must complete the block below and test the condition again (speed=1) so can you not delete 7 of the "go to a specific frame multiframe 1...Delay 0.2"

in this way, it would test the condition after every "go to specific......."

and break from the loop immediately.

When I try to run it---nothing really happens--I'm unsure what it should be doing or what to do????

but looks very interesting.

also...I would have used the test for speed=? to set a variable, then send it round the same loop but the delay would be determined by the variable.
(if you can do it in scripting---that's the way to go :-) )
Sandy

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 21st, 2007, 9:14 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I have just noticed what's supposed to happen in your loop and my suggestion above is no use... :-) I didn't notice that it goes to a different frame each time, so now it makes more sense.

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 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