Animated LOOP

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Dani
Sergeant Major
Posts: 113
Joined: Mon Mar 08, 2004 6:45 pm
Contact:

Animated LOOP

Post 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
User avatar
hogleg
General
Posts: 1577
Joined: Tue Sep 09, 2003 5:23 pm
Location: Down South Hillbilly Country

Post 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
"all the governments in the world are corrupt and in the hands of the Illuminati"
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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 
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

while(1) :idea:
Image
Dani
Sergeant Major
Posts: 113
Joined: Mon Mar 08, 2004 6:45 pm
Contact:

Post by Dani »

(soz about this, i didn't mean to post) - forget this lol
Last edited by Dani on Sat Aug 21, 2004 11:34 am, edited 1 time in total.
Dani
Sergeant Major
Posts: 113
Joined: Mon Mar 08, 2004 6:45 pm
Contact:

Post 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???
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

yes

Post 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
Tom Trude,

Image
Dani
Sergeant Major
Posts: 113
Joined: Mon Mar 08, 2004 6:45 pm
Contact:

Post by Dani »

so will this work?:

while(1){
wait 3
$block moveup 432
$block waitmove
$block movedown 432
$block waitmove
}
end
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post 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
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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 :)
Admin .MAP Forums
Image
Head above heels.
Post Reply