Page 1 of 1

Animated LOOP

Posted: Fri Aug 20, 2004 7:27 pm
by Dani
i know how to make a block go up and then go down again, with scripting, but how do i do it so that it does this in a continus loop?
Thanks

Posted: Fri Aug 20, 2004 9:40 pm
by hogleg
Atomic wrote:
partloop:

wait 5 // what ever you want

$part time .001 // time from wayD to wayA
$part moveto $wayA
$part waitmove

$part show
$part time 10.6 // the time that would be used to go from wayA to wayB
$part moveto $wayB
$part waitmove

$part hide
$part time .001 // time from wayC to wayD
$part moveto $wayC
$part waitmove

$part time .001 // time from wayD to wayA
$part moveto $wayD
$part waitmove

goto partloop

end

Posted: Fri Aug 20, 2004 11:32 pm
by lizardkid
for sound of mind since this is an infinite loop do this

Code: Select all

partloop: 

local.loopy = 1

while(local.loopy = 1)
{
wait 5 // what ever you want 

$part time .001 // time from wayD to wayA 
$part moveto $wayA 
$part waitmove 

$part show 
$part time 10.6 // the time that would be used to go from wayA to wayB 
$part moveto $wayB 
$part waitmove 

$part hide 
$part time .001 // time from wayC to wayD 
$part moveto $wayC 
$part waitmove 

$part time .001 // time from wayD to wayA 
$part moveto $wayD 
$part waitmove 
} 

end 

Posted: Sat Aug 21, 2004 7:42 am
by jv_map
while(1) :idea:

Posted: Sat Aug 21, 2004 11:32 am
by Dani
(soz about this, i didn't mean to post) - forget this lol

Posted: Sat Aug 21, 2004 11:33 am
by Dani
rit this is JUST like actionscript, would this work???:

blockmove:
while(1){
block moveup 432
block movedown 432
}
end


One thing is, that in actionscript if you have a while loop that continues for more than 15 seconds, it produces an error. Will it do it in this???

yes

Posted: Sat Aug 21, 2004 12:02 pm
by tltrude
Yes it will make the game crash. It needs a wait line inside the loop to slow it down--like "wait 1" or "wait .5". Also, targetnames in the script should look like this, "$block", and you need to add this line after each of the lines that set the direction of movement.

$block waitmove

Posted: Sat Aug 21, 2004 2:32 pm
by Dani
so will this work?:

while(1){
wait 3
$block moveup 432
$block waitmove
$block movedown 432
$block waitmove
}
end

Posted: Fri Aug 27, 2004 9:31 pm
by HDL_CinC_Dragon
cant you just do this:


If you want it to wait before it goes back down:

Code: Select all

block_loop:
$block loopsound lighthouse_run // if you want sound
$block moveup 123 // or how ever much you want it to go up
$block waitmove 
$block stoploopsound

wait 5 // or how ever long you want it to wait

$block loopsound lighthouse_run 
$block movedown 123 
$block waitmove 
$block stoploopsound 

goto block_loop
end
If you want it to wait before going back up:

Code: Select all

block_loop:
$block loopsound lighthouse_run // if you want sound
$block moveup 123 // or how ever much you want it to go up
$block movedown 123 
$block waitmove 
$block stoploopsound

wait 5 // or how ever long you want it to wait

goto block_loop
end

Posted: Fri Aug 27, 2004 9:36 pm
by Bjarne BZR
Dani wrote:so will this work?:

while(1){
wait 3
$block moveup 432
$block waitmove
$block movedown 432
$block waitmove
}
end
In short: yes :)