Move Speed

Started by thepenguin, December 21, 2012, 11:41:35 AM

Previous topic - Next topic

thepenguin

It says QueueMove works in pixels/sec, but how many pixels is one terrain cell (i.e. what's the speed for 5 cells/sec)
We have become the creeper...

Grauniad

A goodnight to all and to all a good night - Goodnight Moon

thepenguin

We have become the creeper...

thepenguin

#3
#Time
once
0->x1
0->x2
0->x3
0->y1
0->y2
0->y3
endonce

1 3 RandInt ->z9

<-z9 1 eq if
<-x1 ->x7
<-y1 ->y7
endif
<-z9 2 eq if
<-x2 ->x7
<-y2 ->y7
endif
<-z9 3 eq if
<-x3 ->x7
<-y3 ->y7
endif

CurrentCoords <-x7 <-y7 Distance ->Q7
<-Q7 8 mul ->P7
<-P7 <-Time div ->V7
<-x7 <-y7 <-V7 QueueMove
We have become the creeper...

lurkily

Remember to keep a space between the variable's value, and the ->VariableName

EDIT: With so many variables set to other variables, I just dumped the script into a CRPL tower to see what it did . . .

It just disappeared.  Hrm.

knucracker

#5
That script (After fixing the syntax errors) causes some exceptions at run time.  I need to add some more bounds checking....

--edit--
After making sure that a 0 or negate move speed is ignored, the code seems to just move the tower to coordinates 0,0.

thepenguin

#6
oh, yeah, x1, x2, x3 y1, y2, and y3 are the coordinates of the points you are moving between randomly. Just change those to go to other points:
Its part of a larger script, but it seems to work fine alone.
We have become the creeper...

thepenguin

once
RandXCoord ->x1
RandXCoord ->x2
RandXCoord ->x3
RandYCoord ->y1
RandYCoord ->y2
RandYCoord ->y3
endonce

1 4 RandInt ->z9

<-z9 1 eq if
<-x1 ->x7
<-y1 ->y7
endif
<-z9 2 eq if
<-x2 ->x7
<-y2 ->y7
endif
<-z9 3 eq if
<-x3 ->x7
<-y3 ->y7
endif

CurrentCoords <-x7 <-y7 Distance ->Q7
<-Q7 8 mul ->P7
<-P7 300 div ->V7
<-x7 <-y7 <-V7 QueueMove
We have become the creeper...